Changeset 25 for honor.php


Ignore:
Timestamp:
Aug 18, 2007, 12:14:45 PM (17 years ago)
Author:
george
Message:

Přepracována stránka zobrazující seznam nejlepších hráčů. Řádky lze řadit podle jednotlivých sloupců. Tabulka zobrazuje všechny hráče a pod ní jsou zobrazeny odkazy pro listování stránek.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • honor.php

    r5 r25  
     1
    12<?
    23  include('global.php');
    34  ShowHeader();
    4 ?>
     5 
     6  echo('<h3>Nejlep¹í hráèi:</h3><div align="center">');
     7  $Database->select_db('mangos');
    58
     9        if(!array_key_exists('order_by', $_SESSION)) $_SESSION['order_by'] = 'highest_rank';
     10        if(array_key_exists('order_by', $_GET)) $_SESSION['order_by'] = $Database->real_escape_string($_GET['order_by']);
     11        $order_by = $_SESSION['order_by'];
    612
    7 <TABLE width="100%" border="0">
    8 <TR>
    9 <td>
    10 <IFRAME name="Registrace" src="http://wow.zdechov.net/mangos/index.php?n=interactive/honor&realm=Heroes%20of%20Fantasy"></IFRAME>
    11 </td>
    12 </tr>
    13 </TABLE>
     13        if(!array_key_exists('dir', $_SESSION)) $_SESSION['dir'] = 1;
     14        if(array_key_exists('dir', $_GET)) $_SESSION['dir'] = $Database->real_escape_string($_GET['dir']);
     15        $dir = $_SESSION['dir'];
     16        $dir = ($dir) ? 0 : 1;
     17        $order_dir = ($dir) ? "ASC" : "DESC";
     18       
     19        $result = $Database->query("SELECT count(*) FROM `character`");
     20        $Row = $result->fetch_array();
     21        $total_online = $Row[0];
    1422
     23        $order_side = ""; 
     24       
     25  $PerPage = 20;
     26  if(array_key_exists('page', $_GET)) $_SESSION['page'] = $Database->real_escape_string($_GET['page']);
     27  if(array_key_exists('page', $_SESSION)) $Page = $_SESSION['page']; else $Page = 0;
    1528
     29        require_once("minimanager/scripts/defines.php");
     30        $result = $Database->query("SELECT guid,name,race,class,zone,map,
     31                        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_HONOR_POINTS+1)."), ' ', -1) AS UNSIGNED) AS highest_rank,
     32                        CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', ".(CHAR_DATA_OFFSET_LEVEL+1).'), " ", -1) AS UNSIGNED) AS level,account
     33                        FROM `character` WHERE 1 '.$order_side.' ORDER BY '.$order_by.' '.$order_dir.' LIMIT '.$Page*$PerPage.','.$PerPage);
    1634
    17 <?
     35        require_once("minimanager/lang/enUS.php");
     36  $lang_index = array(
     37        // ----- INDEX.PHP -----
     38        'realm' => 'Realm',
     39        'online' => 'Online',
     40        'offline_or_let_height' => 'Offline or Latency too Height',
     41        'delete' => 'Delete',
     42        'tot_users_online' => 'Celkem postav',
     43        'name' => 'Jméno',
     44        'race' => 'Rasa',
     45        'class' => 'Tøída',
     46        'level' => 'Úroveò',
     47        'map' => 'Mapa',
     48        'zone' => 'Zóna',
     49        'honor_kills' => 'Body cti',
     50  );
     51       
     52        $output = "<font class=\"bold\">{$lang_index['tot_users_online']}: $total_online</font><br />
     53        <table class=\"TableGuilda\" border=\"1\" cellspacing=\"0\">
     54        <tr>
     55        <th>Poøadí</th><th width=\"26%\"><a href=\"?order_by=name&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['name']}</a></th>
     56        <th width=\"7%\"><a href=\"?order_by=race&amp;dir=$dir\">".($order_by=='race' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['race']}</a></th>
     57        <th width=\"7%\"><a href=\"?order_by=class&amp;dir=$dir\">".($order_by=='class' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['class']}</a></th>
     58        <th width=\"7%\"><a href=\"?order_by=level&amp;dir=$dir\">".($order_by=='level' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['level']}</a></th>
     59        <th width=\"20%\"><a href=\"?order_by=map&amp;dir=$dir\">".($order_by=='map' ? "<img src=\"images/online_player/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['map']}</a></th>
     60        <th width=\"25%\">{$lang_index['zone']}</th>
     61    <th width=\"10%\"><a href=\"?order_by=highest_rank&amp;dir=$dir\">".($order_by=='highest_rank' ? "<img src=\"images/online_player//arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_index['honor_kills']}</a></th>
     62        </tr>";
     63
     64        require_once("minimanager/scripts/id_tab.php");
     65  $Index = $Page*$PerPage;
     66        while($char = $result->fetch_row())
     67  {
     68    $zone = get_zone_name($char[4]);
     69    if($zone == ' ') $zone = '&nbsp;';
     70    $race = get_player_race($char[2]);
     71    if(($char[2] == 1) or ($char[2] == 3) or ($char[2] == 4) or ($char[2] == 7) or ($char[2] == 11)) $color = '#9090ff';
     72    else $color = '#FF5050';
     73                $output .= '<tr><td>'.($Index+1).".</td>
     74                 <td style=\"color: ".$color.";\">$char[1]</td>
     75         <td><img src='images/online_player/{$char[2]}-0.gif' onmousemove='toolTip(\"".$race."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     76                 <td><img src='images/online_player/{$char[3]}.gif' onmousemove='toolTip(\"".get_player_class($char[3])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     77                 <td>$char[7]</td>
     78                 <td>".get_map_name($char[5])."</td>
     79                 <td>".$zone."</td>
     80                 <td>$char[6]</td>
     81         </tr>";
     82    $Index++;
     83        }
     84   $output .= "</table>";
     85   $output .= PagesList('?page=', $Page, $total_online, $PerPage);
     86   $output .= '</div>';   
     87  echo($output);
     88 
    1889  ShowFooter();
    1990?>
Note: See TracChangeset for help on using the changeset viewer.