1) { $content="Данной страницы не существует"; } $line=file_get_contents("templates/$template/main.tpl"); if(!empty($t) and file_exists("templates/$template/$t.tpl")) { $line=file_get_contents("templates/$template/$t.tpl"); } $state=file_get_contents("templates/$template/state.tpl"); //вкл/выкл сервер $fp = @fsockopen ("$mangos_url","$server_port",$errno,$errstr,1); if ($fp) { $state_state="online"; //аптайм сервера $state_uptime=DBconnect("mangos", $mangos_url, $mangos_db_user, $mangos_db_pass, "SELECT MAX(`starttime`) FROM uptime"); $state_uptime=mysql_fetch_row ($state_uptime); $state_uptime = time()-$state_uptime[0]; $uptime_s = $state_uptime%60; $state_uptime = intval ($state_uptime/60); $uptime_m = $state_uptime%60; $state_uptime = intval ($state_uptime/60); $uptime_h = $state_uptime; $state_uptime = intval($state_uptime/24); $uptime_d = $state_uptime; } else { $state_state="offline"; //аптайм сервера $uptime_s = 0; $uptime_m =0; $uptime_h = 0; $uptime_d = 0; } //онлайн $state_online=DBconnect("characters", $mangos_url, $mangos_db_user, $mangos_db_pass, "SELECT count(*) FROM characters WHERE online = 1"); //онлайн по фракциям $state_al=DBconnect("characters", $mangos_url, $mangos_db_user, $mangos_db_pass, "SELECT count(*) FROM characters WHERE online = 1 AND race in (1,3,4,7,11)"); $state_or=DBconnect("characters", $mangos_url, $mangos_db_user, $mangos_db_pass, "SELECT count(*) FROM characters WHERE online = 1 AND race in (2,5,6,8,10)"); //максимальный онлайн $state_maxon=DBconnect("mangos", $mangos_url, $mangos_db_user, $mangos_db_pass, "SELECt Max(`maxplayers`) FROM uptime"); $state_online = mysql_fetch_row ($state_online); $state_al = mysql_fetch_row ($state_al); $state_or = mysql_fetch_row ($state_or); $state_maxon = mysql_fetch_row ($state_maxon); include("modules/replaces.php"); echo "$line"; ?>