<?php
$powergamers = $config['powergamers'];
$limit = 1;
$type = @$_GET['type'];
function coloured_value($valuein)
{
$value2 = $valuein;
while(strlen($value2) > 3)
{
$value .= '.'.substr($value2, -3, 3);
$value2 = substr($value2, 0, strlen($value2)-3);
}
@$value = $value2.$value;
if($valuein > 0)
return '<b><font color="green">+'.$value.'</font></b>';
elseif($valuein < 0)
return '<font color="red">'.$value.'</font>';
else
return $value;
}
if(empty($type))
$players = mysql_select_multi('SELECT `p`.`name`, `p`.`level`, `p`.`vocation`, `p`.`experience`, `p`.`exphist1`, `p`.`exphist2`, `p`.`exphist3`, `p`.`exphist_lastexp`, `p_on`.`player_id` AS `online` FROM `players` p LEFT JOIN `players_online` p_on ON `p`.`id` = `p_on`.`player_id` WHERE `p`.`group_id` < 2 ORDER BY `p`.`experience`-`p`.`exphist_lastexp` DESC LIMIT ' . $limit);
elseif($type == "sum")
$players = mysql_select_multi('SELECT `p`.*, `p_on`.`player_id` AS online FROM `players` p LEFT JOIN `players_online` p_on ON `p`.`id` = `p_on`.`experience`-`p`.`exphist_lastexp` DESC LIMIT ' . $limit);
elseif($type >= 1 && $type <= 7)
$players = mysql_select_multi('SELECT `p`.*, `p_on`.`player_id` AS online FROM `players` p LEFT JOIN `players_online` p_on ON `p`.`id` = `p_on`.`player_id` WHERE `p`.`group_id` < 2 ORDER BY `p`.`exphist' . (int) $type . '` DESC LIMIT '.$limit);
if($player)
foreach($players as $player)
{
echo coloured_value($player['experience']-$player['exphist_lastexp']);
}
;
?>