Paxton
Banned User
Top fraggers, originaly made by Elf for Gesior AAC - Changed by me to work with Modern AAC.
Go to admin panel. www.exmaple.com/index.php/admin (You have to be logged as an admin [account with page access 5 or higher by default])
Go to pages, click Create Page, put the name for example Fraggers and paste this into the box:
Click save, and now go to fraggers click on it. You will be redirected to your subpage, you see the link just add it in the template to have it visible on template Thats it :w00t:
Go to admin panel. www.exmaple.com/index.php/admin (You have to be logged as an admin [account with page access 5 or higher by default])
Go to pages, click Create Page, put the name for example Fraggers and paste this into the box:
PHP:
<?php
//Script by Elf
//Made for Modern AAC by Paxton
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
echo '<div style="text-align: center; font-weight: bold;">Top 30 frags on ' . $config['server_name'] . '</div>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<td style="text-align: center; font-weight: bold;">Name</td>
<td style="text-align: center; font-weight: bold;">Frags</td>
</tr>';
$i = 0;
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags`
FROM `killers` k
LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
GROUP BY `name`
ORDER BY `frags` DESC, `name` ASC
LIMIT 0,30;') as $player)
{
$i++;
echo '<tr>
<td><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"><center>' . $player['name'] . '</center></a></td>
<td><center>' . $player['frags'] . '</center></td>
</tr>';
}
echo '</table>';
?>
Click save, and now go to fraggers click on it. You will be redirected to your subpage, you see the link just add it in the template to have it visible on template Thats it :w00t: