C)zy Posted October 9, 2011 Report Share Posted October 9, 2011 Am si eu o problema...am un script AJAX rate...v 1.7 (ultima) si am o problema..... Am un script unde pot adauga server de cs si fiecarui server ii corespunde un "id" (numar) . Scriptul de implementare a scriptului rate intr-un alt script este : <? echo pullRating(ID,true,false,true); ?> Unde ID este un numar...numarul pe care se inregistreaza votul...spre exemplu daca id-ul serverul si "id" din acest script sunt asemenea , cand votez , votul se inregistreaza pentru acel server . Eu am scriptul urmator : <?php include("include/rating_functions.php"); require ('include/statistici.php'); // If current page number, use it // if not, set one! if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } // Define the number of results per page /////////// afisare randuri $ordine = "desc"; $max_results = 15; /////////// // Figure out the limit for the query based // on the current page number. $from = (($page * $max_results) - $max_results); // Perform MySQL query on only the current page number's results ?> <center>Lista HLDS</center><br><br> <center><table border=0 class=margins cellspacing=1 width=90%> <tr> <td align=center><b>[ Live Stats]</b></td> <td align=center><b>[ Adress ]</b></td> <td align=center><b>[ Port ]</b></td> <td align=center><b>[ Slots ]</b></td> <td align=center><b>[ Anticheat ]</b></td> <td align=center><b>[ ISP ]</b></td> <td align=center><b>[ Mod ]</b></td> <td align=center><b>[ Country ]</b></td> <td align=center><b>[ Rate ]</b></td> </tr> <?PHP $sql = mysql_query("SELECT * FROM server order by id $ordine LIMIT $from, $max_results "); $num=1; while($rand = mysql_fetch_array($sql)){ // Build your formatted results here. $num++; if(($num%2)!=0){ $bg=""; }else{ $bg=""; } $post = substr($rand[5],0,40); ?> <td class=margins><center><a target='_blank' title='CsManiack.COm' onClick=window.open('stats/index.php?ip=<?=$ip?>&port=<?=$port?>','mywindow','width=520,height=680')>Verifica</a></center></td> <td class=margins><center> <?=$rand['ip']?> </center></td> <td class=margins><center> <?=$rand['port']?> </center></td> <td class=margins><center> <?=$rand['player']?> </center></td> <td class=margins><center> <?=$rand['cod']?> </center></td> <td class=margins><center> <?=$rand['net']?> </center></td> <td class=margins><center> <?=$rand['modul']?> </center></td> <td class=margins><center> <?=$rand['tara']?> </center></td> <td class=margins><center> <? echo pullRating($rand['id'],false,false,true); ?> </center></td> </tr> <?PHP } echo "</table>"; // Figure out the total number of results in DB: $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM server"),0); // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($total_results / $max_results); echo "<br><br>"; echo "<center>Sunt $srv_number servere in baza de date<center>"; echo "<br><br>"; // Build Previous Link if($page > 1){ $prev = ($page - 1); echo "<a class=\"menu_link\" href=\"".$_SERVER['PHP_SELF']."?page=$prev\" ><< Inapoi</a> "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\" class=\"menu_link\">$i</a> "; } } // Build Next Link if($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\" class=\"menu_link\">Urmatoarele >></a>"; } echo "</center>"; ?> Mie imi arata ip , port , player etc cum trebuie ...de la linia $rand[ip] spre exemplu ( aceasta linie fiind pentru ip ) . Si normal ar trebui sa imi puna in script...id-ul servarului in linia $rand['id'] ... dar nu o face....in timp ce , celalte (ip , nume , player etc..) le arata.. Nu stiu daca intelegeti ce vreau sa zic . Va rog sa ma avutati ...sau daca nu ..as vrea daca se poate in rate script simplu ca pe serverele de pe freakz.ro ... sau play.celife.ro ..... un plus care adauga vot intr-o baza de date.. 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.