The extros
New Member
- Joined
- Jun 28, 2010
- Messages
- 98
- Reaction score
- 1
Hi.. I want a system that the top fraggers don't show JUST the unjustified, that way the top fragger will be who has more justified and unjustified... Here i have the script, can someone help me with it, as same as the guilds... the top 4 guilds, a home injection, i want that the TOP guilds are who have more justified and unjustified kills..
Top Fraggers = count justified + unjustified
Top Guilds = top 4 guilds with more justified + unjustified
Top Fraggers:
Top Guilds:
Top Fraggers = count justified + unjustified
Top Guilds = top 4 guilds with more justified + unjustified
Top Fraggers:
Code:
<?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>';
?>
Top Guilds:
Code:
<?php
//Script created by Elf
//Changed by Paxton to work with Modern AAC
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
echo' <div class="message"><div class="title">Most powerfull guilds</div> <div class="content">
<table border="0" cellspacing="3" cellpadding="4" width="100%">
<tr>';
foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
COUNT(`g`.`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`
LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
GROUP BY `name`
ORDER BY `frags` DESC, `name` ASC
LIMIT 0, 4;') as $guild) {
if(empty($guild['name'])) continue;
$is = 1;
echo' <td style="width: 25%; text-align: center;">
<a href="'.WEBSITE.'/index.php/guilds/view/' . $guild['id'] . '"><img src="'.WEBSITE.'/public/guild_logos/' . ((file_exists('public/guild_logos/' . $guild['id'] . '.gif')) ? $guild['id'].'.gif' : 'default.gif') . '" width="64" height="64" border="0"/><br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
</td>';
}
echo' </tr>
</table>';
if(empty($is)) {
echo "<center><font color='red'>There is no guilds yet.</font></center>";
}
echo "</div>";
echo "</div><br/>";
?>