Changeset 462 for branches/beta/inc/html.php
- Timestamp:
- Mar 1, 2009, 3:42:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/beta/inc/html.php
r461 r462 62 62 <meta name=\"keywords\" content=\"".$this->CfgChck("keywords")."\" /> 63 63 <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/style.css\" /> 64 <script type=\"text/javascript\" src=\"styles/global.js\"></script>65 64 <!--[if IE]><link rel=\"stylesheet\" type=\"text/css\" href=\"styles/ie.css\" /><![endif]--> 66 65 </head> … … 208 207 public function ShowNews ($kategorie) 209 208 { 210 global $db_webu;211 212 209 if ($kategorie == "all") 213 210 { … … 218 215 $where = "WHERE `category` = '".$kategorie."'"; 219 216 } 220 mysql_connect($db_server, $db_user, $db_pass); 221 mysql_select_db($db_webu); 222 $limit = 5; 223 224 225 $pocet = mysql_num_rows(mysql_query("SELECT id FROM `articles`".$where."ORDER BY `date` DESC;")); 226 $offset = ($_GET["offset"] ? $_GET["offset"] : $pocet); 227 228 if ($pocet != 0) 229 { 230 mysql_query("SET NAMES 'utf8'"); 231 $result = mysql_query("SELECT * FROM articles $where ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . ($pocet - $offset)); 232 while($row = mysql_fetch_array($result)){ 233 switch ($row["category"]) 217 $this -> db -> select_db($db_webu); 218 $sql = $this -> db -> query("SELECT * FROM `articles`".$where."ORDER BY `date` DESC;"); 219 if ($sql -> num_rows > 0) 220 { 221 // TODO !! 222 while ($row = $sql -> fetch_array()) 223 { 224 switch ($row["category"]) 234 225 { 235 226 case 1: … … 267 258 <tr> 268 259 <td>Sekce : <a href=\"?page=".$link."\">".$cat."</a></td> 269 <td> ".$row["autor"]."</td>260 <td>Zork</td> 270 261 </tr> 271 262 </table> 272 263 <br /> 273 264 "; 274 } 275 if ($offset < $pocet) { 276 echo "<a href='$_SERVER[PHP_SELF]" . ($offset + $limit < $pocet ? "?offset=" . ($offset + $limit) : "") . "'>zpět</a>\n"; 277 } 278 if ($offset > $limit) { 279 echo "<a href='$_SERVER[PHP_SELF]?offset=" . ($offset - $limit) . "'>vpřed</a>\n"; 280 } 281 282 283 284 285 286 265 } 287 266 } 288 267 else
Note:
See TracChangeset
for help on using the changeset viewer.