Changeset 8
- Timestamp:
- Jun 5, 2008, 9:38:23 PM (16 years ago)
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
includes/config.sample.php
r3 r8 4 4 'DisplayServerCountPerPage' => 40, 5 5 'TopServersCount' => 10, 6 'OnlineStatePeriodLength' => 7, 6 7 ); 7 8 -
index.php
r3 r8 69 69 $tpl->output['url'] = $config['base_url']; 70 70 $tpl->output['lang'] = $lang; 71 $tpl->output['footer'] = ' Created by illi, Designed by Paranoik<br />Designed for <a href="http://www.opera.com/" target="_blank">Opera</a> and <a href="http://www.czilla.cz" target="_blank">Mozzila</a>.';71 $tpl->output['footer'] = 'Vytvořeno členy komunity.'; 72 72 if (isset($_SESSION['id'])) 73 73 { -
lang/cs.php
r1 r8 42 42 'abroad_servers' => 'Zahraniční servery', 43 43 'th_players' => 'Hráči', 44 'th_recommend' => 'Doporučujeme', 45 'th_online_state' => 'Online', 46 'th_latency' => 'Odezva', 47 'th_xp' => 'XP násobek', 48 'th_type' => 'Typ', 49 'th_version' => 'Verze', 50 'th_rating' => 'Známka', 44 51 'info_servers' =>'Servery', 45 52 'info_num_of_servers' => 'Počet serverů', … … 47 54 'users' => 'Uživatelé', 48 55 'only_logged' => 'Pouze přihlášení uživatelé mohou přidávat servery.\nPřihlašte se prosím', 49 'add_server_not_web' => 'Musíte vyplnit Webovou stranku a Registrační stránku' 56 'add_server_not_web' => 'Musíte vyplnit Webovou stranku a Registrační stránku', 57 ); 50 58 51 52 53 54 55 );56 59 $text['add_server_h2'] = 'Přidej server'; 57 60 $text['reg_name_server'] = 'Jméno serveru'; -
lang/en.php
r3 r8 42 42 'abroad_servers' => 'Foreign servers', 43 43 'th_players' => 'Players', 44 'th_recommend' => 'Recommended', 45 'th_online_state' => 'Online', 46 'th_latency' => 'Latency', 47 'th_xp' => 'XP rate', 48 'th_type' => 'Type', 49 'th_version' => 'Version', 50 'th_rating' => 'Rating', 44 51 'info_servers' => 'Servers', 45 52 'info_num_of_servers' => 'Number of servers', … … 47 54 'users' => 'Users', 48 55 'only_logged' => 'Only registred users are able to add servers.\nLog-in, please', 49 'add_server_not_web' => 'You have to fill Server webpages and Registration page in.' 56 'add_server_not_web' => 'You have to fill Server webpages and Registration page in.', 57 'latency' => 'Latency', 50 58 ); 51 59 -
pages/a_servers.php
r6 r8 2 2 $tpl->output['th_players'] = $text['th_players']; 3 3 $tpl->output['servers_h2'] = $text['abroad_servers']; 4 $tpl->output['th_name'] =$text['name']; 4 $tpl->output['th_players'] = $text['th_players']; 5 $tpl->output['th_name'] = $text['name']; 6 $tpl->output['th_latency'] = $text['th_latency']; 7 $tpl->output['th_version'] = $text['th_version']; 8 $tpl->output['th_xp'] = $text['th_xp']; 9 $tpl->output['th_online_state'] = $text['th_online_state']; 10 $tpl->output['th_type'] = $text['th_type']; 11 $tpl->output['th_rating'] = $text['th_rating']; 12 $tpl->output['th_recommend'] = $text['th_recommend']; 5 13 $tpl->output['order_by'] = $text['order_by']; 6 14 $tpl->output['place'] = $text['info_place']; … … 17 25 case 5: $order = ' order by `players` desc '; break; 18 26 case 6: $order = ' order by `online` desc '; break; 27 case 7: $order = ' order by `online` desc,`latency`'; break; 19 28 } 20 29 $tpl->output['s0'] = ''; … … 25 34 $tpl->output['s5'] = ''; 26 35 $tpl->output['s6'] = ''; 36 $tpl->output['s7'] = ''; 27 37 if (empty($order_index)) 28 38 { … … 34 44 } 35 45 36 $pa = new CleverPager('select `id`,`wss_partner`,LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `place`=2 '.$order, 'p');46 $pa = new CleverPager('select `id`,`wss_partner`,LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`, `online_players_sum`/`player_checks` as `players`, `latency` from `servers` where `place`=2 '.$order, 'p'); 37 47 $pa->PageSize = 20; 38 48 $pa->PageLinksDisplayed = 5; … … 67 77 $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>'; 68 78 $tpl->output['servers_data'] .='<td>'.($row['online']).'%</td>'; 79 if($row['latency'] == 0) $Latency = '?'; else $Latency = round($row['latency']).'ms'; 80 $tpl->output['servers_data'] .='<td>'.$Latency.'</td>'; 69 81 $tpl->output['servers_data'] .='</tr>'; 70 82 } -
pages/server.php
r6 r8 1 1 <?php 2 $tpl->output['th_players'] = $text['th_players']; 3 $tpl->output['th_name'] = $text['name']; 4 $tpl->output['th_latency'] = $text['th_latency']; 5 $tpl->output['th_version'] = $text['th_version']; 6 $tpl->output['th_xp'] = $text['th_xp']; 7 $tpl->output['th_online_state'] = $text['th_online_state']; 8 $tpl->output['th_type'] = $text['th_type']; 9 $tpl->output['th_rating'] = $text['th_rating']; 10 $tpl->output['th_recommend'] = $text['th_recommend']; 2 11 $tpl->output['server_reg_desc'] = $text['reg_desc']; 3 12 $tpl->output['info_place'] = $text['info_place']; 4 13 $tpl->output['info_avarage_players'] = $text['info_avarage_players']; 5 14 $tpl->output['info_owner'] = $text['info_owner']; 15 6 16 $id = (int)$_GET['str1']; 7 17 $server_info = $db->strip($db->query_fetch_assoc('SELECT *, CAST(`online_players_sum`/`player_checks` AS UNSIGNED) as `online_players` FROM `servers` WHERE `id` = '.$id)); 8 18 9 if ($server_info['wss_partner']==1)10 19 if($server_info['wss_partner'] == 1) 20 { 11 21 $tpl->output['server_name'] = '<img src="templates/img/hvezda.gif" alt="WSS Partner" title="WSS Partner">'.$server_info['name']; 12 22 } 13 23 else 14 24 { 15 25 $tpl->output['server_name'] = $server_info['name']; 16 26 } 17 27 $tpl->output['title_name'] = $server_info['name']; 18 28 $tpl->output['server_version'] = $server_info['version']; … … 52 62 $tpl->output['server_port'] = $server_info['port']; 53 63 $tpl->output['server_owner'] = print_nick($server_info['owner']); 64 if($server_info['latency'] == 0) $Latency = '?'; else $Latency = round($server_info['latency']).'ms'; 65 $tpl->output['server_latency'] = $Latency; 54 66 55 67 if (empty($_SESSION['id'])) -
pages/servers.php
r6 r8 2 2 $tpl->output['th_players'] = $text['th_players']; 3 3 $tpl->output['th_name'] = $text['name']; 4 $tpl->output['th_latency'] = $text['th_latency']; 5 $tpl->output['th_version'] = $text['th_version']; 6 $tpl->output['th_xp'] = $text['th_xp']; 7 $tpl->output['th_online_state'] = $text['th_online_state']; 8 $tpl->output['th_type'] = $text['th_type']; 9 $tpl->output['th_rating'] = $text['th_rating']; 10 $tpl->output['th_recommend'] = $text['th_recommend']; 4 11 $tpl->output['order_by'] = $text['order_by']; 5 12 $tpl->output['place'] = $text['info_place']; … … 16 23 case 5: $order = ' order by `players` desc '; break; 17 24 case 6: $order = ' order by `online` desc '; break; 25 case 7: $order = ' order by `online` desc,`latency`'; break; 18 26 } 19 27 $tpl->output['s0'] = ''; … … 24 32 $tpl->output['s5'] = ''; 25 33 $tpl->output['s6'] = ''; 34 $tpl->output['s7'] = ''; 26 35 if (empty($order_index)) 27 36 { … … 33 42 } 34 43 35 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `place`=1 '.$order, 'p');44 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`, `online_players_sum`/`player_checks` as `players`,`latency` from `servers` where `place`=1 '.$order, 'p'); 36 45 $pa->PageSize = $Config['DisplayServerCountPerPage']; 37 46 $pa->PageLinksDisplayed = 5; … … 66 75 $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>'; 67 76 $tpl->output['servers_data'] .='<td>'.$row['online'].'%</td>'; 77 if($row['latency'] == 0) $Latency = '?'; else $Latency = round($row['latency']).'ms'; 78 $tpl->output['servers_data'] .='<td>'.$Latency.'</td>'; 68 79 $tpl->output['servers_data'] .='</tr>'; 69 80 } -
pages/wss_partners.php
r6 r8 1 1 <?php 2 2 $tpl->output['th_players'] = $text['th_players']; 3 $tpl->output['th_name'] =$text['name']; 3 $tpl->output['th_name'] = $text['name']; 4 $tpl->output['th_latency'] = $text['th_latency']; 5 $tpl->output['th_version'] = $text['th_version']; 6 $tpl->output['th_xp'] = $text['th_xp']; 7 $tpl->output['th_online_state'] = $text['th_online_state']; 8 $tpl->output['th_type'] = $text['th_type']; 9 $tpl->output['th_rating'] = $text['th_rating']; 10 $tpl->output['th_recommend'] = $text['th_recommend']; 4 11 $tpl->output['order_by'] = $text['order_by']; 5 12 $tpl->output['place'] = $text['info_place']; 6 13 $tpl->output['wss_partners_h2'] = $menu['mm2']; 14 7 15 if(!array_key_exists('order', $_GET)) $_GET['order'] = 0; 8 16 $order_index = (int) $_GET['order']; … … 16 24 case 5: $order = ' order by `players` desc '; break; 17 25 case 6: $order = ' order by `online` desc '; break; 26 case 7: $order = ' order by `online` desc,`latency`'; break; 18 27 } 19 28 $tpl->output['s0'] = ''; … … 24 33 $tpl->output['s5'] = ''; 25 34 $tpl->output['s6'] = ''; 35 $tpl->output['s7'] = ''; 26 36 if (empty($order_index)) 27 37 { … … 33 43 } 34 44 35 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `wss_partner`=1 '.$order, 'p');45 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`, `online_players_sum`/`player_checks` as `players`,`latency` from `servers` where `wss_partner`=1 '.$order, 'p'); 36 46 $pa->PageSize = 20; 37 47 $pa->PageLinksDisplayed = 5; … … 66 76 $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>'; 67 77 $tpl->output['servers_data'] .='<td>'.$row['online'].'%</td>'; 78 if($row['latency'] == 0) $Latency = '?'; else $Latency = round($row['latency']).'ms'; 79 $tpl->output['servers_data'] .='<td>'.$Latency.'</td>'; 68 80 $tpl->output['servers_data'] .='</tr>'; 69 81 } -
scripts/online.php
r7 r8 1 1 <?php 2 3 // Script executed by cron every 5 minutes 2 4 3 5 include('../includes/config.php'); … … 34 36 { 35 37 echo($Server['name'].' - '); 38 $MeasureStart = microtime(TRUE); 36 39 $OnlineState = CheckPortStatus($Server['ip'], $Server['port']); 40 $Latency = (microtime(TRUE) - $MeasureStart) * 1000; 37 41 $OnlineCount += $OnlineState; 38 42 $OfflineCount += 1 - $OnlineState; 39 43 // Insert new online state 40 $Database->query("INSERT INTO `servers_online` (`server` ,`time` ,`state` ,`players_count`) VALUES (".$Server['id'].", NOW() , ".$OnlineState.", ".$PlayersCount.")");44 $Database->query("INSERT INTO `servers_online` (`server`, `time`, `state`, `players_count`, `latency`) VALUES (".$Server['id'].", NOW() , ".$OnlineState.", ".$PlayersCount.", ".$Latency.")"); 41 45 42 46 // Delete old records 43 $Database->query("DELETE FROM `servers_online` WHERE `server` = ".$Server['id']." AND time < DATE_SUB(NOW(), INTERVAL 1DAY)");47 $Database->query("DELETE FROM `servers_online` WHERE `server` = ".$Server['id']." AND time < DATE_SUB(NOW(), INTERVAL ".$Config['OnlineStatePeriodLength']." DAY)"); 44 48 49 // Calculate latency average 50 $DbResult = $Database->query("SELECT AVG(`latency`) as `latency` FROM `servers_online` WHERE `server` = ".$Server['id']." AND `state` = 1 AND `latency` != 0"); 51 $DbRow = $DbResult->fetch_array(); 52 $Latency = $DbRow['latency']; 53 $DbResult->free(); 54 45 55 // Calculate cached percentage online state 46 56 $DbResult = $Database->query("SELECT COUNT(*) as `count`, SUM(`state`) as `online` FROM `servers_online` WHERE `server` = ".$Server['id']); 47 57 $DbRow = $DbResult->fetch_array(); 48 $Database->query("UPDATE `servers` SET `online` = ".round($DbRow['online'] / $DbRow['count'] * 100, 2)." WHERE `id` = ".$Server['id']); 58 59 // Update servers info 60 $Database->query("UPDATE `servers` SET `online` = ".round($DbRow['online'] / $DbRow['count'] * 100, 2).", `latency` = ".$Latency." WHERE `id` = ".$Server['id']); 49 61 $DbResult->free(); 50 62 echo($TextState[$OnlineState]."<br>\n"); -
templates/a_servers.html
r3 r8 3 3 <b>{order_by}:</b> <select onchange="location.href='index.php?page=a-servers&order='+this.selectedIndex"> 4 4 <option {s0}>{th_name}</option> 5 <option {s1}> Rating</option>6 <option {s2}> Verze</option>7 <option {s3}> Typ</option>8 <option {s4}> XP Rate</option>5 <option {s1}>{th_rating}</option> 6 <option {s2}>{th_version}</option> 7 <option {s3}>{th_type}</option> 8 <option {s4}>{th_xp}</option> 9 9 <option {s5}>{th_players}</option> 10 <option {s6}>Online</option> 10 <option {s6}>{th_online_state}</option> 11 <option {s7}>{th_latency}</option> 11 12 </select> 12 13 </div> … … 17 18 <table class="table"> 18 19 <tr> 19 <th><img src="templates/img/hvezda.gif" alt=" Doporučujeme" title="Doporučujeme"></th>20 <th><img src="templates/img/hvezda.gif" alt="{th_recommend}" title="{th_recommend}"></th> 20 21 <th>{th_name}</th> 21 <th> Rating</th>22 <th> Verze</th>23 <th> Typ</th>24 <th> XP Rate</th>22 <th>{th_rating}</th> 23 <th>{th_version}</th> 24 <th>{th_type}</th> 25 <th>{th_xp}</th> 25 26 <th>{th_players}</th> 26 <th>Online</th> 27 <th>{th_online_state}</th> 28 <th>{th_latency}</th> 27 29 </tr> 28 30 {servers_data} -
templates/server.html
r1 r8 11 11 <tr class="table"> 12 12 <td align="left"> 13 <strong> Verze</strong></td>13 <strong>{th_version}</strong></td> 14 14 <td align="center"> 15 15 {server_version}</td> … … 17 17 <tr class="table"> 18 18 <td align="left"> 19 <strong> Typ</strong></td>19 <strong>{th_type}</strong></td> 20 20 <td align="center"> 21 21 {server_typ}</td> … … 23 23 <tr class="table"> 24 24 <td align="left"> 25 <strong> XP Rate</strong></td>25 <strong>{th_xp}</strong></td> 26 26 <td align="center"> 27 27 {server_xp}</td> … … 39 39 {server_online_players}</td> 40 40 </tr> 41 41 42 42 <tr class="table"> 43 43 <td align="left"> 44 <strong> Online</strong></td>44 <strong>{th_online_state}</strong></td> 45 45 <td align="center"> 46 46 {server_online}</td> 47 47 </tr> 48 48 49 <tr class="table"> 50 <td align="left"> 51 <strong>{th_latency}</strong></td> 52 <td align="center"> 53 {server_latency}</td> 54 </tr> 55 49 56 <tr class="table"> 50 57 <td align="left"> -
templates/servers.html
r3 r8 3 3 <b>{order_by}:</b> <select onchange="location.href='index.php?page=servers&order='+this.selectedIndex"> 4 4 <option {s0}>{th_name}</option> 5 <option {s1}> Rating</option>6 <option {s2}> Verze</option>7 <option {s3}> Typ</option>8 <option {s4}> XP Rate</option>5 <option {s1}>{th_rating}</option> 6 <option {s2}>{th_version}</option> 7 <option {s3}>{th_type}</option> 8 <option {s4}>{th_xp}</option> 9 9 <option {s5}>{th_players}</option> 10 <option {s6}>Online</option> 10 <option {s6}>{th_online_state}</option> 11 <option {s7}>{th_latency}</option> 11 12 </select> 12 13 </div> … … 17 18 <table class="table"> 18 19 <tr> 19 <th><img src="templates/img/hvezda.gif" alt=" Doporučujeme" title="Doporučujeme"></th>20 <th><img src="templates/img/hvezda.gif" alt="{th_recommend}" title="{th_recommend}"></th> 20 21 <th>{th_name}</th> 21 <th> Rating</th>22 <th> Verze</th>23 <th> Typ</th>24 <th> XP Rate</th>22 <th>{th_rating}</th> 23 <th>{th_version}</th> 24 <th>{th_type}</th> 25 <th>{th_xp}</th> 25 26 <th>{th_players}</th> 26 <th>Online</th> 27 <th>{th_online_state}</th> 28 <th>{th_latency}</th> 27 29 </tr> 28 30 {servers_data} -
templates/style/screen2.css
r3 r8 106 106 .table td { 107 107 border: 1px solid #b8b8b8; 108 padding: 5px 10px 5px 10px;108 padding: 5px 5px 5px 5px; 109 109 } 110 110 -
templates/wss_partners.html
r3 r8 3 3 <b>{order_by}:</b> <select onchange="location.href='index.php?page=wss-partners&order='+this.selectedIndex"> 4 4 <option {s0}>{th_name}</option> 5 <option {s1}> Rating</option>6 <option {s2}> Verze</option>7 <option {s3}> Typ</option>8 <option {s4}> XP Rate</option>5 <option {s1}>{th_rating}</option> 6 <option {s2}>{th_version}</option> 7 <option {s3}>{th_type}</option> 8 <option {s4}>{th_xp}</option> 9 9 <option {s5}>{th_players}</option> 10 <option {s6}>Online</option> 10 <option {s6}>{th_online_state}</option> 11 <option {s7}>{th_latency}</option> 11 12 </select> 12 13 </div> … … 17 18 <table class="table"> 18 19 <tr> 19 <th><img src="templates/img/hvezda.gif" alt=" Doporučujeme" title="Doporučujeme"></th>20 <th><img src="templates/img/hvezda.gif" alt="{th_recommend}" title="{th_recommend}"></th> 20 21 <th>{th_name}</th> 21 <th> Rating</th>22 <th> Verze</th>23 <th> Typ</th>24 <th> XP Rate</th>22 <th>{th_rating}</th> 23 <th>{th_version}</th> 24 <th>{th_type}</th> 25 <th>{th_xp}</th> 25 26 <th>{th_players}</th> 26 <th>Online</th> 27 <th>{th_online_state}</th> 28 <th>{th_latency}</th> 27 29 </tr> 28 30 {servers_data}
Note:
See TracChangeset
for help on using the changeset viewer.