Changeset 353
- Timestamp:
- May 1, 2008, 1:20:20 PM (17 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
global.php
r336 r353 38 38 } 39 39 40 function ShowOnlinePlayerCount() 41 { 42 global $Database; 43 //ini_set('allow_url_fopen', 'On'); 44 // World of Warcraft user stat 45 //$Content = @file_get_contents('http://wow.zdechov.net:8080/stat.xml'); 46 //$File = fopen('http://'.$WoWServer.'/mangos/inc/stat.xml', 'r'); 47 //$Content = fgets($File, 1000000); 48 //fclose($File); 40 function OnlinePlayerCount() 41 { 42 global $Database; 49 43 $Database->select_db('characters'); 50 44 $Result = $Database->select('characters', 'COUNT(*)', 'online=1'); 51 45 $Row = $Result->fetch_array(); 52 $PlayerCount = $Row[0]; 53 46 return($Row[0]); 47 } 48 49 function CharacterCount() 50 { 51 global $Database; 52 $Database->select_db('characters'); 53 $Result = $Database->select('characters', 'COUNT(*)'); 54 $Row = $Result->fetch_array(); 55 return($Row[0]); 56 } 57 58 function AccountCount() 59 { 60 global $Database; 61 $Database->select_db('realmd'); 62 $DbResult = $Database->query('SELECT COUNT(*) FROM account'); 63 $Row = $DbResult->fetch_array(); 64 return($Row[0]); 65 } 66 67 function MangosUptime() 68 { 69 global $Database; 70 $Database->select_db('mangos'); 71 $DbResult = $Database->query('SELECT `starttime`, `uptime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1'); 72 $Row = $DbResult->fetch_array(); 73 $Uptime = $Row['uptime']; 74 //$Uptime = 0; 75 $Days = floor($Uptime / 3600 / 24); 76 if($Days == 0) $DaysText = ''; 77 else if($Days == 1) $DaysText = $Days.' den'; 78 else if(($Days > 1) and ($Days < 5)) $DaysText = $Days.' dny'; 79 else if(($Days > 5)) $DaysText = $Days.' dnù'; 80 $Seconds = $Uptime - 3600 * 19; 81 return($DaysText.' '.date('G:i', $Seconds)); 82 } 83 84 function RunningEventCount() 85 { 86 global $Database; 87 $Count = 0; 88 $Database->select_db('mangos'); 89 $DbResult = $Database->select('game_event', '*, UNIX_TIMESTAMP(start_time) as start', 'end_time > NOW() AND start_time < NOW()'); 90 while($Row = $DbResult->fetch_array()) 91 { 92 $Start = (floor((time() - $Row['start']) / ($Row['occurence'] * 60))) * $Row['occurence'] * 60 + $Row['start']; 93 $End = $Start + $Row['length'] * 60; 94 if((time() > $Start) and (time() < $End)) $Count++; 95 } 96 return($Count); 97 } 98 99 function ShowOnlinePlayerCount() 100 { 101 $PlayerCount = OnlinePlayerCount(); 54 102 if($PlayerCount == 1) $P = 'hráè'; 55 103 else if(($PlayerCount >= 2) and ($PlayerCount <= 4)) $P = 'hráèi'; -
index.php
r343 r353 9 9 <div> 10 10 Vítejte na serveru <span class="Nadpis">Heroes of Fantasy</span>, neoficiálním herním serveru hry <a href="http://www.worldofwarcraft.com/">World of Warcraft</a>!<br> 11 WoW je <acronym title="Massive Multiplayer Online Role Playing Game">MMORPG</acronym> její¾ tvùrcem je spoleènost<a href="http://www.blizzard.com/">Blizzard Entertainment</a>.12 Existujíoficiální servery, na kterých je nutno platit mìsíèní poplatek. Tento server je v¹ak neoficiální a mù¾ete zde hrát zdarma. Pøesto¾e neoficiální servery nikdy nedosáhnou takové kvality jako oficiální, mù¾ete zde za¾ít mnoho pøíjemných chvil a seznámit se zajímavými lidmi.11 WoW je <acronym title="Massive Multiplayer Online Role Playing Game">MMORPG</acronym> vytvoøená spoleèností <a href="http://www.blizzard.com/">Blizzard Entertainment</a>. 12 Ta provozuje oficiální servery, na kterých je nutno platit mìsíèní poplatek. Tento server je v¹ak neoficiální a mù¾ete zde hrát zdarma. Pøesto¾e neoficiální servery nikdy nedosáhnou takové kvality jako oficiální, mù¾ete zde za¾ít mnoho pøíjemných chvil a seznámit se zajímavými lidmi. 13 13 Nyní je ji¾ potøeba se jenom zaregistrovat, pøipojit do hry a v¾ít se do role hrdiny, který putuje svìtem fantasie a utkává se v boji s rozliènými stvùrami. 14 14 </div> 15 15 <table id="SplitTable" cellspacing="5" cellpadding="0" width="100%"> 16 16 <tr><td width="60%" valign="top">'); 17 18 17 19 18 echo(ShowNews()); … … 23 22 // Second column 24 23 25 //echo(Events());26 27 24 echo('<br> 28 25 <div align="center"> 29 26 <table class="MiniTable" border="1" cellspacing="0" cellpadding="2"> 30 27 <tr><th>Emulátor</th><td>MaNGOS</td></tr> 31 <tr><th>Verze hry</th><td>'); 32 echo($Config['Mangos']['ClientVersion']); 33 echo('</td></tr>'. 28 <tr><th>Verze hry</th><td>'.$Config['Mangos']['ClientVersion'].'</td></tr>'. 34 29 '<tr><th>Stav</th><td>'); 35 30 if(CheckPortStatus($WoWServer, 8085)) echo('<span style="color: #33ff33;">ONLINE</span>'); 36 31 else echo('<span style="color: red;">OFFLINE</span>'); 37 32 echo('</td></tr> 38 <tr><th>Online hráèù</th><td><a href="http://'.$WoWServer.'/online_player.php">'); 33 <tr><th>Doba bìhu</th><td>'.MangosUptime().'</td></tr> 34 <tr><th>Online hráèù</th><td><a href="'.$BaseUrl.'/online_player.php">'.OnlinePlayerCount().'</a></td></tr> 39 35 40 $Database->select_db('realmd');41 $Result = $Database->select('account', 'COUNT(*)', 'online=1');42 $Row = $Result->fetch_array();43 $PlayersOnlineCount = $Row[0];44 echo($PlayersOnlineCount);45 46 echo('</a></td></tr>47 48 <tr><th>Návod</th><td><a href="jak_zacit.php">zde</a></td></tr>49 36 <tr><th>Stav registrací</th><td>'); 50 37 include('registrace/reg_config.php'); 51 $Database->select_db('realmd'); 52 $DbResult = $Database->query('SELECT COUNT(*) FROM account'); 53 $Row = $DbResult->fetch_array(); 54 $AccountCount = $Row[0]; 38 $AccountCount = AccountCount(); 55 39 $Remain = $MaximumAccountCount-$AccountCount; 56 40 if($Remain <= 0) echo('VYÈERPANÉ'); else echo('VOLNÉ'); 57 echo('</td></tr> 41 echo('</td></tr>'); 42 /* 43 <tr><th>Návod</th><td><a href="jak_zacit.php">zde</a></td></tr> 58 44 <tr><th>Registrace</th><td>'); 59 45 echo('<a href="'.$BaseUrl.'registrace/">zde</a>'); … … 61 47 <tr><th>Správa úètu</th><td>'); 62 48 echo('<a href="'.$BaseUrl.'minimanager/">zde</a>'); 63 echo('</td></tr> 49 echo('</td></tr>'); 64 50 <tr><th>Existuje dnù</th><td>'); 65 51 echo(round((time()-mktime (0,0,0,4,21,2007))/3600/24)); 66 52 echo('</td></tr> 67 <tr><th>Úètù</th><td>'); 68 69 $Database->select_db('realmd'); 70 $Result = $Database->select('account', 'COUNT(*)'); 71 $Row = $Result->fetch_array(); 72 $AccountCount = $Row[0]; 73 echo($AccountCount); 74 75 echo('</td></tr> 76 <tr><th>Postav</th><td>'); 77 78 $Database->select_db('characters'); 79 $Result = $Database->select('characters', 'COUNT(*)'); 80 $Row = $Result->fetch_array(); 81 $CharactersCount = $Row[0]; 82 echo($CharactersCount); 83 84 echo('</td></tr> 53 */ 54 echo('<tr><th>Úètù</th><td>'.$AccountCount.'</td></tr> 55 <tr><th>Postav</th><td>'.CharacterCount().'</td></tr> 56 <tr><th>Bì¾ících akcí</th><td><a href="'.$BaseUrl.'events.php">'.RunningEventCount().'</a></td></tr> 85 57 </table> 86 58 </div>
Note:
See TracChangeset
for help on using the changeset viewer.