Changeset 8 for pages


Ignore:
Timestamp:
Jun 5, 2008, 9:38:23 PM (16 years ago)
Author:
george
Message:

Přidáno: Zaznamenávání a zobrazování údaje o odezevně serverů.
Upraveno: Šablony stránek a použití jazykových proměnných ve větší míře.

Location:
pages
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pages/a_servers.php

    r6 r8  
    22$tpl->output['th_players'] = $text['th_players'];
    33$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'];
    513$tpl->output['order_by'] = $text['order_by'];
    614$tpl->output['place'] = $text['info_place'];
     
    1725  case 5: $order = ' order by `players` desc '; break;
    1826  case 6: $order = ' order by `online` desc '; break;
     27  case 7: $order = ' order by `online` desc,`latency`'; break;
    1928  }
    2029$tpl->output['s0'] = '';
     
    2534$tpl->output['s5'] = '';
    2635$tpl->output['s6'] = '';
     36$tpl->output['s7'] = '';
    2737if (empty($order_index))
    2838  {
     
    3444  }
    3545 
    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');
    3747$pa->PageSize = 20;
    3848$pa->PageLinksDisplayed = 5;
     
    6777  $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>';
    6878  $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>';
    6981  $tpl->output['servers_data'] .='</tr>';
    7082  }
  • pages/server.php

    r6 r8  
    11<?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'];
    211$tpl->output['server_reg_desc'] = $text['reg_desc'];
    312$tpl->output['info_place'] = $text['info_place'];
    413$tpl->output['info_avarage_players'] = $text['info_avarage_players'];
    514$tpl->output['info_owner'] = $text['info_owner'];
     15
    616$id = (int)$_GET['str1'];
    717$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));
    818
    9 if ($server_info['wss_partner']==1)
    10   {
     19if($server_info['wss_partner'] == 1)
     20{
    1121  $tpl->output['server_name'] = '<img src="templates/img/hvezda.gif" alt="WSS Partner" title="WSS Partner">'.$server_info['name'];
    12   }
     22}
    1323else
    14   {
     24{
    1525  $tpl->output['server_name'] = $server_info['name'];
    16   }
     26}
    1727$tpl->output['title_name'] = $server_info['name'];
    1828$tpl->output['server_version'] = $server_info['version'];
     
    5262$tpl->output['server_port'] = $server_info['port'];
    5363$tpl->output['server_owner'] = print_nick($server_info['owner']);
     64if($server_info['latency'] == 0) $Latency = '?'; else $Latency = round($server_info['latency']).'ms';
     65$tpl->output['server_latency'] =         $Latency;
    5466
    5567if (empty($_SESSION['id']))
  • pages/servers.php

    r6 r8  
    22$tpl->output['th_players'] = $text['th_players'];
    33$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'];
    411$tpl->output['order_by'] = $text['order_by'];
    512$tpl->output['place'] = $text['info_place'];
     
    1623  case 5: $order = ' order by `players` desc '; break;
    1724  case 6: $order = ' order by `online` desc '; break;
     25  case 7: $order = ' order by `online` desc,`latency`'; break;
    1826}
    1927$tpl->output['s0'] = '';
     
    2432$tpl->output['s5'] = '';
    2533$tpl->output['s6'] = '';
     34$tpl->output['s7'] = '';
    2635if (empty($order_index))
    2736{
     
    3342}
    3443 
    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');
    3645$pa->PageSize = $Config['DisplayServerCountPerPage'];
    3746$pa->PageLinksDisplayed = 5;
     
    6675  $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>';
    6776  $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>';
    6879  $tpl->output['servers_data'] .='</tr>';
    6980  }
  • pages/wss_partners.php

    r6 r8  
    11<?php
    22$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'];
    411$tpl->output['order_by'] = $text['order_by'];
    512$tpl->output['place'] = $text['info_place'];
    613$tpl->output['wss_partners_h2'] = $menu['mm2'];
     14
    715if(!array_key_exists('order', $_GET)) $_GET['order'] = 0;
    816$order_index = (int) $_GET['order'];
     
    1624  case 5: $order = ' order by `players` desc '; break;
    1725  case 6: $order = ' order by `online` desc '; break;
     26  case 7: $order = ' order by `online` desc,`latency`'; break;
    1827  }
    1928$tpl->output['s0'] = '';
     
    2433$tpl->output['s5'] = '';
    2534$tpl->output['s6'] = '';
     35$tpl->output['s7'] = '';
    2636if (empty($order_index))
    2737  {
     
    3343  }
    3444 
    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');
    3646$pa->PageSize = 20;
    3747$pa->PageLinksDisplayed = 5;
     
    6676  $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>';
    6777  $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>';
    6880  $tpl->output['servers_data'] .='</tr>';
    6981  }
Note: See TracChangeset for help on using the changeset viewer.