diff --git a/powergamers.php b/powergamers.php
index 3d83882..dcd843f 100644
--- a/powergamers.php
+++ b/powergamers.php
@@ -1,70 +1,92 @@
-
- 3)
- {
- $value .= '.'.substr($value2, -3, 3);
- $value2 = substr($value2, 0, strlen($value2)-3);
+
+
+ 0)
+ $today = false;
+ } else {
+ $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 ORDER BY `expdiff` DESC LIMIT '.$limit);
}
- @$value = $value2.$value;
- if($valuein > 0)
- return '
+'.$value.'';
- elseif($valuein < 0)
- return '
'.$value.'';
- else
- return $value;
-}
+ $limit = $config['powergamers']['limit'];
-if(empty($type))
- $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 ORDER BY `expdiff` DESC LIMIT '.$limit);
-elseif($type >= 1 && $type <= 3)
- $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 ORDER BY `exphist' . (int) $type . '` DESC LIMIT '.$limit);
-echo '
Ranking of powergamers
-
-
- # |
- Name | ';
-echo 'Total | ';
+ if(!empty($days) && !empty($vocation))
+ $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 AND `a`.`vocation`='. (int)$vocation .' ORDER BY `exphist' . (int)$days . '` DESC LIMIT '.$limit);
+ elseif(empty($days) && !empty($vocation)) {
+ $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 AND `a`.`vocation`='. (int)$vocation .' ORDER BY `expdiff` DESC LIMIT '.$limit);
+ }elseif(!empty($days) && empty($vocation))
+ $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 ORDER BY `exphist' . (int)$days . '` DESC LIMIT '.$limit);
+ else
+ $znotePlayers = mysql_select_multi('SELECT `a`.`id`, `b`.`player_id`, `a`.`name`, `a`.`vocation`, `a`.`level`, `a`.`group_id`, `a`.`experience`, `b`.`exphist_lastexp`, `b`.`exphist1`, `b`.`exphist2`, `b`.`exphist3`, `b`.`exphist4`, `b`.`exphist5`, `b`.`exphist6`, `b`.`exphist7`, (`a`.`experience` - `b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`player_id` WHERE `a`.`group_id` < 2 ORDER BY `expdiff` DESC LIMIT '.$limit);
-for($i = 3; $i >= 2; $i--)
- echo ($type == $i) ? ''.$i.' Days Ago | ' : ''.$i.' Days Ago | ';
- echo ($type == 1) ? '1 Day Ago | ' : '1 Day Ago | ';
- echo (empty($type)) ? 'Today | ' : 'Today | ';
- echo '';
+ $showVoc = (!empty($vocation)) ? $vocation : 0;
+ ?>
+
+
+ # |
+ Name |
+ = 2; $i--)
+ echo ($days == $i) ? ''.$i.' Days Ago | ' : '';
+ echo ($days == 1) ? 'Yesterday | ' : '';
+ echo ($today) ? 'Today | ' : '';
+ echo ($days == 4) ? 'Total | ' : '';
+ echo '';
-$number_of_rows = 1;
-if($znotePlayers)
- foreach($znotePlayers as $player)
- {
- echo ''. $number_of_rows . '. | ';
- echo '' .$player['name']. '';
- echo ' ' .$player['level']. ' '.htmlspecialchars(vocation_id_to_name($player['vocation'])).' ';
-
- echo ' | '.coloured_value($player['exphist1'] + $player['exphist2'] + $player['exphist3'] + $player['experience'] - $player['exphist_lastexp']).' | ';
- echo ''.coloured_value($player['exphist3']).' | '.coloured_value($player['exphist2']).' | '.coloured_value($player['exphist1']).' | '.coloured_value($player['experience']-$player['exphist_lastexp']).' | '; $number_of_rows++;
+ $number_of_rows = 0;
+ if($znotePlayers) {
+ foreach($znotePlayers as $player)
+ {
+ $number_of_rows++;
+ echo ''. $number_of_rows . '. | ';
+ echo '' .$player['name']. '';
+ echo ' '. ($player['level']. ' '.htmlspecialchars(vocation_id_to_name($player['vocation'])) ).' ';
+ echo ($days == 3) ? ' | '. number_format($player['exphist3']) .' | ' : '';
+ echo ($days == 2) ? ''. $player['exphist2'] .' | ' : '';
+ echo ($days == 1) ? ''. $player['exphist1'] .' | ' : '';
+ echo ($today == true) ? ''. ($player['experience']-$player['exphist_lastexp']) .' | ' : '';
+ echo '';
+ }
}
-echo '
';
-?>
+ ?>
+
+
+