Jump to content
  • 0

[Help] PHP Code for stats Top Adena.. "Example Top100"


Question

Posted

$data=mysql_query("SELECT * FROM items WHERE $where AND item_id>57 ORDER BY    count   DESC LIMIT 100") or die('Íå óäàëîñü ïîëó÷èòü äàííûå èç áàçû.');

 

h**p://www.l2magnet.com/Stats/tadena.php

 

The problem that does not identify the characters

 

Where is Exactly code? :|

 

Table:

 

<?php
//Top Images
echo "<table><thead><tr><th></th><th><img src='img/top/gender.png'></th><th><center><img src='img/top/pln.png'></center></th><th><img src='img/top/lvl.png'></th><th> <center><img src='img/top/prof.png'></center></th><th><center><img src='img/top/clan.png'></center></th><th><img src='img/top/pvp.png'></th><th><center></center></th><th><img src='img/top/status.png'></th><th></th><tr></thead>\n";
//Clan Data
$result2 = mysql_query("SELECT clan_id,clan_name FROM clan_data", $link)
   or die ("Error: ".mysql_error());
 while ($row2=mysql_fetch_row($result2))
   $clans_array[$row2[0]]=$row2[1];
 $clans_array[0]="";
$n=1;
while ($top=mysql_fetch_array($data))
{
   $onlinetimeH=round(($top[onlinetime]/60/60)-0.5);
   $onlinetimeM=round(((($top[onlinetime]/60/60)-$onlinetimeH)*60)-0.5);
   $clan=mysql_fetch_array(mysql_query("select * from clan_data where clan_id=$top[clanid]"));
   if ($clan[clan_name]=='') { $clan[clan_name]=""; }
   if ($top['sex']==0) { $name='<font color=#FFFF33><strong>'.$top[char_name].'</strong></font>'; } else { $name='<font color=#FFFF33>'.$top[char_name].'</font>'; }
   $class=mysql_fetch_array(mysql_query("select ClassName from char_templates where ClassId=$top[classid]"));
   if (($top['sex']==0) && ($top['race']==5)) { $img='./img/race/kameal_M.gif'; }
   if (($top['sex']==1) && ($top['race']==5)) { $img='./img/race/kameal_V.gif'; }
   if (($top['sex']==0) && ($top['race']==4)) { $img='./img/race/Dwarf_M.gif'; }
   if (($top['sex']==1) && ($top['race']==4)) { $img='./img/race/Dwarf_V.gif'; }
   if (($top['sex']==0) && ($top['race']==2)) { $img='./img/race/Delf_M.gif'; }
   if (($top['sex']==1) && ($top['race']==2)) { $img='./img/race/Delf_V.gif'; }
   if (($top['sex']==0) && ($top['race']==0)) { $img='./img/race/Human_M.gif'; }
   if (($top['sex']==1) && ($top['race']==0)) { $img='./img/race/Human_V.gif'; }
   if (($top['sex']==0) && ($top['race']==1)) { $img='./img/race/elf_M.gif'; }
   if (($top['sex']==1) && ($top['race']==1)) { $img='./img/race/elf_V.gif'; }
   if (($top['sex']==0) && ($top['race']==3)) { $img='./img/race/Orc_M.gif'; }
   if (($top['sex']==1) && ($top['race']==3)) { $img='./img/race/Orc_V.gif'; }
   if (($top['online']==0) && ($top['online']==0))  { $on='./img/others/icon_offline.gif'; }
   if (($top['online']==1) && ($top['online']==1))  { $on='./img/others/icon_online.gif'; }
   if (($top['nobless']==1) && ($top['nobless']==1))  { $nobless='./img/others/Tiara.gif'; }
   if (($top['nobless']==0) && ($top['nobless']==0))  { $nobless='./img/others/cross.png'; }
   if (($top['sponsor']==0) && ($top['sponsor']==0))  { $sponsor='./img/others/cross.png'; }
   if (($top['sponsor']==1) && ($top['sponsor']==1))  { $sponsor='./img/others/DonatorMushroom.png'; }

   
   
   else {$online='<font color=red>Offline</font>'; } 
echo "'<tr><td><b></b></td><td><center><img src='$img'></center></td><td><center><font color=#F8F8F8><strong>$name</strong></fonts></center></td><td><center><font color=#F8F8F8><strong>$top[level]</strong></fonts></center></td><td><center><font color=#FFFF33><strong>$class[ClassName]</strong></fonts></center></td><td><center><center><font color=#F8F8F8><strong>$clan[clan_name]</strong></fonts></center> </td><td><center><b><font color=#FFFF33><strong>$top[count]</strong></fonts></b></center></td><td><center></center></td><td><img src='$on'></td><td><center></center></td></b></tr>"; 
   $n++;
}
//Done
echo '</table>';
?>

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock