- Timestamp:
- May 7, 2009, 9:15:17 AM (16 years ago)
- Location:
- trunk/inc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/html.php
r578 r583 195 195 public function ShowNews($kategorie) 196 196 { 197 include('inc/db.php'); 198 global $db_webu; 197 global $Config; 199 198 200 199 echo('<table class="NewsCategoryTable">'. … … 208 207 $this->QuickNew(); 209 208 210 if($kategorie == "all")211 { 212 $where = " ";213 } else 214 { 215 $where = "WHERE `category` = '".$kategorie."'";209 if($kategorie == 'all') 210 { 211 $where = ''; 212 } else 213 { 214 $where = 'WHERE `category` = "'.$kategorie.'"'; 216 215 } 217 216 218 mysql_connect($db_server, $db_user, $db_pass); 219 mysql_select_db($db_webu); 217 $this->db->select_db($Config['Database']['Database']); 220 218 $limit = 5; 221 219 222 $pocet = mysql_num_rows(mysql_query("SELECT id FROM `articles`".$where."ORDER BY `date` DESC;")); 223 $offset = (isset($_GET["offset"]) ? $_GET["offset"] : $pocet); 220 $DbResult = $this->db->query('SELECT id FROM `articles` '.$where.' ORDER BY `date` DESC;'); 221 $pocet = $DbResult->num_rows; 222 $offset = (isset($_GET['offset']) ? $_GET['offset'] : $pocet); 224 223 225 224 if($pocet != 0) 226 225 { 227 mysql_query('SET NAMES utf8'); 228 $result = mysql_query("SELECT * FROM articles $where ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . ($pocet - $offset)); 229 while($row = mysql_fetch_array($result)) 226 $result = $this->db->query('SELECT * FROM articles '.$where.' ORDER BY date DESC, id DESC LIMIT '.$limit.' OFFSET '.($pocet - $offset)); 227 while($row = $result->fetch_array()) 230 228 { 231 229 $row['text'] = str_replace('<br>', '<br />', $row['text']); 232 switch ($row["category"])230 switch($row['category']) 233 231 { 234 232 case 1: 235 $cat = "Server novinky";236 $link = "servernews";233 $cat = 'Server novinky'; 234 $link = 'servernews'; 237 235 break; 238 236 case 2: 239 $cat = "GM novinky";240 $link = "gmnews";237 $cat = 'GM novinky'; 238 $link = 'gmnews'; 241 239 break; 242 240 case 3: 243 $cat = "In-game novinky";244 $link = "gamenews";241 $cat = 'In-game novinky'; 242 $link = 'gamenews'; 245 243 break; 246 244 case 4: 247 $cat = "Články";248 $link = "articles";245 $cat = 'Články'; 246 $link = 'articles'; 249 247 break; 250 248 } … … 252 250 $date = explode('-', $date_arr[0]); 253 251 $time = mktime(0, 0, 0, $date[1], $date[2], $date[0]); 254 $human_date = date ("d.m.Y", $time);252 $human_date = date('d.m.Y', $time); 255 253 echo('<table class="NewsQuickInfoTable">'. 256 254 '<tr>'. 257 '<td><strong>'.$row[ "title"].'</strong></td>'.255 '<td><strong>'.$row['title'].'</strong></td>'. 258 256 '<td style="width: 100px">'.$human_date.'</td>'. 259 257 '</tr>'. 260 258 '<tr>'. 261 '<td colspan="2">'.$row[ "text"].'</td>'.259 '<td colspan="2">'.$row['text'].'</td>'. 262 260 '</tr>'. 263 261 '<tr>'. … … 271 269 if($offset < $pocet) 272 270 { 273 echo( "<a href='$_SERVER[PHP_SELF]" . ($offset + $limit < $pocet ? "?offset=" . ($offset + $limit) : "") . "'><-- novější</a>\n ");271 echo('<a href="'.$_SERVER['PHP_SELF'].($offset + $limit < $pocet ? '?offset='.($offset + $limit) : '').'"><-- novější</a>\n '); 274 272 } 275 273 if($offset > $limit) -
trunk/inc/player.php
r579 r583 86 86 <table> 87 87 <tr> 88 <td><b>Jméno : </b></td><td><input type="text" name="user" ></td>88 <td><b>Jméno : </b></td><td><input type="text" name="user" class="textinput"></td> 89 89 </tr> 90 90 <tr> 91 <td><b>Heslo : </b></td><td><input type="password" name="pass" autocomplete="off" ></td>91 <td><b>Heslo : </b></td><td><input type="password" name="pass" autocomplete="off" class="textinput"></td> 92 92 </tr> 93 93 <tr> … … 351 351 global $Config; 352 352 353 echo('<table >353 echo('<table class="BaseTable"> 354 354 <tr> 355 <th align="center">Jméno</th>356 <th align="center">Úroveň</th>357 <th align="center">Rasa</th>358 <th align="center">Třída</th>359 <th align="center">Nahráno</th>355 <th>Jméno</th> 356 <th>Úroveň</th> 357 <th>Rasa</th> 358 <th>Třída</th> 359 <th>Nahráno</th> 360 360 </tr>'); 361 361 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); … … 367 367 $gender = ($row['gender'] == 0) ? '0' : '1'; 368 368 echo('<tr>'. 369 '<td align="center">'.$row['name'].'</td>'.370 '<td align="center">'.$this->GetPlayerLvl($row['guid']).'</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>'.373 '<td align="center">'.round($row['totaltime'] / 3600).' h</td>'.369 '<td>'.$row['name'].'</td>'. 370 '<td>'.$this->GetPlayerLvl($row['guid']).'</td>'. 371 '<td><img src="imgs/icons/'.$row['race'].'-'.$gender.'.gif" alt="rasa" /></td>'. 372 '<td><img src="imgs/icons/'.$row['class'].'.gif" alt="trida" /></td>'. 373 '<td>'.round($row['totaltime'] / 3600).' h</td>'. 374 374 '</tr>'); 375 375 } -
trunk/inc/server.php
r558 r583 48 48 global $Config; 49 49 50 include('inc/db.php');51 50 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 52 51 $pocet = $this->db->query('SELECT `guid` FROM `characters` WHERE `online` = 1')->num_rows; … … 76 75 global $Config; 77 76 78 include('inc/db.php');79 77 $this->db->select_db($Config['Mangos']['DatabaseRealmd']); 80 78 $row = $this->db->query('SELECT `starttime`, `uptime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1') … … 88 86 global $Config; 89 87 90 include('inc/db.php');91 88 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 92 89 $row = $this->db->query('SELECT COUNT(*) FROM characters')->fetch_array(); … … 98 95 global $Config; 99 96 100 include('inc/db.php');101 97 $this->db->select_db($Config['Mangos']['DatabaseRealmd']); 102 98 $row = $this->db->query('SELECT COUNT(*) FROM account')->fetch_array(); … … 107 103 { 108 104 global $Config; 109 include('inc/db.php'); 105 110 106 $this->db->select_db($Config['Mangos']['DatabaseCharacters']); 111 107 $row = $this->db->query('SELECT `name` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1')->fetch_array();
Note:
See TracChangeset
for help on using the changeset viewer.