diff --git a/toponline.php b/toponline.php index 9e325cf..854d1d4 100644 --- a/toponline.php +++ b/toponline.php @@ -1,23 +1,25 @@ - - '.$hours.'h '.$minutes.'m'; +} + function hours_and_minutes($value, $color = 1) { $hours = floor($value / 3600); @@ -37,45 +39,48 @@ function hours_and_minutes($value, $color = 1) if(empty($type)) $znotePlayers = mysql_select_multi('SELECT * FROM `znote_players` AS `z` JOIN `players` AS `p` WHERE `p`.`id`=`z`.`player_id` and `p`.`group_id` < 3 ORDER BY `onlinetimetoday` DESC LIMIT '.$limit); elseif($type == "sum") - $znotePlayers = mysql_select_multi('SELECT * FROM `znote_players` AS `z` JOIN `players` AS `p` WHERE `p`.`id`=`z`.`player_id` and `p`.`group_id` < 3 ORDER BY `onlinetime1`+`onlinetime2`+`onlinetime3`+`onlinetime4`+`onlinetime5`+`onlinetime6`+`onlinetime7`+`onlinetimetoday` DESC LIMIT ' . $limit); -elseif($type >= 1 && $type <= 7) + $znotePlayers = mysql_select_multi('SELECT * FROM `znote_players` AS `z` JOIN `players` AS `p` WHERE `p`.`id`=`z`.`player_id` and `p`.`group_id` < 3 ORDER BY `z`.`onlinetimeall` DESC LIMIT '. $limit); +elseif($type >= 1 && $type <= 4) $znotePlayers = mysql_select_multi('SELECT * FROM `znote_players` AS `z` JOIN `players` AS `p` WHERE `p`.`id`=`z`.`player_id` and `p`.`group_id` < 3 ORDER BY `onlinetime' . (int) $type . '` DESC LIMIT '.$limit); -echo '
Name | '; if($type == "sum") - echo '' .$player['name']. ''; + echo ' | ' .$player['name']. '';
echo ' ' .$player['level']. ' '.htmlspecialchars(vocation_id_to_name($player['vocation'])).' '; - echo ' | '.hours_and_minutes($player['onlinetime1'] + $player['onlinetime2'] + $player['onlinetime3'] + $player['onlinetimetoday'], 0).' | '; - echo ''.hours_and_minutes($player['onlinetime3']).' | '.hours_and_minutes($player['onlinetime2']).' | '.hours_and_minutes($player['onlinetime1']).' | '.hours_and_minutes($player['onlinetimetoday']).' | '; + echo '