Changeset 3 for pages


Ignore:
Timestamp:
May 5, 2008, 8:33:15 AM (17 years ago)
Author:
george
Message:

Přidáno: Nastavení počtu zobrazených serverů na stránku a počtu nej serverů v konfiguračním souboru.
Opraveno: Pročištění použití stylů a vyřešení překrývání hlavního seznamu s pravým sloupcem u některých prohlížečů. Všechny informace o stylech musí být v souboru CSS a ne v HTML kódu.

Location:
pages
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pages/a_servers.php

    r1 r3  
    66$tpl->output['place'] = $text['info_place'];
    77
     8if(!array_key_exists('order', $_GET)) $_GET['order'] = 0;
    89$order_index = (int) $_GET['order'];
    910switch ($order_index)
     
    5758    $place = $text['reg_abroad'];
    5859    }
    59   $tpl->output['servers_data'] .= '<tr style="overflow: hidden; "class="table center">';
    60   $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td style="width: 5px;"><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';
     60  $tpl->output['servers_data'] .= '<tr>';
     61  $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';
    6162  $tpl->output['servers_data'] .='<td align="left">'.ulink('server/'.$row['id'], $row['name']).'</td>';
    6263  $tpl->output['servers_data'] .='<td>'.round($row['rating'],2).'</td>';
  • pages/servers.php

    r1 r3  
    11<?php
    22$tpl->output['th_players'] = $text['th_players'];
    3 $tpl->output['th_name'] =$text['name'];
     3$tpl->output['th_name'] = $text['name'];
    44$tpl->output['order_by'] = $text['order_by'];
    55$tpl->output['place'] = $text['info_place'];
    66
     7if(!array_key_exists('order', $_GET)) $_GET['order'] = 0;
    78$order_index = (int) $_GET['order'];
    89switch ($order_index)
    9   {
     10{
    1011  case 0: $order = ' order by `name` desc '; break;
    1112  case 1: $order = ' order by `rating` desc '; break;
     
    1516  case 5: $order = ' order by `players` desc '; break;
    1617  case 6: $order = ' order by `online` desc '; break;
    17   }
     18}
    1819$tpl->output['s0'] = '';
    1920$tpl->output['s1'] = '';
     
    2425$tpl->output['s6'] = '';
    2526if (empty($order_index))
    26   {
     27{
    2728  $tpl->output['s0'] = 'SELECTED';
    28   }
     29}
    2930else
    30   {
     31{
    3132  $tpl->output['s'.$order_index] = 'SELECTED';
    32   }
     33}
    3334 
    3435$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->PageSize = 20;
     36$pa->PageSize = $Config['DisplayServerCountPerPage'];
    3637$pa->PageLinksDisplayed = 5;
    3738$pa->CountCommand = 'select count(*) as Count from `servers` where `place` =1';
     
    3940$tpl->output['servers_data'] = '';
    4041while ($row = $pa->GetOne())
     42{
     43  switch ($row['xp'])
    4144  {
    42   switch ($row['xp'])
    43     {
    4445    case 1: $xp = 'Very low'; break;
    4546    case 2: $xp = 'Low'; break;
     
    4748    case 4: $xp = 'High'; break;
    4849    case 5: $xp = 'Very high'; break; 
    49     }
    50   if ($row['place']==1)
    51     {
     50  }
     51  if ($row['place'] == 1)
     52  {
    5253    $place = $text['reg_czech'];
    53     }
     54  }
    5455  else
    55     {
     56  {
    5657    $place = $text['reg_abroad'];
    57     }
    58   $tpl->output['servers_data'] .= '<tr style="overflow: hidden; "class="table center">';
    59   $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td style="width: 5px;"><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';
     58  }
     59  $tpl->output['servers_data'] .= '<tr>';
     60  $tpl->output['servers_data'] .= ($row['wss_partner'] == 1)?'<td><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';
    6061  $tpl->output['servers_data'] .='<td align="left">'.ulink('server/'.$row['id'], $row['name']).'</td>';
    61   $tpl->output['servers_data'] .='<td>'.round($row['rating'],2).'</td>';
     62  $tpl->output['servers_data'] .='<td>'.round($row['rating'], 2).'</td>';
    6263  $tpl->output['servers_data'] .='<td>'.$row['version'].'</td>';
    6364  $tpl->output['servers_data'] .='<td>'.$row['type'].'</td>';
  • pages/users.php

    r1 r3  
    3434while ($row = $pa->GetOne())
    3535  {
    36   $tpl->output['data'].='<tr class="table"><td>'.print_nick($row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from servers where owner='.$row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from comments where author='.$row['id']).'</td></tr>';
     36  $tpl->output['data'].='<tr><td align="left">'.print_nick($row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from servers where owner='.$row['id']).'</td><td align="center">'.$db->query_result('select count(*) as pocet from comments where author='.$row['id']).'</td></tr>';
    3737  }
    3838ob_start();
  • pages/wss_partners.php

    r1 r3  
    5656    $place = $text['reg_abroad'];
    5757    }
    58   $tpl->output['servers_data'] .= '<tr style="overflow: hidden; "class="table center">';
    59   $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td style="width: 5px;"><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';
     58  $tpl->output['servers_data'] .= '<tr>';
     59  $tpl->output['servers_data'] .= ($row['wss_partner']==1)?'<td><img src="templates/img/hvezda.gif" alt="Doporučujeme" title="Doporučujeme"></td>':'<td></td>';
    6060  $tpl->output['servers_data'] .='<td align="left">'.ulink('server/'.$row['id'], $row['name']).'</td>';
    6161  $tpl->output['servers_data'] .='<td>'.round($row['rating'],2).'</td>';
Note: See TracChangeset for help on using the changeset viewer.