Changeset 695 for trunk/pages/svety.php


Ignore:
Timestamp:
Mar 20, 2010, 9:10:18 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Použití názvů světů v URL namísto RealmIndex.
  • Přidáno: Stránka zobrazující informace o jednotlivých světech.
  • Odebráno: Nezobrazovat kategorie aktualit. Stačí jen jedna.
  • Přidáno: Funkce pro generování XML seznamu hráčů ve stylu WoWEmu pro wowstatus.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/svety.php

    r693 r695  
    11<?php
    22
     3function RealmList()
     4{
     5  global $System, $html;
     6 
    37if(array_key_exists('Server', $_GET))
    48{
     
    3135    '</tr>';
    3236 
    33     $DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Logon='.$Server->Id.' AND Enabled=1 ORDER BY Name');
     37    $DbResult2 = $System->Database->query('SELECT *, '.$System->SQLURLName('Name').' AS URLName FROM Realm WHERE Logon='.$Server->Id.' AND Enabled=1 ORDER BY Name');
    3438    while($DbRow = $DbResult2->fetch_assoc())
    3539    {
    3640      $Realm = new Realm($System, $DbRow['Id']);
    37       $Output .= '<tr><td><a href="'.$html->Link('/online-hraci/?RealmIndex='.$Realm->Id).'">'.$Realm->Data['Name'].'</a></td><td>'.$Realm->Data['Rate'].'</td><td>'.$Realm->Data['Type'].'</td><td>'.$Server->OnlineStateImage($Realm->Data['Online']).'</td><td>'.$Realm->OnlineCharactersCount().' / '.$Realm->Data['MaxOnlinePlayers'].' / '.$Realm->CharacterCount().'</td></tr>';
     41      $Output .= '<tr><td><a href="'.$html->Link('/svety/'.$DbRow['URLName'].'/').'">'.$Realm->Data['Name'].'</a></td><td>'.$Realm->Data['Rate'].'</td><td>'.$Realm->Data['Type'].'</td><td>'.$Server->OnlineStateImage($Realm->Data['Online']).'</td><td>'.$Realm->OnlineCharactersCount().' / '.$Realm->Data['MaxOnlinePlayers'].' / '.$Realm->CharacterCount().'</td></tr>';
    3842      $Output .= '<tr><td colspan="5">'.$Realm->Data['Description'].'</td></tr>';
    3943      //if(array_key_exists($Index + 1, $Config['Mangos']['RealmList']))
     
    4448  echo($Output);
    4549}
     50}
     51
     52function RealmInfo()
     53{
     54  global $System;
     55 
     56  $DbResult = $System->Database->query('SELECT * FROM Realm WHERE Id='.$_COOKIE['RealmIndex']);
     57  $Realm = $DbResult->fetch_assoc();
     58  echo('<h2 align="center">'.$Realm['Name'].'</h2>');
     59  echo($Realm['Information']);
     60}
     61
     62if(count($QueryItems) > 1)
     63{
     64  $RealmName = $QueryItems[1];
     65  $DbResult = $System->Database->query('SELECT Id FROM Realm WHERE '.$System->SQLURLName('Name').'="'.$RealmName.'"');
     66  $DbRow = $DbResult->fetch_assoc();
     67  $_COOKIE['RealmIndex'] = $DbRow['Id'];
     68 
     69  if(count($QueryItems) > 2)
     70  {
     71    if($QueryItems[2] == 'online-hraci') include('online-hraci.php');
     72    else if($QueryItems[2] == 'prikazy') include('prikazy.php');
     73    else if($QueryItems[2] == 'akce') include('akce.php');
     74    else if($QueryItems[2] == 'arena') include('arena.php');
     75    else if($QueryItems[2] == 'nej-hraci') include('nej-hraci.php');
     76    else if($QueryItems[2] == 'mapa') include('mapa.php');
     77    else if($QueryItems[2] == 'spolek') include('spolek.php');
     78    else if($QueryItems[2] == 'spolky') include('spolky.php');
     79    else RealmInfo();
     80  } else RealmInfo();
     81} else RealmList();
    4682
    4783?>
Note: See TracChangeset for help on using the changeset viewer.