Changeset 681 for trunk/pages


Ignore:
Timestamp:
Jan 23, 2010, 1:32:45 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Nastavení počítačů, přihlašovacích serverů a světů přesunuto do databáze z konfiguračního souboru.
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 mm
        2 Thumbs.db
         1gallery
         2armory
         3tester
         4test
         5minimanager
         6mmfpm
  • trunk/pages/arena.php

    r630 r681  
    1919
    2020$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    21 $db = $Realm->Database;
    22 $db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     21$db = $Realm->CharactersDatabase;
    2322
    2423$count = $db->query('SELECT COUNT(*) FROM arena_team')->fetch_row();
  • trunk/pages/commands.php

    r630 r681  
    55
    66$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    7 $db = $Realm->Database;
    8 $db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseMangos']);
     7$db = $Realm->MangosDatabase;
    98
    109$Output .= '<ul>';
  • trunk/pages/events.php

    r630 r681  
    9191echo($server->RealmSelection());
    9292$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    93 $db = $Realm->Database;
    94 $db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseMangos']);
     93$db = $Realm->MangosDatabase;
    9594
    9695$Events = Events();
  • trunk/pages/gmteam.php

    r635 r681  
    5050
    5151$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    52 $db2 = $Realm->Database;
    53 $db2->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     52$db2 = $Realm->CharactersDatabase;
    5453
    55 $db->select_db($Config['Database']['Database']);
    5654$Output = '<h2 class="PageTitle">GM tým</h2>';
    5755
  • trunk/pages/guilda.php

    r634 r681  
    1111
    1212$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    13 $db2 = $Realm->Database;
    14 $db2->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     13$db2 = $Realm->CharactersDatabase;
    1514$id = (isset($_GET['id'])) ? $_GET['id'] : 0;
    1615if($id != 0)
  • trunk/pages/guildy.php

    r634 r681  
    4444
    4545$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    46 $db2 = $Realm->Database;
    47 $db2->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     46$db2 = $Realm->CharactersDatabase;
    4847
    4948$sql = $db2->query('SELECT `guild`.name, `guild`.guildid, `guild`.createdate, COUNT(`guild_member`.`guildid`) AS member_count ,`leader`.`race` IN (1, 3, 4, 7, 11) AS fraction , `leader`.`guid` AS leader FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `characters` AS `memebers` ON `memebers`.`guid`= `guild_member`.`guid` JOIN `characters` AS `leader` ON `leader`.`guid`= `guild`.`leaderguid` GROUP BY guild.name ORDER BY '.$order_by.' '.$order_dir.';');
  • trunk/pages/online.php

    r632 r681  
    3737    MakeLink('Body arén', 'arena_points').'</th></tr>');
    3838
    39 $Realm->Database->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
    40 $sql = $Realm->Database->query('SELECT guid, name, race, class, zone, map, '.
     39$sql = $Realm->CharactersDatabase->query('SELECT guid, name, race, class, zone, map, '.
    4140  'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['HonorPoints'].'+1), " ", -1) AS UNSIGNED) AS highest_rank, '.
    4241  'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS UNSIGNED) AS level, '.
  • trunk/pages/realmlist.php

    r677 r681  
    11<?php
    22
    3 $Output = '<h2 align="center">Seznam světů</h2>';
    4 
    5 $Output .= '<table class="BaseTable">'.
    6   '<tr>'.
    7   '<th>Název</th>'.
    8   '<th>Násobek XP</th>'.
    9   '<th>Zaměření</th>'.
    10   '<th>Stav</th>'.
    11   '<th>Hráči online / max. online / celkem</th>'.
    12   '</tr>';
    13  
    14 foreach($Config['Mangos']['RealmList'] as $Index => $RealmConfig)
     3if(array_key_exists('Server', $_GET))
    154{
    16   $db->select_db($Config['Mangos']['DatabaseRealmd']);
    17   $DbResult = $db->query('SELECT * FROM `realmlist` WHERE id='.$RealmConfig['Id']); 
     5  $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host WHERE Logon.Id='.$_GET['Server']);
    186  if($DbResult->num_rows > 0)
    197  {
    20     $Realm = new Realm($System, $Index);
    21     $DbRow = $DbResult->fetch_assoc();
    22     $Output .= '<tr><td><a href="?page=online&amp;RealmIndex='.$Index.'">'.$RealmConfig['Name'].'</a></td><td>'.$RealmConfig['XPRate'].'</td><td>'.$RealmConfig['Type'].'</td><td>'.$server->OnlineStateImage($System->NetworkPortState($DbRow['address'], $DbRow['port'])).'</td><td>'.$Realm->OnlineCharactersCount($Index).' / '.$RealmConfig['MaxOnlinePlayers'].' / '.$Realm->CharacterCount($Index).'</td></tr>';
    23     $Output .= '<tr><td colspan="5">'.$RealmConfig['Description'].'</td></tr>';
    24     //if(array_key_exists($Index + 1, $Config['Mangos']['RealmList']))
    25     $Output .= '<tr><td colspan="5">&nbsp;</td></tr>';
     8    $Realm = $DbResult->fetch_assoc();
     9    echo('set realmlist '.$Realm['Address']);
     10    if($Realm['Port'] != 3724) echo(':'.$Realm['Port']);
     11    echo('</div>');
     12  } else echo('Neznámé Id serveru');
     13} else
     14{
     15  $Output = '<h2 align="center">Seznam světů</h2>';
     16
     17  $DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host');
     18  while($DbRow = $DbResult->fetch_assoc())
     19  {
     20    $Server = new Server($System, $DbRow['Id']);
     21    $Output .= '<div style="text-align: center">Realmlist <a href="?page=realmlist&amp;Server='.$DbRow['Id'].'">'.$DbRow['Address'];
     22    if($DbRow['Port'] != 3724) $Output .= ':'.$DbRow['Port'];
     23    $Output .= '</a></div>';
     24    $Output .= '<table class="BaseTable">'.
     25    '<tr>'.
     26    '<th>Název</th>'.
     27    '<th>Násobek XP</th>'.
     28    '<th>Zaměření</th>'.
     29    '<th>Stav</th>'.
     30    '<th>Hráči online / max. online / celkem</th>'.
     31    '</tr>';
     32 
     33    $DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Logon='.$Server->Id.' ORDER BY Name');
     34    while($DbRow = $DbResult2->fetch_assoc())
     35    {
     36      $Realm = new Realm($System, $DbRow['Id']);
     37      $Output .= '<tr><td><a href="?page=online&amp;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>';
     38      $Output .= '<tr><td colspan="5">'.$Realm->Data['Description'].'</td></tr>';
     39      //if(array_key_exists($Index + 1, $Config['Mangos']['RealmList']))
     40      $Output .= '<tr><td colspan="5">&nbsp;</td></tr>';
     41    }
     42    $Output .= '</table><br/>';
    2643  }
     44  echo($Output);
    2745}
    28 $Output .= '</table>';
    29 echo($Output);
    3046
    3147?>
  • trunk/pages/server.php

    r650 r681  
    5757  </tr>
    5858  <tr><td colspan="2" style="padding: 5px;">';
    59  
    60 foreach($Config['Web']['ServerList'] as $Index => $Server)
     59
     60$DbResult = $System->Database->query('SELECT * FROM Host');
     61while($Host = $DbResult->fetch_assoc())
    6162{
    6263  $Realms = array();
    63   foreach($Config['Mangos']['RealmList'] as $RealmIndex => $Realm)
     64  $DbResult2 = $System->Database->query('SELECT * FROM Realm');
     65  while($Realm = $DbResult2->fetch_assoc())
    6466  {
    65     if($Realm['Server'] == $Index) $Realms[] = $Realm['Name'];
     67    if($Realm['Host'] == $Host['Id']) $Realms[] = $Realm['Name'];
    6668  }
    6769   
     
    7274  <tr>
    7375    <td>Operační systém</td>
    74     <td>'.$Server['OS'].'</td>
     76    <td>'.$Host['OS'].'</td>
    7577  </tr>
    7678  <tr>
    7779    <td>Procesor</td>
    78     <td>'.$Server['CPU'].'</td>
     80    <td>'.$Host['CPU'].'</td>
    7981  </tr>
    8082  <tr>
    8183    <td>Operační paměť</td>
    82     <td>'.$Server['Memory'].'</td>
     84    <td>'.$Host['Memory'].'</td>
    8385  </tr>
    8486  <tr>
    8587    <td>Pevný disk</td>
    86     <td>'.$Server['HDD'].'</td>
     88    <td>'.$Host['HDD'].'</td>
    8789  </tr>
    8890  <tr>
    8991    <td>Adresa serveru</td>
    90     <td>'.$Server['Address'].'</td>
     92    <td>'.$Host['Address'].'</td>
    9193  </tr>
    9294  <tr>
    9395    <td>Internetová linka</td>
    94     <td>'.$Server['Internet'].'</td>
     96    <td>'.$Host['Internet'].'</td>
    9597  </tr>
    9698  <tr>
     
    100102  <tr>
    101103    <td>Grafy</td>
    102     <td><a href="'.$Server['Statistic'].'">'.$Server['Statistic'].'</a></td>
     104    <td><a href="'.$Host['Statistic'].'">'.$Host['Statistic'].'</a></td>
    103105  </tr>
    104106  </table>';
  • trunk/pages/tophraci.php

    r630 r681  
    2222
    2323$Realm = new Realm($System, $_COOKIE['RealmIndex']);
    24 $db = $Realm->Database;
    25 $db->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);
     24$db = $Realm->CharactersDatabase;
    2625
    2726$sql = 'SELECT name, totaltime, online FROM characters ORDER BY totaltime DESC LIMIT '.$top;
Note: See TracChangeset for help on using the changeset viewer.