--- inc/newsShow.php 2001/10/05 15:10:53 1.12 +++ inc/newsShow.php 2001/10/10 12:40:58 1.13 @@ -36,8 +36,10 @@ if ($id > 0) $sql .= " AND (news.news_id = $id)"; if ($ct) $sql .= " AND ((category = '$ct') OR ((cat_news.cat_id = '$ct') AND (cat_news.news_id = news.news_id)))"; if ($spec) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)"; + if ($limit && $isEdit) $sql .= ""; $sql .= " ORDER BY d_orig DESC"; - if ($limit) $sql .= " LIMIT $limit OFFSET $offset"; + if ($limit && !$isEdit) $sql .= " LIMIT $limit"; + if ($offset) $sql .= " OFFSET $offset"; $sth = $dbh->prepare($sql); if (!$sth) error("Cannot prepare query: \"$sql\""); if (!$sth->execute()) error("Cannot execute query: \"$sql\""); @@ -99,7 +101,6 @@ $tpl->assign("titlepic_width", $art["pic_w"]); $tpl->assign("titlepic_height", $art["pic_h"]); $tpl->assign("date", $art["date"] ? strftime("%d.%m.%Y.", strtotime($art["date"])) : ""); - include_once("author.php"); $tpl->assign("AUTHOR", GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"])); @@ -117,6 +118,7 @@ $tpl->assign("cat", $art["category"]); $tpl->assign("acat", $acat); $tpl->assign("acat2", $acat2); + $tpl->assign("pgfs", count($art["text"])); global $PATH; if (is_array($PATH)) array_push($PATH, MyUpper(MyEscape(convert_html($art["title"]))));