Changeset 454 for branches/beta


Ignore:
Timestamp:
Mar 1, 2009, 2:39:01 PM (16 years ago)
Author:
amun
Message:

Stránkování novinek... (pokus číslo další..)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/beta/inc/html.php

    r453 r454  
    222222  $limit = 5;
    223223     
    224         $sql = mysql_query("SELECT SQL_CALC_FOUND_ROWS * FROM articles ".$where." ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . intval($_GET["offset"]);
    225                 $sql_pocet = mysql_query(mysql_num_rows("SELECT date FROM articles ".$where.);
    226         if ($sql_pocet > 0)
     224        $sql = mysql_query("SELECT * FROM articles $where ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . intval($_GET["offset"]);
     225                $pocet = mysql_query(mysql_num_rows("SELECT date FROM articles $where ");
     226        if ($pocet > 0)
    227227        {
    228228        // TODO !!
     
    274274                 
    275275
    276 $pocet = mysql_result(mysql_query(" SELECT FOUND_ROWS()"), 0);
     276
    277277if ($_GET["offset"]) {
    278278    echo "<a href='$_SERVER[PHP_SELF]" . ($_GET["offset"] != $limit ? "?offset=" . ($_GET["offset"] - $limit) : "") . "'>zpět</a>\n";
     
    283283
    284284$result = mysql_query("SELECT SQL_CALC_FOUND_ROWS * FROM articles ".$where." ORDER BY date DESC, id DESC LIMIT $limit OFFSET " . ($limit * $_GET["strana"]));
    285 $pocet = mysql_result(mysql_query(" SELECT FOUND_ROWS()"), 0);
     285
    286286if ($_GET["strana"]) {
    287287    echo "<a href='$_SERVER[PHP_SELF]" . ($_GET["strana"] != 1 ? "?strana=" . ($_GET["strana"] - 1) : "") . "'>zpět</a>\n";
Note: See TracChangeset for help on using the changeset viewer.