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