Changeset 380
- Timestamp:
- Sep 23, 2008, 7:40:43 AM (16 years ago)
- Location:
- beta
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
beta/inc/player.php
r373 r380 3 3 var $SessionTimeout = 30; 4 4 private $db; 5 // -- 5 // -- done 6 6 function __construct ($db) 7 7 { 8 8 $this -> db = &$db; 9 9 } 10 // -- 10 // -- done 11 11 private function Msg($text,$err) 12 12 { … … 20 20 } 21 21 } 22 // -- 22 // -- err 23 23 public function Register ($acc_name , $pass , $email , $tbc) 24 24 { … … 30 30 $sql = $this -> db -> query(" 31 31 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'); 33 33 "); 34 34 $this -> Msg ("Účet založen úspěšně",0); … … 42 42 43 43 } 44 // -- 44 // -- done 45 45 public function Login ($username,$pass) 46 46 { … … 62 62 } 63 63 } 64 // -- 64 // -- done 65 65 public function Logout () 66 66 { … … 70 70 $this -> Recall(1); 71 71 } 72 // -- 72 // -- done 73 73 public function Check () 74 74 { … … 82 82 return($_SESSION["UserId"] != 0); 83 83 } 84 // -- 84 // -- done 85 85 public function LoginForm() 86 86 { … … 112 112 return $row["level"]; 113 113 } 114 // -- 114 // -- done 115 115 public function GetGmLvl () 116 116 { … … 120 120 return $row["gmlevel"]; 121 121 } 122 // -- 122 // -- done 123 123 public function GetPlayerClass($id) 124 124 { … … 156 156 } 157 157 } 158 // -- 158 // -- done 159 159 public function GetPlayerRace($id) 160 160 { … … 198 198 } 199 199 } 200 // -- 200 // -- done 201 201 public function ResetXP ($guid) 202 202 { … … 218 218 {$this -> Msg ("Tato postava není vaše.",1);} 219 219 } 220 // -- 220 // -- done 221 221 public function ResetPosition ($guid) 222 222 { … … 248 248 {$this -> Msg ("Tato postava není vaše.",1);} 249 249 } 250 // -- 250 // -- done 251 251 public function IsOnline ($guid) 252 252 { -
beta/inc/server.php
r377 r380 5 5 { 6 6 $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; 7 18 } 8 19 // -- … … 78 89 $row = $this -> db -> query("SELECT COUNT(*) FROM account") -> fetch_array(); 79 90 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");104 91 } 105 92 // -- … … 141 128 else 142 129 {$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]); 148 131 echo " 149 132 <tr> … … 163 146 $edited = str_replace(")", "", $edited); 164 147 $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]); 172 149 echo " 173 150 <tr> … … 189 166 $edited_arr = explode(";",$edited); 190 167 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]); 196 169 echo " 197 170 <tr>
Note:
See TracChangeset
for help on using the changeset viewer.