Changeset 579 for trunk


Ignore:
Timestamp:
Apr 30, 2009, 8:10:25 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Doplněny ikony pro povolání death knight a soubory přejmenovány dle minimanageru.
  • Upraveno: Přeformátování a pročištění různých stránek.
Location:
trunk
Files:
30 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/player.php

    r578 r579  
    365365    while($row = $sql->fetch_array())
    366366    {
    367       $gender = ($row['gender'] == 0) ? 'm' : 'f';
     367      $gender = ($row['gender'] == 0) ? '0' : '1';
    368368      echo('<tr>'.
    369369        '<td align="center">'.$row['name'].'</td>'.
    370370        '<td align="center">'.$this->GetPlayerLvl($row['guid']).'</td>'.
    371         '<td align="center"><img src="imgs/icons/'.$this->GetPlayerRace($row['race']).'-'.$gender.'.gif"></td>'.
    372         '<td align="center"><img src="imgs/icons/'.$this->GetPlayerClass($row['class']).'.gif"</td>'.
     371        '<td align="center"><img src="imgs/icons/'.$row['race'].'-'.$gender.'.gif"></td>'.
     372        '<td align="center"><img src="imgs/icons/'.$row['class'].'.gif"</td>'.
    373373        '<td align="center">'.round($row['totaltime'] / 3600).' h</td>'.
    374374        '</tr>');
  • trunk/pages/banacc.php

    r561 r579  
    1 <?
    2 include("inc/db.php");
     1<?php
    32
    4 mysql_connect("$db_server", "$db_user", "$db_pass");
    5 mysql_select_db("$db_realmd");
     3$db->select_db($Config['Mangos']['DatabaseRealmd']);
    64
    7 if(array_key_exists("jmeno", $_POST))
     5if(array_key_exists('jmeno', $_POST))
    86{
     7  $name = $_POST['jmeno'];
    98
    10 $name = addslashes($_POST["jmeno"] );
     9  $str = $db->query('select * from `account` inner join `account_banned` on `account`.`id` = `account_banned`.`id` where `username` = "'.$name.'"');
     10  $str_end = $str->fetch_assoc();
    1111
    12 $str=mysql_query("select * from `account` inner join `account_banned` on `account`.`id` = `account_banned`.`id` where `username` = '$name'");
    13 $str_end=mysql_fetch_array($str);
    14 
    15 if($str_end['id']== ""){
    16 
    17 echo "<center><font color=\"blue\" face=\"verdana\" size=\"2\">tento ucet <span style=\"color: red\">neni</span> zabanovan</font></center>";
    18 
    19 } else {
    20 
    21 $reason=$str_end['banreason'];
    22 echo "<center><font color=\"blue\" face=\"verdana\" size=\"2\">ucet: <span style=\"color: red\">$name</span> je zabanovan, duvod: <span style=\"color: red\">$reason</span></font></center>";
    23 
    24 }
     12  if($str_end['id'] == '')
     13  {
     14    echo('<center><font color="blue" face="verdana" size="2">tento účet <span style="color: red">není</span> zabanován</font></center>');
     15  } else
     16  {
     17    $reason = $str_end['banreason'];
     18    echo('<center><font color="blue" face="verdana" size="2">účet: <span style="color: red">'.$name.'</span> je zabanován, důvod: <span style="color: red">'.$reason.'</span></font></center>');
     19  }
    2520}
    2621
    27 mysql_close();
    2822?>
  • trunk/pages/banip.php

    r561 r579  
    1 <?
    2 include("inc/db.php");
     1<?php
    32
    4 mysql_connect("$db_server", "$db_user", "$db_pass");
    5 mysql_select_db("$db_realmd");
     3$db->select_db($Config['Mangos']['DatabaseRealmd']);
    64
    7 if(array_key_exists("ip", $_POST))
     5if(array_key_exists('ip', $_POST))
    86{
     7  $ipcko = $_POST['ip'];
    98
    10 $ipcko = addslashes($_POST["ip"] );
     9  $str = $db->query('select `banreason` from `ip_banned` where `ip` = "'.$ipcko.'"');
     10  $str_end = $str->fetch_assoc();
    1111
    12 $str=mysql_query("select `banreason` from `ip_banned` where `ip` = '$ipcko'");
    13 $str_end=mysql_fetch_array($str);
    14 
    15 if($str_end['banreason']== ""){
    16 
    17 echo "<center><font color=\"blue\" face=\"verdana\" size=\"2\">tato ip adresa <span style=\"color: red\">neni</span> zabanovana</font></center>";
    18 
    19 } else {
    20 
    21 $reason=$str_end['banreason'];
    22 echo "<center><font color=\"blue\" face=\"verdana\" size=\"2\">ip adresa: <span style=\"color: red\">$ipcko</span> je zabanovana, duvod: <span style=\"color: red\">$reason</span></font></center>";
    23 
    24 }
     12  if($str_end['banreason'] == '')
     13  {
     14    echo('<center><font color="blue" face="verdana" size="2">tato IP adresa <span style=\"color: red\">neni</span> zabanovaná</font></center>');
     15  } else
     16  {
     17    $reason = $str_end['banreason'];
     18    echo('<center><font color="blue" face="verdana" size="2">IP adresa: <span style="color: red">'.$ipcko.'</span> je zabanovaná, důvod: <span style="color: red">'.$reason.'</span></font></center>');
     19  }
    2520}
    2621
    27 mysql_close();
    2822?>
  • trunk/pages/banlist.php

    r561 r579  
    1 <center><table border="0">
    2 <tr><td><center><font color="green" face="verdana" size="3"><b>Kontrola ip adresy</b></font></center></td></tr>
    3 <tr><td><center><font color="blue" face="verdana" size="1">zadejte prosim vasi IP adresu</font></center></td></tr>
     1<?php
     2
     3echo('<center><table border="0">
     4<tr><td><center><font color="green" face="verdana" size="3"><b>Kontrola IP adresy</b></font></center></td></tr>
     5<tr><td><center><font color="blue" face="verdana" size="1">Zadejte prosím vaší IP adresu</font></center></td></tr>
    46<tr><td><form action="?page=banip" method="post"><input type="text" name="ip" value="127.0.0.1"><input type="submit" name="odeslat" value="zkontroluj"></form></td></tr>
    5 <tr><td><center><?
    6 $ipcko = getenv ("REMOTE_ADDR");
    7 if ($ipcko != false) {
    8     echo "<font color=\"red\" size=\"1\" face=\"verdana\">Vaše IP adresa je: $ipcko</font>";
     7<tr><td><center>');
     8
     9$ipcko = getenv('REMOTE_ADDR');
     10if($ipcko != false)
     11{
     12  echo('<font color="red" size="1" face="verdana">Vaše IP adresa je: '.$ipcko.'</font>');
    913}
    10 ?></center></td></tr>
     14
     15echo('</center></td></tr>
    1116</table></center>
    1217<br />
    1318<center><table border="0">
    14 <tr><td><center><font color="green" face="verdana" size="3"><b>Kontrola accountu</b></font></center></td></tr>
    15 <tr><td><center><font color="blue" face="verdana" size="1">zadejte prosim jmeno accountu</font></center></td></tr>
     19<tr><td><center><font color="green" face="verdana" size="3"><b>Kontrola účtu</b></font></center></td></tr>
     20<tr><td><center><font color="blue" face="verdana" size="1">Zadejte prosím jméno účtu</font></center></td></tr>
    1621<tr><td><form action="?page=banacc" method="post"><input type="text" name="jmeno" value="name"><input type="submit" name="odeslat" value="zkontroluj"></form></td></tr>
    1722</table></center>
    18 <center><font face="verdana" size="1" color="red">vas <span style="color: red">predpokladany</span> account je:
    19 <?
     23<center><font face="verdana" size="1" color="red">váš <span style="color: red">předpokládaný</span> účet je:');
    2024
    21 mysql_connect("$db_server","$db_user","$db_pass");
    22 mysql_select_db("$db_realmd");
    2325
    24 $str=mysql_query("select * from `account` where `last_ip` = '$ipcko' order by `last_login` desc limit 3");
    25 while($str_end=MySQL_Fetch_Array($str)){
    26 $i=$str_end["username"];
    27 echo "$i, ";
     26$db->select_db($Config['Mangos']['DatabaseRealmd']);
     27
     28$DbResult = $db->query('select * from `account` where `last_ip` = "'.$ipcko.'" order by `last_login` desc limit 3');
     29while($DbRow = $DbResult->fetch_assoc())
     30{
     31  $i = $$DbRow['username'];
     32  echo($i.', ');
    2833}
    2934
    30 ?>
    31 </font></center>
    32 <br><center>
    33 <h2>Ban List</h2>
    34 <?php
    35 mysql_connect("$db_server","$db_user","$db_pass");
    36 mysql_select_db("$db_realmd");
     35echo('</font></center>
     36<br /><center>
     37<h2>Seznam banů</h2>');
    3738
    38 $sqldata = mysql_query("SELECT `account`.`last_ip`,`ip_banned`.`bandate`,`ip_banned`.`unbandate`,`ip_banned`.`bannedby`,`ip_banned`.`banreason` FROM `account` INNER join `ip_banned` ON `account`.`last_ip`=`ip_banned`.`ip`");
     39$sqldata = $db->query('SELECT `account`.`last_ip`,`ip_banned`.`bandate`,`ip_banned`.`unbandate`,`ip_banned`.`bannedby`,`ip_banned`.`banreason` FROM `account` INNER join `ip_banned` ON `account`.`last_ip`=`ip_banned`.`ip`');
    3940
    40 echo "<table border=1>";
    41 echo "<tr><th>IP</th><th>Od</th><th>Do</th><th>Banoval</th><th>Důvod</th></tr>";
     41echo('<table border="1">');
     42echo('<tr><th>IP</th><th>Od</th><th>Do</th><th>Banoval</th><th>Důvod</th></tr>');
    4243
    43 while($row = mysql_fetch_array($sqldata))
    44 
     44while($row = $sqldata->fetch_assoc())
    4545{
    46 
    47    $start = Date('d-m-Y H:i:s',$row[bandate]);
    48    $end = Date('d-m-Y H:i:s',$row[unbandate]);
     46  $start = Date('d-m-Y H:i:s', $row['bandate']);
     47  $end = Date('d-m-Y H:i:s', $row['unbandate']);
    4948 
    50 
    51    echo "<tr><td>$row[last_ip]</td> <td>$start</td> <td>$end</td> <td>$row[bannedby]</td><td>$row[banreason]</td></tr>";
    52 
     49  echo('<tr><td>'.$row['last_ip'].'</td><td>'.$start.'</td><td>'.$end.'</td><td>'.$row['bannedby'].'</td><td>'.$row['banreason'].'</td></tr>');
    5350}
    54 
    55 echo "</table>";
     51echo('</table>');
    5652
    5753?>
  • trunk/pages/dontwork.php

    r405 r579  
    11<?php
    22
    3 echo "<br /><br /><center><img src=\"imgs/zajic.png\"><br /><font size=\"4\">Stránka mimo provoz , omluvte problémy.</font></center>";
    4 $player -> Recall(2);
     3echo('<br /><br /><center><img src="imgs/zajic.png"><br /><font size="4">Stránka mimo provoz, omluvte problémy.</font></center>');
     4$player->Recall(2);
     5
    56?>
  • trunk/pages/guilda.php

    r577 r579  
    5454  while($member = $members->fetch_row())
    5555  {   
    56     $query = $db->query("SELECT `race`,`class`,`online`, `account`, `logout_time`, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, ' ', ".$Config['Mangos']['CharacterDataOffset']['Level']."+1), ' ', -1) AS level, mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".($Config['Mangos']['CharacterDataOffset']['Gender'] + 1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender FROM `characters` WHERE `guid` = '".$member[0]."' LIMIT 1;");
    57     $online = $query -> fetch_array();
    58           $accid = $online["account"];
    59           $llogin = count_days($online["logout_time"], time());
     56    $query = $db->query('SELECT `race`,`class`,`online`, `account`, `logout_time`, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS level, mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.($Config['Mangos']['CharacterDataOffset']['Gender'] + 1).'), " ", -1) as unsigned) ), 8, 0), 4, 1) as gender FROM `characters` WHERE `guid` = '.$member[0].' LIMIT 1;');
     57    $online = $query->fetch_assoc();
     58          $accid = $online['account'];
     59          $llogin = count_days($online['logout_time'], time());
    6060        if($llogin < 1)
    6161        {
     
    8686                $lastlogin = '<font color="#8000FF">'.$llogin.'</font>';
    8787        }
    88         $level = $online["level"];
     88        $level = $online['level'];
    8989        if($level > 0)
    9090                {
     
    123123                        $lev = '<font color="#FFF000">'.$level.'</font>';
    124124                }
    125                 if ($online[6] == 0)
    126                 {
    127                  $gender = "m";
    128     }
    129     else
    130     {
    131       $gender = "f";
    132     }
    133     echo "
    134     <tr>
    135       <td align=\"center\">".$member[2]."</td>
    136       <td align=\"center\"><img src=\"imgs/icons/".$player -> GetPlayerRace($online["race"])."-".$gender.".gif\"></td>
    137       <td align=\"center\"><img src=\"imgs/icons/".$player -> GetPlayerClass($online["class"]).".gif\"></td>
    138       <td align=\"center\">".$lev."</td>
    139       <td align=\"center\">".$member[4]." (".$member[1].")</td>
    140       <td align=\"center\">".$lastlogin."</td>
    141       <td align=\"center\">".(($online["online"]) ? "<img src=\"imgs/inc/on.gif\" alt=\"\" />" : "<img src=\"imgs/inc/off.gif\" alt=\"\" />")."</td>     
    142     </td>
    143     ";
     125                if($online[6] == 0) $gender = '0';
     126    else $gender = '1';
     127    echo('<tr>'.
     128      '<td align="center">'.$member[2].'</td>'.
     129      '<td align="center"><img src="imgs/icons/'.$online['race'].'-'.$gender.'.gif"></td>'.
     130      '<td align="center"><img src="imgs/icons/'.$online['class'].'.gif"></td>'.
     131      '<td align="center">'.$lev.'</td>'.
     132      '<td align="center">'.$member[4].' ('.$member[1].')</td>'.
     133      '<td align="center">'.$lastlogin.'</td>'.
     134      '<td align="center">'.(($online['online']) ? '<img src="imgs/inc/on.gif" alt="online" />' : '<img src="imgs/inc/off.gif" alt="offline" />').'</td></td>');
    144135  }
    145136  echo('</table>');
  • trunk/pages/online.php

    r577 r579  
    4545  $aliance = array(1, 3, 4, 7, 11);
    4646  $frakce = (in_array($row['race'], $aliance)) ? '<img src="imgs/inc/a.gif" alt="aliance"/>' : '<img src="imgs/inc/h.gif" alt="horda" />';
    47   $gender = ($row['gender'] == 0) ? 'm' : 'f';
     47  $gender = ($row['gender'] == 0) ? '0' : '1';
    4848  echo('<tr>
    4949      <td align="center">'.$frakce.'</td>
    5050      <td align="center">'.$row['name'].'</td>
    51       <td align="center"><img src="imgs/icons/'.$player->GetPlayerRace($row['race']).'-'.$gender.'.gif" alt="rasa" /></td>
    52       <td align="center"><img src="imgs/icons/'.$player->GetPlayerClass($row['class']).'.gif" alt="třída" /></td>
     51      <td align="center"><img src="imgs/icons/'.$row['race'].'-'.$gender.'.gif" alt="rasa" /></td>
     52      <td align="center"><img src="imgs/icons/'.$row['class'].'.gif" alt="třída" /></td>
    5353      <td align="center">'.$row['level'].'</td>
    5454      <td align="center">'.$server->MapName($row['map']).'<br />('.$server->ZoneName($row['zone']).')</td>
  • trunk/pages/register.php

    r576 r579  
    88}
    99
     10if(array_key_exists('account', $_POST)) $account = $_POST['account']; else $account = '';
     11if(array_key_exists('heslo1', $_POST)) $password1 = $_POST['heslo1']; else $password1 = '';
     12if(array_key_exists('heslo2', $_POST)) $password2 = $_POST['heslo2']; else $password2 = '';
     13if(array_key_exists('email', $_POST)) $email = $_POST['email']; else $email = '';
     14if(array_key_exists('expansion', $_POST)) $expansion = $_POST['expansion']; else $expansion = '';
     15if(array_key_exists('agree', $_POST)) $agree = $_POST['agree']; else $agree = '';
     16
    1017echo('<div style="margin-left:auto; margin-right:auto; text-align:center; align: center;">'.
    1118  '<div style="margin-left:auto; margin-right:auto; text-align:center; align: center;">'.
     
    1320  '<form method="post" action="?page=register">'.
    1421  '<table style="margin-left:auto; margin-right:auto; text-align:center;">'.
    15   '<tr><td>Účet:</td><td><input type="text" name="account" value="'.$_POST['account'].'"/></td></tr>'.
    16   '<tr><td>Heslo:</td><td><input type="password" name="heslo1" value="'.$_POST['heslo1'].'"/></td></tr>'.
    17   '<tr><td>Heslo znovu:</td><td><input type="password" name="heslo2" value="'.$_POST['heslo2'].'"/></td></tr>'.
    18   '<tr><td>Email:</td><td><input type="text" name="email" value="'.$_POST['email'].'"/></td></tr>'.
    19   '<tr><td>Typ účtu:</td><td><select name="expansion" value="'.$_POST['expansion'].'">'.
     22  '<tr><td>Účet:</td><td><input type="text" name="account" value="'.$account.'"/></td></tr>'.
     23  '<tr><td>Heslo:</td><td><input type="password" name="heslo1" value="'.$password1.'"/></td></tr>'.
     24  '<tr><td>Heslo znovu:</td><td><input type="password" name="heslo2" value="'.$password2.'"/></td></tr>'.
     25  '<tr><td>Email:</td><td><input type="text" name="email" value="'.$email.'"/></td></tr>'.
     26  '<tr><td>Typ účtu:</td><td><select name="expansion" value="'.$expansion.'">'.
    2027  '<option value="">-- vyber typ účtu --</option>'.
    2128  '<option value="0">Klasický</option>'.
     
    3744{
    3845  echo('<div class="h11">Registrace otevřeny</div>');
    39  
    40   $account = addslashes($_POST['account']);
    41   $password1 = addslashes($_POST['heslo1']);
    42   $password2 = addslashes($_POST['heslo2']);
    43   $email = addslashes($_POST['email']);
    44   $expansion = addslashes($_POST['expansion']);
    45   $agree = addslashes($_POST['agree']);
    46 
    4746  echo('<br />');
    4847
     
    5857      $account = strtoupper($account);
    5958      $heslo = sha_password($account, $password);
    60       $email = addslashes($_POST['email']);
    61       $expansion = addslashes($_POST['expansion']);
    6259
    6360      $DbResult = $db->query('SELECT `id`, `username`, `sha_pass_hash` FROM `account` WHERE `username`="'.$account.'"');
     
    6865      {       
    6966        $DbResult = $db->query('INSERT INTO `account` (`username`,`sha_pass_hash`,`email`,`expansion`) values ("'.$account.'","'.$heslo.'","'.$email.'","'.$expansion.'")');
     67        echo('INSERT INTO `account` (`username`,`sha_pass_hash`,`email`,`expansion`) values ("'.$account.'","'.$heslo.'","'.$email.'","'.$expansion.'")');
    7068        echo($db->error);               
    7169        echo('<div class="h10">Účet '.$account.' byl vytvořen!</div>');
  • trunk/pages/tickets.php

    r407 r579  
    11<?php
    2 echo "
    3   <table border=\"1\" width=\"555\">
     2
     3echo('<table border="1" width="555">
    44    <tr>
    55      <th>Podal</th>
     
    77      <th>Text</th>
    88      <th>Spravovat</th>
    9     </tr> 
    10 ";
    11 $db -> select_db($db_characters);
    12 $load_tickets = $db -> query("SELECT * FROM `character_ticket` ORDER BY `ticket_id` ASC;");
    13   while ($row = $load_tickets -> fetch_array())
    14   {
    15   $human_date = $server -> HumanDate ($row["ticket_lastchange"]);
    16   $player_name = $player -> GuidToCharName($row["guid"]);
    17   echo "
    18     <tr>
    19       <td align=\"center\">".$player_name."</td>
    20       <td align=\"center\">".$human_date."</td>
    21       <td><font size=\"2\">".$row["ticket_text"]."</font></td>
    22       <td align=\"center\"><a href=\"?ticket=".$row["ticket_id"]."\">Spravovat</a></td>
    23     </tr> 
    24   ";
    25   }
    26  echo "</table>";
    27 
     9    </tr>');
     10   
     11$db->select_db($Config['Mangos']['DatabaseCharacters']);
     12$load_tickets = $db->query('SELECT * FROM `character_ticket` ORDER BY `ticket_id` ASC');
     13while($row = $load_tickets->fetch_assoc())
     14{
     15  $human_date = $server->HumanDate($row['ticket_lastchange']);
     16  $player_name = $player->GuidToCharName($row['guid']);
     17  echo('<tr>
     18      <td align="center">'.$player_name.'</td>
     19      <td align="center">'.$human_date.'</td>
     20      <td><font size="2">'.$row['ticket_text'].'</font></td>
     21      <td align="center"><a href="?ticket='.$row['ticket_id'].'">Spravovat</a></td>
     22    </tr>');
     23}
     24echo('</table>');
    2825
    2926?>
  • trunk/pages/unstuck.php

    r438 r579  
    11<?php
    2 $html -> PrgStart();
    3 if ($player -> Check())
    4   {
    5 echo "
    6 &nbsp;<a href=\"?page=acc\">&lt;- Zpět do správy účtu</a>
     2
     3$html->PrgStart();
     4if($player->Check())
     5{
     6  echo('&nbsp;<a href="?page=acc">&lt;- Zpět do správy účtu</a>
    77<center><h3>Přemístění pozice vaší postavy</h3></center>
    8 <form method=\"post\">
    9 <table align=\"center\">
     8<form method="post">
     9<table align="center">
    1010  <tr>
    1111    <td>
    1212      Jméno postavy pro přemístění : </td>
    1313    <td>
    14       <input type=\"text\" name=\"char\"></td>
     14      <input type="text" name="char"></td>
    1515  </tr>
    1616  <tr>
    17     <td colspan=\"2\" align=\"right\">
    18       <input type=\"submit\" value=\"Resetovat\" name=\"unstuck\"></td>
     17    <td colspan="2" align="right">
     18      <input type="submit" value="Resetovat" name="unstuck"></td>
    1919  </tr>
    2020</table>
    21 </form>
    22 ";
    23 if (isset($_POST["unstuck"]) AND $_POST["char"] != "")
     21</form>');
     22
     23  if(isset($_POST['unstuck']) and $_POST['char'] != '')
     24  {
     25    $guid = $player->CharNameToGuid($_POST['char']);
     26    $player->ResetPosition($guid);
     27  }
     28} else
    2429{
    25 $guid = $player -> CharNameToGuid($_POST["char"]);
    26 $player -> ResetPosition($guid);
     30  $player->LoginForm();
    2731}
    28 }
    29 else
    30 {
    31 $player -> LoginForm();
    32 }
     32$html->PrgStop();
    3333
    34 $html -> PrgStop();
    3534?>
  • trunk/pages/webconfig.php

    r405 r579  
    11<?php
    2 $html -> PrgStart();
    3 echo "&nbsp;<a href=\"?page=acc\">&lt;- Zpět do správy účtu</a>";
     2$html->PrgStart();
     3echo('&nbsp;<a href="?page=acc">&lt;- Zpět do správy účtu</a>');
    44
    5 if (isset($_POST["save"]))
     5if(isset($_POST['save']))
    66{
    77  $year = 7 * 24 * 60 * 60;
    8   setcookie("hof-random",$_POST["random"],time()+$year);
    9   setcookie("hof-widget",$_POST["widget"],time()+$year);
    10   setcookie("hof-quick",$_POST["quick"],time()+$year);
    11   setcookie("hof-web",$_POST["web"],time()+$year);
    12   $msg = "<center><b>Ukládám změny.</b></center><br />
    13   <meta http-equiv=\"refresh\" content=\"1;url=?page=webconfig\">";
    14 }
    15 else
     8  setcookie('hof-random', $_POST['random'], time() + $year);
     9  setcookie('hof-widget', $_POST['widget'], time() + $year);
     10  setcookie('hof-quick', $_POST['quick'], time() + $year);
     11  setcookie('hof-web', $_POST['web'], time() + $year);
     12  $msg = '<center><b>Ukládám změny.</b></center><br />
     13  <meta http-equiv="refresh" content="1;url=?page=webconfig">';
     14} else
    1615{
    17   $msg = "";
     16  $msg = '';
    1817}
    1918
    20 
    21 function Check ($value,$option)
     19function Check($value, $option)
    2220{
    23   if (!isset($_COOKIE["hof-".$value]) OR $_COOKIE["hof-".$value] == "")
     21  if(!isset($_COOKIE['hof-'.$value]) or $_COOKIE['hof-'.$value] == '')
    2422  {
    2523    $day_half = 129600;
    26       // default
    27       switch ($value)
    28       {
    29       case "random":
    30           $default = "yes";
    31           break;
    32       case "widget":
    33           $default = "wowhead";
    34           break;
    35       case "quick":
    36           $default = "yes";
    37           break;
    38       case "web":
    39           $default = "2";
    40           break;
    41       }
     24    switch($value)
     25    {
     26      case 'random':
     27        $default = 'yes';
     28        break;
     29      case 'widget':
     30        $default = 'wowhead';
     31        break;
     32      case 'quick':
     33        $default = 'yes';
     34        break;
     35      case 'web':
     36        $default = 2;
     37        break;
     38    }
    4239    $year = 7 * 24 * 60 * 60;
    43     setcookie("hof-".$value,$default,time()+$year);
    44   $msg = "<center><b>Nahrávám základní nastavení</b></center><br />
    45   <meta http-equiv=\"refresh\" content=\"1;url=?page=webconfig\">";
     40    setcookie('hof-'.$value, $default, time() + $year);
     41    $msg = '<center><b>Nahrávám základní nastavení</b></center><br />
     42  <meta http-equiv="refresh" content="1;url=?page=webconfig">';
    4643  }
    47   if (isset($_COOKIE["hof-".$value]) AND $_COOKIE["hof-".$value] == $option)
     44  if(isset($_COOKIE['hof-'.$value]) and $_COOKIE['hof-'.$value] == $option)
    4845  {
    49     return " checked=\"checked\" ";
     46    return('checked="checked" ');
    5047  }
    5148}
    52 echo "
    53 <form method=\"post\">
    54 <div align=\"left\">
     49echo('<form method="post">
     50<div align="left">
    5551  <b>Náhodný obrázek v hlavičce stránky.</b><br />
    56   Ano <input type=\"radio\" name=\"random\" value=\"yes\"".Check("random","yes").">
    57   Ne <input type=\"radio\" name=\"random\" value=\"no\"".Check("random","no").">
     52  Ano <input type="radio" name="random" value="yes"'.Check('random', 'yes').'>
     53  Ne <input type="radio" name="random" value="no"'.Check('random','no').'>
    5854  <br />
    5955  <b>Preferovaný tooltip</b><br />
    60   Wowhead <input type=\"radio\" name=\"widget\" value=\"wowhead\"".Check("widget","wowhead").">
    61   Thottbot <input type=\"radio\" name=\"widget\" value=\"thottbot\"".Check("widget","thottbot").">
     56  Wowhead <input type="radio" name="widget" value="wowhead"'.Check('widget', 'wowhead').'>
     57  Thottbot <input type="radio" name="widget" value="thottbot"'.Check('widget', 'thottbot').'>
    6258  <br />
    6359  <b>Rychlý přehled</b><br />
    64   Ano <input type=\"radio\" name=\"quick\" value=\"yes\"".Check("quick","yes").">
    65   Ne <input type=\"radio\" name=\"quick\" value=\"no\"".Check("quick","no").">
     60  Ano <input type="radio" name="quick" value="yes"'.Check('quick', 'yes').'>
     61  Ne <input type="radio" name="quick" value="no"'.Check('quick', 'no').'>
    6662  <br />
    6763  <b>Zobrazovat web</b><br />
    68   Web 1.0 (původní menu vlevo) <input type=\"radio\" name=\"web\" value=\"1\"".Check("web","1")."><br />
    69   Web 2.0 (nový menu vpravo) <input type=\"radio\" name=\"web\" value=\"2\"".Check("web","2").">
     64  Web 1.0 (původní menu vlevo) <input type="radio" name="web" value="1"'.Check('web', 1).'><br />
     65  Web 2.0 (nový menu vpravo) <input type="radio" name="web" value="2"'.Check('web', 2).'>
     66<br />
     67<input type="submit" value="Uložit" name="save">
     68</form>'.$msg.'</div>');
    7069
     70$html->PrgStop();
    7171
    72 
    73 <br />
    74 <input type=\"submit\" value=\"Uložit\" name=\"save\">
    75 </form>
    76 
    77 ".$msg."
    78 </div>
    79 ";
    80 
    81 
    82 
    83 
    84 $html -> PrgStop();
    8572?>
  • trunk/rss.php

    r555 r579  
    11<?php
    22
    3 header("Content-Type: text/xml");
     3header('Content-Type: text/xml');
    44
    55include('inc/db.php');
     
    2929    $Config['Web']['Title'] .= ' - žádosti hráčů';
    3030    $db->select_db($Config['Mangos']['DatabaseCharacters']);
    31     $DbResult = $db->query("SELECT `character_ticket`.`ticket_text` AS `text`, `characters`.`name` AS `name` FROM `character_ticket` JOIN `characters` ON `characters`.`guid` = `character_ticket`.`guid`");
     31    $DbResult = $db->query('SELECT `character_ticket`.`ticket_text` AS `text`, `characters`.`name` AS `name` FROM `character_ticket` JOIN `characters` ON `characters`.`guid` = `character_ticket`.`guid`');
    3232    while($Row = $DbResult->fetch_array())
    3333    {
     
    4242  if($_GET['category'] == 'finance')
    4343  {
     44    $OperationType = array('consumption' => 'Spotřeba', 'contribution' => 'Příspěvek', 'buy' => 'Nákup', 'sell' => 'Prodej', 'internet' => 'Internet');
    4445    $Config['Web']['Title'] .= ' - finanční příspěvky';
    4546    $DbResult = $db->query('SELECT UNIX_TIMESTAMP(time), operation, description, money FROM finance ORDER BY time DESC LIMIT '.$NewsCount);
     
    5051        'Title' => $OperationType[$Row['operation']].' '.$Row['description'].' ('.$Row['money'].' Kč)',
    5152        'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'].'finance/',
    52         'Description' => $OperationType[$Row['operation']].' '.$Row['description']."<br>".$Row['money']." Kč",
     53        'Description' => $OperationType[$Row['operation']].' '.$Row['description'].'<br />'.$Row['money'].' Kč',
    5354        'Time' => $Row['UNIX_TIMESTAMP(time)'],
    5455      );
Note: See TracChangeset for help on using the changeset viewer.