Changeset 691


Ignore:
Timestamp:
Mar 19, 2010, 9:46:30 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Generování pěkného pro další stránky.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/player.php

    r690 r691  
    1717   
    1818    if($err == 0) echo('<img src="'.$html->Link('/imgs/inc/on.gif').'">&nbsp;<font color="#234303" size="4">'.$text.'</font><br />');
    19       else echo('<img src="'.$html->Link('imgs/inc/off.gif').'">&nbsp;<font color="#990000" size="4\">'.$text.'</font><br />');
     19      else echo('<img src="'.$html->Link('/imgs/inc/off.gif').'">&nbsp;<font color="#990000" size="4\">'.$text.'</font><br />');
    2020  }
    2121
     
    3737    {
    3838      $this->Msg('Zadané jmnéno účtu již existuje', 1);
    39       $this->Recall(3);
    4039    }     
    4140  }
     
    5554      $_SESSION['UserName'] = $username;
    5655      $this->Msg('Přihlášení úspěšné', 0);
    57       $this->Recall(1);
    5856    } else
    5957    {
    6058      $this->Msg('Přihlášení neúspěšné', 1);
    61       $this->Recall(3);
    6259    }
    6360  }
     
    6865    $_SESSION['UserName'] = '';
    6966    $this->Msg('Odhlášení úspěšné', 0);
    70     $this->Recall(1);
    7167  }
    7268
     
    329325  }
    330326
    331   public function Recall($time)
    332   {
    333     global $Config;
    334      
    335     if(isset($_SERVER['HTTP_REFERER']))
    336     {
    337       $link = parse_url($_SERVER['HTTP_REFERER']);
    338       if(($link['host'] == $Config['Web']['WoWServerAddr']) or ($link['host'] == 'localhost'))
    339       {
    340         echo('<meta http-equiv="refresh" content="'.$time.';?'.$link['query'].'">');
    341       } else
    342       {
    343         echo('<meta http-equiv="refresh" content="'.$time.';">');
    344       }
    345     }
    346   }
    347 
    348327  public function CharsOnAcc($accid)
    349328  {
    350     global $Config, $System;
     329    global $Config, $System, $html;
    351330   
    352331    echo('<table class="BaseTable">
     
    366345        '<td>'.$row['name'].'</td>'.
    367346        '<td>'.$this->GetPlayerLvl($row['guid']).'</td>'.
    368         '<td><img src="imgs/icons/'.$row['race'].'-'.$gender.'.gif" alt="rasa" /></td>'.
    369         '<td><img src="imgs/icons/'.$row['class'].'.gif" alt="trida" /></td>'.
     347        '<td><img src="'.$html->Link('imgs/icons/'.$row['race'].'-'.$gender.'.gif').'" alt="rasa" /></td>'.
     348        '<td><img src="'.$html->Link('/imgs/icons/'.$row['class'].'.gif').'" alt="trida" /></td>'.
    370349        '<td>'.round($row['totaltime'] / 3600).' h</td>'.
    371350        '</tr>');
  • trunk/index.php

    r690 r691  
    1010  $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
    1111  else $_SERVER['QUERY_STRING'] = '';
    12 echo(phpinfo());
     12//echo(phpinfo());
    1313
    1414if(count($QueryItems) > 0)
     
    1919  else die('Nenalezen soubor inc/config.php. Vytvořte jej z předlohy config.sample.php.');
    2020
    21 if(array_key_exists('RealmIndex', $_POST))
    22 {
    23   setcookie('RealmIndex', $_POST['RealmIndex']);
    24   $_COOKIE['RealmIndex'] = $_POST['RealmIndex'];
    25 }
    26 if(array_key_exists('RealmIndex', $_GET))
    27 {
    28   setcookie('RealmIndex', $_GET['RealmIndex']);
    29   $_COOKIE['RealmIndex'] = $_GET['RealmIndex'];
    30 }
    3121
    3222session_start();
     
    5141$html->Start();
    5242$_GET = $html->GetQueryStringArray();
     43
     44if(array_key_exists('RealmIndex', $_POST))
     45{
     46  setcookie('RealmIndex', $_POST['RealmIndex']);
     47  $_COOKIE['RealmIndex'] = $_POST['RealmIndex'];
     48}
     49if(array_key_exists('RealmIndex', $_GET))
     50{
     51  setcookie('RealmIndex', $_GET['RealmIndex']);
     52  $_COOKIE['RealmIndex'] = $_GET['RealmIndex'];
     53}
    5354
    5455if(isset($_COOKIE['hof-random']) and $_COOKIE['hof-random'] == 'no') $num_headers = 1;
  • trunk/pages/online-hraci.php

    r690 r691  
    55$order_dir = ($dir == 'up') ? 'ASC' :'DESC';
    66$dir = ($dir == 'down') ? 'up' : 'down';
    7 $dir_img = ($dir == 'down') ? '<img src="imgs/inc/up.gif" alt="vzestupně" />' : '<img src="imgs/inc/down.gif" alt="sestupně"/>';
     7$dir_img = ($dir == 'down') ? '<img src="'.$html->Link('/imgs/inc/up.gif').'" alt="vzestupně" />' : '<img src="'.$html->Link('/imgs/inc/down.gif').'" alt="sestupně"/>';
    88
    99function MakeLink($show, $sort)
    1010{
    11   global $dir, $dir_img;
     11  global $dir, $dir_img, $html;
     12 
    1213  if(isset($_GET['order']) and $_GET['order'] == $sort)
    1314  {
     
    1819    $arrow = '';
    1920  }
    20   return($arrow.'<a href="?page=online&amp;order='.$sort.'&amp;dir='.$dir.'">'.$show.'</a>');
     21  return($arrow.'<a href="'.$html->Link('/online-hraci/?order='.$sort.'&amp;dir='.$dir).'">'.$show.'</a>');
    2122}
    2223
     
    4647{
    4748  $aliance = array(1, 3, 4, 7, 11);
    48   $frakce = (in_array($row['race'], $aliance)) ? '<img src="imgs/inc/a.gif" alt="aliance"/>' : '<img src="imgs/inc/h.gif" alt="horda" />';
     49  $frakce = (in_array($row['race'], $aliance)) ? '<img src="'.$html->Link('/imgs/inc/a.gif').'" alt="aliance"/>' : '<img src="'.$html->Link('/imgs/inc/h.gif').'" alt="horda" />';
    4950  $gender = ($row['gender'] == 0) ? '0' : '1';
    5051  echo('<tr>
    5152      <td align="center">'.$frakce.'</td>
    5253      <td align="center">'.$row['name'].'</td>
    53       <td align="center"><img src="imgs/icons/'.$row['race'].'-'.$gender.'.gif" alt="rasa" /></td>
    54       <td align="center"><img src="imgs/icons/'.$row['class'].'.gif" alt="třída" /></td>
     54      <td align="center"><img src="'.$html->Link('/imgs/icons/'.$row['race'].'-'.$gender.'.gif').'" alt="rasa" /></td>
     55      <td align="center"><img src="'.$html->Link('/imgs/icons/'.$row['class'].'.gif').'" alt="třída" /></td>
    5556      <td align="center">'.$row['level'].'</td>
    5657      <td align="center">'.$server->MapName($row['map']).'<br />('.$server->ZoneName($row['zone']).')</td>
  • trunk/pages/realmlist.php

    r684 r691  
    1919  {
    2020    $Server = new Server($System, $DbRow['Id']);
    21     $Output .= '<div style="text-align: center">'.$DbRow['Name'].' '.$DbRow['ClientVersion'].' - realmlist: <a href="?page=realmlist&amp;Server='.$DbRow['Id'].'">'.$DbRow['Address'];
     21    $Output .= '<div style="text-align: center">'.$DbRow['Name'].' '.$DbRow['ClientVersion'].' - realmlist: <a href="'.$html->Link('/realmlist/?Server='.$DbRow['Id']).'">'.$DbRow['Address'];
    2222    if($DbRow['Port'] != 3724) $Output .= ':'.$DbRow['Port'];
    2323    $Output .= '</a></div>';
     
    3535    {
    3636      $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>';
     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>';
    3838      $Output .= '<tr><td colspan="5">'.$Realm->Data['Description'].'</td></tr>';
    3939      //if(array_key_exists($Index + 1, $Config['Mangos']['RealmList']))
  • trunk/pages/spolek.php

    r690 r691  
    1616{
    1717  $guild_id = $id;
    18   $DbResult = $db2->query('SELECT `guildid`, `name`, `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1');
     18  $DbResult = $db2->query('SELECT `guildid`, `name`, FROM_UNIXTIME(`createdate`) AS `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1');
    1919  $guild_data = $DbResult->fetch_assoc();
    2020  $members = $db2->query('SELECT guild_member.guid, guild_member.rank AS mrank, `characters`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS level, (SELECT rname FROM guild_rank WHERE guildid ='.$guild_id.' AND rid = mrank + 1) AS rname, guild_member.pnote, guild_member.offnote FROM guild_member,`characters` LEFT JOIN guild_member k1 ON k1.`guid`=`characters`.`guid` WHERE guild_member.guildid = '.$guild_id.' AND guild_member.guid=`characters`.guid ORDER BY mrank');
     
    2929  $time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]);
    3030  $human_date = date('d.m.Y H:i:s', $time);
    31   echo('<a href="?page=guildy">&lt;- Zpět na výpis</a><br />');
     31  echo('<a href="'.$html->Link('/spolky/').'">&lt;- Zpět na výpis</a><br />');
    3232  echo('<table class="BaseTable">
    3333    <tr>
     
    9393    echo('<tr>'.
    9494      '<td align="center">'.$member[2].'</td>'.
    95       '<td align="center"><img src="imgs/icons/'.$online['race'].'-'.$gender.'.gif" alt="pohlaví" /></td>'.
    96       '<td align="center"><img src="imgs/icons/'.$online['class'].'.gif" alt="třída" /></td>'.
     95      '<td align="center"><img src="'.$html->Link('/imgs/icons/'.$online['race'].'-'.$gender.'.gif').'" alt="pohlaví" /></td>'.
     96      '<td align="center"><img src="'.$html->Link('/imgs/icons/'.$online['class'].'.gif').'" alt="třída" /></td>'.
    9797      '<td align="center" style="color: '.$LevelColor.'">'.$Level.'</td>'.
    9898      '<td align="center">'.$member[4].' ('.$member[1].')</td>'.
    9999      '<td align="center" style="color: '.$LogoutTimeColor.'">'.$LogoutTime.'</td>'.
    100       '<td align="center">'.(($online['online']) ? '<img src="imgs/inc/on.gif" alt="online" />' : '<img src="imgs/inc/off.gif" alt="offline" />').'</td>'.
     100      '<td align="center">'.(($online['online']) ? '<img src="'.$html->Link('/imgs/inc/on.gif').'" alt="online" />' : '<img src="'.$html->Link('/imgs/inc/off.gif').'" alt="offline" />').'</td>'.
    101101      '</tr>');
    102102  }
    103103  echo('</table>');
    104 } else echo('<meta http-equiv="refresh" content="0;url=?page=guildy">');
     104} else echo('<meta http-equiv="refresh" content="0;url='.$html->Link('/spolky/').'">');
    105105 
    106106?>
  • trunk/pages/spolky.php

    r690 r691  
    4949$db2 = $Realm->CharactersDatabase;
    5050
    51 $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.';');
     51$sql = $db2->query('SELECT `guild`.name, `guild`.guildid, FROM_UNIXTIME(`guild`.`createdate`) AS `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.';');
    5252while($row = $sql->fetch_assoc())
    5353{
     
    6464  echo('<tr>
    6565    <td align="center">'.FrakceImg($row['fraction']).'</td>
    66     <td align="center"><a href="'.$html->Link('/spolek/'.$row['guildid'].'/').'">'.$row['name'].'</a></td>
     66    <td align="center"><a href="'.$html->Link('/spolek/?id='.$row['guildid']).'">'.$row['name'].'</a></td>
    6767    <td align="center">'.$row['member_count'].'</td>
    6868    <td align="center">'.$online_mem['online_mem'].'</td>
  • trunk/pages/ucet.php

    r690 r691  
    55if(array_key_exists('pass', $_POST)) $pass = $_POST['pass']; else $pass = '';
    66
    7 if(isset($_POST['login']) and ($_POST['user'] != '') and ($_POST['pass'] != ''))
     7function Menu()
    88{
    9   $player->Login($user, $pass);
    10 } else
    11 {
     9  global $html, $player;
     10 
    1211  if($player->Check())
    1312  {
     
    4039    $player->LoginForm();
    4140  }
     41
     42}
     43
     44if(isset($_POST['login']) and ($_POST['user'] != '') and ($_POST['pass'] != ''))
     45{
     46  $player->Login($user, $pass);
     47  Menu();
     48} else
     49{
     50  Menu();
    4251}
    4352$html->PrgStop();
Note: See TracChangeset for help on using the changeset viewer.