TomCrusher
Jeg er ingenting
Hello Otlanders!
I will share with you my new own work. Here is it Mock's Snake Highscore on web into ModrernACC.
Go to admin panel and open "Pages" link then cick on "Create Page" and give "snake" as new name of page then put into content:
You must ofcourse make some mod into snakes lib but it's other case .
I will share with you my new own work. Here is it Mock's Snake Highscore on web into ModrernACC.
Go to admin panel and open "Pages" link then cick on "Create Page" and give "snake" as new name of page then put into content:
PHP:
<div class='message'>
<div class='title'>Snake Highscores</div>
<div class='content'>
<?php
//Script by TommyCrusher
//Made for Modern AAC by Paxton
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
$level = array();
$level[] = array('storage'=>28103, 'value'=>1, 'name'=>'Easy');
$level[1] = array('storage'=>28104, 'value'=>1, 'name'=>'Medium');
$level[2] = array('storage'=>28105, 'value'=>1, 'name'=>'Hard');
echo '<div style="text-align: center; font-weight: bold;">Highscore Snake Game on ' . $config['server_name'] . '</div>
<table border="1" cellspacing="1" cellpadding="4" width="100%">
<tr>
<td class="white" style="text-align: center; font-weight: bold;">Name</td>
<td class="white" style="text-align: center; font-weight: bold;">Level</td>
<td class="white" style="text-align: center; font-weight: bold;">Points</td>
</tr>';
$i = 0;
foreach($level as $value) {
foreach($SQL->query('SELECT `p`.`name` AS `name`, `ps`.`value` as `points`
FROM `player_storage` ps
LEFT JOIN `players` p ON `ps`.`player_id` = `p`.`id`
WHERE `ps`.`key` = "'.$value['storage'].'"
GROUP BY `points`
ORDER BY `points` DESC, `name` ASC
LIMIT 0,30;') as $player)
{
$i++;
echo '<tr class="highlight">
<td><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"><center>' . $player['name'] . '</center></a></td>
<td><center>' . $value['name'] . '</center></td>
<td><center>' . $player['points'] . '</center></td>
</tr>';
}
}
echo '</table>';
?>
</div></div>
You must ofcourse make some mod into snakes lib but it's other case .