Changeset 6 for pages


Ignore:
Timestamp:
Jun 4, 2008, 9:01:09 AM (16 years ago)
Author:
george
Message:

Upraveno: Změna systému sledování procentuálního online stavu. Přidána tabulka servers_online pro uchování stavu serveru za poslední definovanou periodu. Dosavadní systém počítal online stav od počáteční registrace daného serveru což je nevyhovující a zavádějící.

Location:
pages
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pages/a_servers.php

    r3 r6  
    1010switch ($order_index)
    1111  {
    12   case 0: $order = ' order by `name` desc '; break;
     12  case 0: $order = ' order by `name`'; break;
    1313  case 1: $order = ' order by `rating` desc '; break;
    1414  case 2: $order = ' order by `version` desc '; break;
     
    3434  }
    3535 
    36 $pa = new CleverPager('select `id`,`wss_partner`,LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`/`online_checks` as `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `place`=2 '.$order, 'p');
     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');
    3737$pa->PageSize = 20;
    3838$pa->PageLinksDisplayed = 5;
     
    6666  $tpl->output['servers_data'] .='<td>'.$xp.'</td>';
    6767  $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>';
    68   $tpl->output['servers_data'] .='<td>'.(100*$row['online']).'%</td>';
     68  $tpl->output['servers_data'] .='<td>'.($row['online']).'%</td>';
    6969  $tpl->output['servers_data'] .='</tr>';
    7070  }
  • pages/server.php

    r1 r6  
    3030  $tpl->output['server_online_players']='0';
    3131  }
    32 $tpl->output['server_online'] = 100*@round($server_info['online']/$server_info['online_checks'],2).'%';
     32$tpl->output['server_online'] = @round($server_info['online'], 2).'%';
    3333switch ($server_info['xp'])
    3434  {
  • pages/servers.php

    r3 r6  
    99switch ($order_index)
    1010{
    11   case 0: $order = ' order by `name` desc '; break;
     11  case 0: $order = ' order by `name`'; break;
    1212  case 1: $order = ' order by `rating` desc '; break;
    1313  case 2: $order = ' order by `version` desc '; break;
     
    3333}
    3434 
    35 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`/`online_checks` as `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `place`=1 '.$order, 'p');
     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');
    3636$pa->PageSize = $Config['DisplayServerCountPerPage'];
    3737$pa->PageLinksDisplayed = 5;
     
    6565  $tpl->output['servers_data'] .='<td>'.$xp.'</td>';
    6666  $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>';
    67   $tpl->output['servers_data'] .='<td>'.(100*$row['online']).'%</td>';
     67  $tpl->output['servers_data'] .='<td>'.$row['online'].'%</td>';
    6868  $tpl->output['servers_data'] .='</tr>';
    6969  }
  • pages/wss_partners.php

    r3 r6  
    55$tpl->output['place'] = $text['info_place'];
    66$tpl->output['wss_partners_h2'] = $menu['mm2'];
     7if(!array_key_exists('order', $_GET)) $_GET['order'] = 0;
    78$order_index = (int) $_GET['order'];
    89switch ($order_index)
    910  {
    10   case 0: $order = ' order by `name` desc '; break;
     11  case 0: $order = ' order by `name`'; break;
    1112  case 1: $order = ' order by `rating` desc '; break;
    1213  case 2: $order = ' order by `version` desc '; break;
     
    3233  }
    3334 
    34 $pa = new CleverPager('select `id`,`wss_partner`, LEFT(`name`, 25) as `name`, `place`, `rating_sum`/`ratings` as `rating`, `version`, `type`, `xp`, `online`/`online_checks` as `online`, `online_players_sum`/`player_checks` as `players` from `servers` where `wss_partner`=1 '.$order, 'p');
     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');
    3536$pa->PageSize = 20;
    3637$pa->PageLinksDisplayed = 5;
     
    6465  $tpl->output['servers_data'] .='<td>'.$xp.'</td>';
    6566  $tpl->output['servers_data'] .='<td>'.(int)$row['players'].'</td>';
    66   $tpl->output['servers_data'] .='<td>'.(100*$row['online']).'%</td>';
     67  $tpl->output['servers_data'] .='<td>'.$row['online'].'%</td>';
    6768  $tpl->output['servers_data'] .='</tr>';
    6869  }
Note: See TracChangeset for help on using the changeset viewer.