Changeset 625 for trunk/pages/gmteam.php


Ignore:
Timestamp:
Aug 18, 2009, 12:25:53 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Stránka GM týmu přepracována do přehlednější formy s podporou více světů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/gmteam.php

    r615 r625  
    11<?php
    22
    3 $Role = array('Hráč', 'Moderátor', 'Game Master', 'Kontrolor chyb', 'Vedoucí Tábora', 'Administrátor', 'Správce Systému');
     3function ShowGMList($Realm)
     4{
     5  global $db, $Config;
     6 
     7  $Result = $db->query('SELECT `gm_tym`.*, `account`.`id`, `account`.`username` FROM `'.$Config['Mangos']['DatabaseRealmd'].'`.`account` LEFT JOIN `'.$Config['Database']['Database'].'`.`gm_tym` ON `gm_tym`.`AccountId` = `account`.`id` WHERE (`account`.`locked` = 0) AND (`account`.`gmlevel` > 0) AND (`gm_tym`.`RealmId` = '.$Realm['Id'].') ORDER BY `gm_tym`.`RealmId`, `account`.`username`');
     8  if($Realm['Id'] == 0) $Output = '<h3 class="PageTitle">'.$Realm['Name'].'</h3>';
     9    else $Output = '<h3 class="PageTitle">Svět '.$Realm['Name'].'</h3>';
     10  $Output .= '<table class="BaseTable">'.
     11    '<tr><th>Jméno</th><th>Pověření</th><th>Postavy</th></tr>';
     12  if($Result->num_rows == 0) return('');
     13 
     14  while($Line = $Result->fetch_array())
     15  {
     16    $Line['username'] = strtoupper($Line['username'][0]).strtolower(substr($Line['username'], 1));
     17    if(substr($Line['username'], -2, 2) == 'gm') $Line['username'] = substr($Line['username'], 0, -2);
     18 
     19    $Output .= '<tr><td>'.$Line['username'].'</td>'.
     20      '<td>'.$Line['Delegation'].'</td>';
     21    $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
     22    $Output .= '<td>';
     23    $Characters = array();
     24    $ResultMangos = $db->query('SELECT * FROM `characters` WHERE account = "'.$Line['id'].'"');
     25    while($LineMangos = $ResultMangos->fetch_array())
     26    {
     27      if($LineMangos['online'] == 1) $Characters[] = $LineMangos['name'].'(online)';
     28        else $Characters[] = $LineMangos['name'];
     29    }
     30    $Output .= implode(', ', $Characters);
     31    $Output .= '</td>';
    432
    5 echo('<h3 class="PageTitle">GM tým</h3>');
    6 echo($server->RealmSelection());
    7 $db->select_db($Config['Mangos']['DatabaseRealmd']);
    8 $Result = $db->query('SELECT * FROM account WHERE (locked = 0) AND (gmlevel > 0) ORDER BY username');
    9 echo('<table class="GMTeamTable">');
    10 while($Line = $Result->fetch_array())
    11 {
    12   $Line['username'] = strtoupper($Line['username'][0]).strtolower(substr($Line['username'], 1));
    13   if(substr($Line['username'], -2, 2) == 'gm') $Line['username'] = substr($Line['username'], 0, -2);
    14  
    15   echo('<tr class="start"><th>Přezdívka:</th>');
    16   echo('<td>'.$Line['username'].'</td>');
    17   echo('</tr>');
    18   echo('<tr><th>Pověření:</th>');
    19   echo('<td>'.$Line['Note'].'</td>');
    20   echo('</tr>');
    2133/*
    22   if ($Line['Email'] <> '')
    23   {
    24     echo '<tr><td><p>Email:</p></td>';
    25     echo '<td><p><b>'.$Line['Email'].'</b></p></td>';
    26     echo '</tr>';
    27   }
    28   $Acc = $Line['AccID'];
    29 */
    30   $db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
    31   echo('<tr><th>GM Postavy ve hře:</th>');
    32   echo('<td>');
    33   $Characters = array();
    34   $ResultMangos = $db->query('SELECT * FROM `characters` WHERE account = "'.$Line['id'].'"');
    35   while($LineMangos = $ResultMangos->fetch_array())
    36   {
    37     if($LineMangos['online'] == 1) $Characters[] = $LineMangos['name'].'(online)';
    38       else $Characters[] = $LineMangos['name'];
    39   }
    40   echo(implode(', ', $Characters));
    41   echo('</td></tr>');
    42 
    43 //  $Database->select_db($Config['Mangos']['DatabaseRealmd']);
     34 * //  $Database->select_db($Config['Mangos']['DatabaseRealmd']);
    4435  if($Line['ForumId'] != 0)
    4536  {
     
    4940  }
    5041  //echo('<tr><td colspan="2"><hr></td></tr>');
     42  */
     43    $Output .= '</tr>';
     44  }
     45  $Output .= '</table>';
     46  return($Output);
    5147}
    52 echo('</table>');
     48
     49//$Role = array('Hráč', 'Moderátor', 'Game Master', 'Kontrolor chyb', 'Vedoucí Tábora', 'Administrátor', 'Správce Systému');
     50//$_COOKIE['RealmIndex']
     51
     52$Output = '<h2 class="PageTitle">GM tým</h3>';
     53
     54$Output .= ShowGMList(array('Id' => 0, 'Name' => 'Všechny světy'));
     55foreach($Config['Mangos']['RealmList'] as $Realm)
     56{
     57  $Output .= ShowGMList($Realm);
     58}
     59$Output .= '<br />'.$server->RealmSelection();
     60
     61echo($Output);
    5362
    5463?>
Note: See TracChangeset for help on using the changeset viewer.