Changeset 614 for trunk


Ignore:
Timestamp:
Aug 7, 2009, 11:38:12 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Výběr světa i na začátku stránek, kterých se výběr týká.
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/html.php

    r613 r614  
    297297        '<tr>'.
    298298        '<td colspan="2">'.
    299         '<strong>Server : </strong>'.$server->ServerImg($server->ServerOnline($Config['Web']['WoWServerAddr'], 3724)).'<b> (<a href="?page=realmlist">'.$server->ServerMangosOnline().' hráčů celkem</a>) | Patch '.$Config['Mangos']['ClientVersion'].' | <a href="'.$Config['Web']['BaseURL'].'/pages/realmlist.wtf">Realmlist</a> | <a href="?page=server">Server info</a> | <a href="?page=realmlist">Seznam světů</a>a></b>'.
     299        '<strong>Server : </strong>'.$server->ServerImg($server->ServerOnline($Config['Web']['WoWServerAddr'], 3724)).'<b> (<a href="?page=realmlist">'.$server->ServerMangosOnline().' hráčů celkem</a>) | Patch '.$Config['Mangos']['ClientVersion'].' | <a href="'.$Config['Web']['BaseURL'].'/pages/realmlist.wtf">Realmlist</a> | <a href="?page=server">Server info</a> | <a href="?page=realmlist">Seznam světů</a></b>'.
    300300        '</td></tr></table><br />');
    301301    }
  • trunk/inc/server.php

    r611 r614  
    368368      else return('-');
    369369  }
     370 
     371  function RealmSelection($FormNameSufix = '')
     372  {
     373    global $Config;
     374   
     375    $Output = '';
     376    if(count($Config['Mangos']['RealmList']) > 1)
     377    {
     378      $Output .= '<div align="center"><form name="RealmSelection'.$FormNameSufix.'" action="" method="post">'.
     379      'Svět <select name="RealmIndex" onchange="document.RealmSelection'.$FormNameSufix.'.submit()">';
     380      foreach($Config['Mangos']['RealmList'] as $Index => $Realm)
     381      {
     382        if($_COOKIE['RealmIndex'] == $Index) $Selected = ' selected="selected"';
     383         else $Selected = '';
     384        $Output .= '<option value="'.$Index.'"'.$Selected.'>'.$Realm['Name'].'</option>';
     385      }
     386      $Output .= '</select>'.
     387      '</form></div>';
     388    }
     389    return($Output);
     390  }
    370391}
    371392
  • trunk/index.php

    r612 r614  
    8989echo('</div>');
    9090
    91 if(count($Config['Mangos']['RealmList']) > 1)
    92 {
    93   echo('Výběr světa:');
    94   echo('<form name="realm_selection" action="" method="post">'.
    95   '<select name="RealmIndex" style="width: 100%" onchange="document.realm_selection.submit()">');
    96   foreach($Config['Mangos']['RealmList'] as $Index => $Realm)
    97   {
    98     if($_COOKIE['RealmIndex'] == $Index) $Selected = ' selected="selected"';
    99       else $Selected = '';
    100     echo('<option value="'.$Index.'"'.$Selected.'>'.$Realm['Name'].'</option>');
    101   }
    102   echo('</select>'.
    103   '</form>');
    104 }
     91echo($server->RealmSelection());
    10592
    10693echo('<br /><br />');
  • trunk/pages/arena.php

    r609 r614  
    2121$count = $db->query('SELECT COUNT(*) FROM arena_team')->fetch_row();
    2222$all_record = $count[0];
    23 echo('<h3 class="PageTitle">Arénové týmy :</h3>
    24 Celkem týmů : <strong>'.$all_record.'</strong>
     23echo('<h3 class="PageTitle">Arénové týmy :</h3>');
     24echo($server->RealmSelection());
     25echo('Celkem týmů : <strong>'.$all_record.'</strong>
    2526  <table class="BaseTable">
    2627    <tr>
  • trunk/pages/chars.php

    r576 r614  
    22
    33$html->PrgStart();
     4echo($server->RealmSelection());
    45echo('&nbsp;<a href="?page=acc">&lt;- Zpět do správy účtu</a>');
    56
  • trunk/pages/commands.php

    r613 r614  
    22
    33$Output = '<h2 align="center">Herní příkazy</h2>';
     4$Output .= $server->RealmSelection();
    45
    56$db->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseMangos']);
  • trunk/pages/events.php

    r609 r614  
    8989
    9090echo('<h3 class="PageTitle">Události ve hře</h3>');
     91echo($server->RealmSelection());
    9192
    9293$Events = Events();
  • trunk/pages/gmlog.php

    r609 r614  
    55
    66echo('<img src="imgs/gm.jpg" alt="gm" /><br />');
     7echo($server->RealmSelection());
    78echo('<table class="BaseTable"><tr><th>Čas</th><th>Příkaz</th><th>GM</th><th>Vybrán</th></tr>');
    89
  • trunk/pages/guildy.php

    r609 r614  
    3131
    3232echo('<h3 class="PageTitle">Seznam spolků</h3>');
     33echo($server->RealmSelection());
    3334echo('<table class="BaseTable">
    3435  <tr>
  • trunk/pages/online.php

    r609 r614  
    2222
    2323echo('<h3 class="PageTitle">Online hráči</h3>');
     24echo($server->RealmSelection('Menu'));
     25
    2426echo('<div style="text-align: center">Celkem '.$server->MangosOnline($_COOKIE['RealmIndex']).' hráčů.</div>'.
    2527'<table class="BaseTable">
  • trunk/pages/register.php

    r597 r614  
    3939  '<br />');
    4040
    41 if($RegistrationLimit->GetFreeRegistrationCount() == 0)
     41//if($RegistrationLimit->GetFreeRegistrationCount() == 0)
     42//{
     43//  echo('<div class="h10">Registrace pro dnešní den vyčerpány</div>');
     44//  echo('<div class="h10">Dnes bylo '.$RegistrationLimit->GetPerDeyRegistrationCount().' volných registrací</div>');
     45//} else
    4246{
    43   echo('<div class="h10">Registrace pro dnešní den vyčerpány</div>');
    44   echo('<div class="h10">Dnes bylo '.$RegistrationLimit->GetPerDeyRegistrationCount().' volných registrací</div>');
    45 } else
    46 {
    47   echo('<div class="h11">Pro tento den je povoleno '.$RegistrationLimit->GetPerDeyRegistrationCount().' volných registrací</div>');
    48   echo('<div class="h11">Zbývá ještě '.$RegistrationLimit->GetFreeRegistrationCount().' volných registrací</div>');
     47  //echo('<div class="h11">Pro tento den je povoleno '.$RegistrationLimit->GetPerDeyRegistrationCount().' volných registrací</div>');
     48  //echo('<div class="h11">Zbývá ještě '.$RegistrationLimit->GetFreeRegistrationCount().' volných registrací</div>');
    4949  echo('<br />');
    5050
  • trunk/pages/tophraci.php

    r609 r614  
    2727$i = 0;
    2828echo('<h3 class="PageTitle">Nejlepších '.$top.' herních časů</h3>');
     29echo($server->RealmSelection());
    2930
    3031echo('<table class="SimpleTable">');     
  • trunk/pages/xpreset.php

    r576 r614  
    22
    33$html->PrgStart();
     4echo($server->RealmSelection());
    45if($player->Check())
    56{
  • trunk/stat/stat.php

    r591 r614  
    55$Username = $Config['Database']['User'];
    66$Password = $Config['Database']['Password'];
    7 $Database = $Config['Mangos']['DatabaseMangos']; // must contains characters table
     7$Database = $Config['Mangos']['RealmList'][1]['DatabaseMangos']; // must contains characters table
    88$RealmHostname = $Hostname;
    99$RealmUsername = $Username;
    1010$RealmPassword = $Password;
    1111$RealmDatabase = $Config['Mangos']['DatabaseRealmd'];  // must contains zone_coordinates and accounts table
    12 $CharactersDatabase = $Config['Mangos']['DatabaseCharacters'];  // must contains zone_coordinates and accounts table
     12$CharactersDatabase = $Config['Mangos']['RealmList'][1]['DatabaseCharacters'];  // must contains zone_coordinates and accounts table
    1313$EmuVersion = $Config['Mangos']['ClientVersion'];
    1414$Owner = $Config['Web']['Admin'];
     
    5252"    <players>\r\n";
    5353
    54         $realm_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
    55         mysql_select_db($RealmDatabase, $realm_db);
     54  $realm_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
     55  mysql_select_db($RealmDatabase, $realm_db);
    5656  $db_result = mysql_query("SET NAMES $DatabaseEncoding", $realm_db);
    5757
    58         $mangos_db = mysql_connect($Hostname, $Username, $Password, TRUE);
    59         mysql_select_db($Database, $mangos_db);
     58  $mangos_db = mysql_connect($Hostname, $Username, $Password, TRUE);
     59  mysql_select_db($Database, $mangos_db);
    6060  $db_result = mysql_query("SET NAMES $DatabaseEncoding", $mangos_db);
    6161 
    62         $characters_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
    63         mysql_select_db($CharactersDatabase, $characters_db);
     62  $characters_db = mysql_connect($RealmHostname, $RealmUsername, $RealmPassword);
     63  mysql_select_db($CharactersDatabase, $characters_db);
    6464  $db_result = mysql_query("SET NAMES $DatabaseEncoding", $characters_db);
    6565
    6666  $db_result = mysql_query("SELECT * FROM `characters` WHERE `online`='1' ORDER BY `name`", $characters_db);
    67         while($result = mysql_fetch_array($db_result))
    68         {
     67  while($result = mysql_fetch_array($db_result))
     68  {
    6969    // Get GM level by character
    7070    $db_result2 = mysql_query("SELECT gmlevel FROM `account` WHERE `id`='".$result['account']."'", $realm_db);
     
    7373   
    7474    $char_data = explode(' ',$result['data']);
    75                 $Result .= "      <player>\r\n".
     75    $Result .= "      <player>\r\n".
    7676    "        <name>".$result['name']."</name>\r\n".
    7777    "        <race>".$result['race']."</race>\r\n".
     
    9292function get_zone_name($mapid, $x, $y)
    9393{
    94         global $realm_db;
    95         $query = mysql_query("SELECT * FROM `zone_coordinates` ORDER BY `priory`", $realm_db);
    96         $zmap = 0;
    97         while($result = mysql_fetch_array($query))
    98         {
    99         if ($result['map']==$mapid AND $result['y_min'] < $x  AND $result['y_max'] > $x AND $result['x_max'] < $y  AND $result['x_min'] > $y) $zmap=$result['zone_id'];
    100         }
    101         return $zmap;
     94  global $realm_db;
     95  $query = mysql_query("SELECT * FROM `zone_coordinates` ORDER BY `priory`", $realm_db);
     96  $zmap = 0;
     97  while($result = mysql_fetch_array($query))
     98  {
     99    if ($result['map']==$mapid AND $result['y_min'] < $x  AND $result['y_max'] > $x AND $result['x_max'] < $y  AND $result['x_min'] > $y) $zmap=$result['zone_id'];
     100  }
     101  return $zmap;
    102102}
    103103
Note: See TracChangeset for help on using the changeset viewer.