Changeset 380


Ignore:
Timestamp:
Sep 23, 2008, 7:40:43 AM (16 years ago)
Author:
george
Message:
  • Přidáno: Stránka ticketů beta webu.
  • Přidáno: Export guild.
Location:
beta
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • beta/inc/player.php

    r373 r380  
    33  var $SessionTimeout = 30;
    44  private $db;
    5       // --
     5      // -- done
    66      function __construct ($db)
    77      {
    88        $this -> db = &$db;
    99      }
    10       // --
     10      // -- done
    1111      private function Msg($text,$err)
    1212      {
     
    2020        }
    2121      }
    22       // --
     22      // -- err
    2323      public function Register ($acc_name , $pass , $email , $tbc)
    2424      {
     
    3030          $sql = $this -> db -> query("
    3131          INSERT INTO `account` ( `id` , `username` , `sha_pass_hash` , `gmlevel` , `sessionkey` , `v` , `s` , `email` , `joindate` , `last_ip` , `failed_logins` , `locked` , `last_login` , `online` , `tbc` , `mutetime` , `locale` )
    32           VALUES (NULL , '".$acc_name."', '".$sha_pass."', '0', NULL , NULL , NULL , '".$email."',CURRENT_TIMESTAMP , '".$_SERVER['REMOTE_ADDR']."', '0', '0', '0000-00-00 00:00:00', '0', '".$tbc."', '0', '0'
     32          VALUES (NULL , '".$acc_name."', '".$sha_pass."', '0', NULL , NULL , NULL , '".$email."',CURRENT_TIMESTAMP , '".$_SERVER['REMOTE_ADDR']."', '0', '0', '0000-00-00 00:00:00', '0', '".$tbc."', '0', '0');
    3333          ");
    3434          $this -> Msg ("Účet založen úspěšně",0);
     
    4242     
    4343      }
    44       // --
     44      // -- done
    4545      public function Login ($username,$pass)
    4646      {
     
    6262        }
    6363      }
    64       // --
     64      // -- done
    6565      public function Logout ()
    6666      {
     
    7070        $this -> Recall(1);
    7171      }
    72       // --
     72      // -- done
    7373      public function Check ()
    7474      {
     
    8282        return($_SESSION["UserId"] != 0);
    8383      }
    84       // --
     84      // -- done
    8585      public function LoginForm()
    8686      {
     
    112112        return $row["level"];
    113113      }
    114       // --
     114      // -- done
    115115      public function GetGmLvl ()
    116116      {
     
    120120        return $row["gmlevel"];
    121121      }
    122       // --
     122      // -- done
    123123      public function GetPlayerClass($id)
    124124      {
     
    156156        }
    157157      }
    158       // --
     158      // -- done
    159159      public function GetPlayerRace($id)
    160160      {
     
    198198        }
    199199      }
    200       // --
     200      // -- done
    201201      public function ResetXP ($guid)
    202202      {
     
    218218        {$this -> Msg ("Tato postava není vaše.",1);}
    219219      }
    220       // --
     220      // -- done
    221221      public function ResetPosition ($guid)
    222222      {
     
    248248        {$this -> Msg ("Tato postava není vaše.",1);}
    249249      }
    250       // --
     250      // -- done
    251251      public function IsOnline ($guid)
    252252      {
  • beta/inc/server.php

    r377 r380  
    55      {
    66        $this -> db = $db;
     7      }
     8      // --
     9      public function HumanDate ($date)
     10      {
     11        // input date is 0000-00-00 00:00:00
     12        $date_arr = explode(" ",$date);
     13        $date = explode("-",$date_arr[0]);
     14        $time_stp = explode(":",$date_arr[1]);
     15        $time = mktime($time_stp[0],$time_stp[1],$time_stp[2],$date[1],$date[2],$date[0]);
     16        $human_date = date ("d.m.Y H:i:s",$time);
     17        return $human_date;
    718      }
    819      // --
     
    7889        $row = $this -> db -> query("SELECT COUNT(*) FROM account") -> fetch_array();
    7990        return($row[0]);
    80       }
    81       // --
    82       public function FindDrop ($item)
    83       {
    84         $this -> db -> select_db("mangos");
    85         $sql = $this -> db -> query("SELECT * FROM `creature_loot_template` WHERE `item` = '".$item."' ORDER BY ;");
    86         while ($row = $sql -> fetch_array())
    87         {
    88         echo "
    89               <table>
    90                 <tr>
    91                   <td>Šance</td>
    92                   <td></td>
    93                 </tr>
    94               </table>
    95         ";
    96         }
    97        
    98      
    99       }
    100       // --
    101       public function FindNpc ($npc)
    102       {
    103         $this -> db -> select_db("mangos");
    10491      }
    10592      // --
     
    141128            else
    142129            {$sel_name = "";}
    143               $date_arr = explode(" ",$edited_arr[0]);
    144               $date = explode("-",$date_arr[0]);
    145               $time_stp = explode(":",$date_arr[1]);
    146               $time = mktime($time_stp[0],$time_stp[1],$time_stp[2],$date[1],$date[2],$date[0]);
    147               $human_date = date ("d.m.Y H:i:s",$time);
     130              $human_date = $this -> HumanDate ($edited_arr[0]);
    148131           echo "
    149132          <tr>
     
    163146            $edited = str_replace(")", "", $edited);
    164147            $edited_arr = explode(";",$edited);
    165            
    166               $date_arr = explode(" ",$edited_arr[0]);
    167               $date = explode("-",$date_arr[0]);
    168               $time_stp = explode(":",$date_arr[1]);
    169               $time = mktime($time_stp[0],$time_stp[1],$time_stp[2],$date[1],$date[2],$date[0]);
    170               $human_date = date ("d.m.Y H:i:s",$time);
    171 
     148              $human_date = $this -> HumanDate ($edited_arr[0]);
    172149          echo "
    173150          <tr>
     
    189166            $edited_arr = explode(";",$edited);
    190167           
    191               $date_arr = explode(" ",$edited_arr[0]);
    192               $date = explode("-",$date_arr[0]);
    193               $time_stp = explode(":",$date_arr[1]);
    194               $time = mktime($time_stp[0],$time_stp[1],$time_stp[2],$date[1],$date[2],$date[0]);
    195               $human_date = date ("d.m.Y H:i:s",$time);
     168            $human_date = $this -> HumanDate ($edited_arr[0]);
    196169          echo "
    197170          <tr>
Note: See TracChangeset for help on using the changeset viewer.