Skip to content

Instantly share code, notes, and snippets.

@avuenja
Last active August 29, 2015 14:19
Show Gist options
  • Save avuenja/d9b911dabcf925c4bfb9 to your computer and use it in GitHub Desktop.
Save avuenja/d9b911dabcf925c4bfb9 to your computer and use it in GitHub Desktop.
Top 10 level with magic level
<table cellpadding="0" cellspacing="0" style="MARGIN-LEFT: 9px">
<tbody>
<tr background="/templates/naruto/images/homepage.png">
<td width="537" height="37">
<center>
<a style="color: yellow; font-size: 12px; text-shadow: #3d2e05 ;"> <b>Top 10</b> </a>
</center></td>
</tr>
</tbody>
</table>
<?php
$ots = POT::getInstance();
$ots -> connect(POT::DB_MYSQL, connection());
$SQL = $ots -> getDBHandle();
$money_list = $SQL->query('SELECT name, level, experience, maglevel FROM players ORDER BY experience DESC, maglevel DESC LIMIT 10')->fetchAll();
$i = 1;
foreach ($money_list as $money_chr) {
echo '<center>';
echo $i . '. <a href="' . WEBSITE . '/index.php/character/view/' . $money_chr['name'] . '">';
$player = $ots -> createObject('Player');
$player -> find($money_chr['name']);
echo '<font color="';
echo($player -> isOnline()) ? 'green' : 'red';
echo '">';
echo '<b>' . $money_chr['name'] . '</b></a></font>';
echo '<br>Level: <span style="color: #FFFFFF; font-weight: bold;">' . $money_chr['level'] . '</span>&nbsp;&nbsp;&nbsp;&nbsp;';
echo 'Ninjutsu: <span style="color: #32578B; font-weight: bold;">' . $money_chr['maglevel'] . '</span><br>';
$i++;
}
for ($i; $i <= 10; $i++) {
echo $i . '. <br><i>Empty</i><br /><br />';
}
echo '</center>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment