waplet Posted February 14, 2010 Report Share Posted February 14, 2010 Mhm :D Quote Link to comment Share on other sites More sharing options...
2easy Posted February 14, 2010 Report Share Posted February 14, 2010 waplets gribēja tevi mazliet pabaidīt ^^ Quote Link to comment Share on other sites More sharing options...
waplet Posted February 14, 2010 Report Share Posted February 14, 2010 (edited) Kāpēc pabaidīt.. viss ir iespējams.. i can explain, but should i? :D Edited February 14, 2010 by waplet Quote Link to comment Share on other sites More sharing options...
2easy Posted February 14, 2010 Report Share Posted February 14, 2010 labāk ka tu to tagad explainosi, nekā vēlāk būs kkādi prikoli tiem, kas reāli lietos to skriptu :P Quote Link to comment Share on other sites More sharing options...
waplet Posted February 14, 2010 Report Share Posted February 14, 2010 tātad.. ātri uzmetot aci skriptam secinam , ka function VoteVideo(video_id, user_ip) { $("input:radio").each(function(){ if($(this).is(":checked")){ var vote = this.value; $.post("video_rating.rpc.php", { video_id: video_id, user_ip: user_ip, vote: vote }); } else { } }); $("#vote_do").load("video_rating.form.php?video_id="+video_id); } ir javascript funkcija,tas nozīme,ka viss notiek klient side. tālāk skatamies.. $user_ip = $_SERVER['REMOTE_ADDR']; <input type="button" value="Balsot" onclick="VoteVideo(\''.intval($_GET['id']).'\',\''.$user_ip.'\'); return false;"> lol.. IP ir padota caur js.. ņemam talkā firebug'u un votojoam cik gribam :D Quote Link to comment Share on other sites More sharing options...
2easy Posted February 14, 2010 Report Share Posted February 14, 2010 (edited) lol, tiešām! kr4 tajā video_rating.rpc.php vajag pārbaudīt, vai no šādas ip jau ir balsots par konkrēto video ;) ātri raksti bugfix, kamēr tavam skriptam vēl nav miljons downloadi :D Edited February 14, 2010 by 2easy Quote Link to comment Share on other sites More sharing options...
waplet Posted February 14, 2010 Report Share Posted February 14, 2010 2easy ir jau pārbaudes.. btw.. $ip = $_SERVER... deŗētu ielikt iekš video_rating.rpc.php.. jo kleints jau pieprasa tatad būs viņa ip tur.. labi pietiks šeit floodu dziit.. jaiet gulet :D Quote Link to comment Share on other sites More sharing options...
anonīms Posted February 14, 2010 Author Report Share Posted February 14, 2010 toč.. :/ Likās, ka esmu izveidojis pārbaudi. Vispār jau to js funkciju var aizstāt ar šo, jo ip tur točn nav vajadzīgs function VoteVideo(video_id) { $("input:radio").each(function(){ if($(this).is(":checked")){ var vote = this.value; $.post("video_rating.rpc.php", { video_id: video_id, vote: vote }); } else { } }); $("#vote_do").load("video_rating.form.php?video_id="+video_id); } Quote Link to comment Share on other sites More sharing options...
waplet Posted February 14, 2010 Report Share Posted February 14, 2010 :D Quote Link to comment Share on other sites More sharing options...
2easy Posted February 15, 2010 Report Share Posted February 15, 2010 hmm, un tiem kas nestrādā ajax? vai vari uztaisīt to balsošanu tā, ka tiem kam nav ajax, tiem forma nosūtās kā parasti, bet pārējiem ir ajax requests? Quote Link to comment Share on other sites More sharing options...
anonīms Posted February 15, 2010 Author Report Share Posted February 15, 2010 (edited) kuram mūsdienās ir izslēgts javascripts? :D Ideja laba, bet jāgaida iedvesma kaut ko darīt. EDIT: A kām na ar to input pogu darīt? precīzāk kā dabūt gatavu, lai, ja ir ieslēgts js, tad rāda to pogu. ar izslēgtu ir skaidrs... kods piemēram: <script lanugage="javascript"> // te vajag kko izdomāt <input type="button" value="Balsot" onclick="VoteVideo('<?=intval($_GET['id']);?>'); return false;"> </script> <noscript> <input type="submit" value="Balsot" name="VoteVideo" /> </noscript> Edited February 15, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
2easy Posted February 15, 2010 Report Share Posted February 15, 2010 to dara tā. uztaisi lai forma sūtās kā jau parasti tas notiek, kad nav nekādi ajaxi. pēc tam lai papildinātu to ar ajax (tajos browseros, kur var izveidot http objektu), pārķer formas submit eventu un tā vietā nosūti ajax requestu. realizācija ir tavā ziņā. ja visu pateikšu priekšā, pašam vairs nebūs tik interesanti :P Quote Link to comment Share on other sites More sharing options...
anonīms Posted February 15, 2010 Author Report Share Posted February 15, 2010 Zini :D Es pārdomāju.. kkā dikti sarežģīti izklausās no tavas mutes :] Labāk pastrādāšu ar forums[read/unread] Quote Link to comment Share on other sites More sharing options...
2easy Posted February 15, 2010 Report Share Posted February 15, 2010 ja viss vnm būtu vnkārši, tad jau nebūtu challenge ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.