'.$hours.'h '.$minutes.'m'; } function hours_and_minutes($value, $color = 1) { $hours = floor($value / 3600); $value = $value - $hours * 3600; $minutes = floor($value / 60); if($color != 1) return ''.$hours.'h '.$minutes.'m'; else if($hours >= 12) return ''.$hours.'h '.$minutes.'m'; elseif($hours >= 6) return ''.$hours.'h '.$minutes.'m'; else return ''.$hours.'h '.$minutes.'m'; } if(empty($type)) $znotePlayers = db()->fetchAll('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 ?', [(int)$limit]); elseif($type == "sum") $znotePlayers = db()->fetchAll('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 ?', [(int)$limit]); elseif($type >= 1 && $type <= 4) $znotePlayers = db()->fetchAll('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 ?', [(int)$limit]); view('toponline'); theme_close();