36 |
if ($id > 0) $sql .= " AND (news.news_id = $id)"; |
if ($id > 0) $sql .= " AND (news.news_id = $id)"; |
37 |
if ($ct) $sql .= " AND ((category = '$ct') OR ((cat_news.cat_id = '$ct') AND (cat_news.news_id = news.news_id)))"; |
if ($ct) $sql .= " AND ((category = '$ct') OR ((cat_news.cat_id = '$ct') AND (cat_news.news_id = news.news_id)))"; |
38 |
if ($spec) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)"; |
if ($spec) $sql .= " AND (spec_news.news_id = news.news_id) AND (spec_news.spec_id = $spec)"; |
39 |
|
if ($limit && $isEdit) $sql .= ""; |
40 |
$sql .= " ORDER BY d_orig DESC"; |
$sql .= " ORDER BY d_orig DESC"; |
41 |
if ($limit) $sql .= " LIMIT $limit OFFSET $offset"; |
if ($limit && !$isEdit) $sql .= " LIMIT $limit"; |
42 |
|
if ($offset) $sql .= " OFFSET $offset"; |
43 |
$sth = $dbh->prepare($sql); |
$sth = $dbh->prepare($sql); |
44 |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
45 |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
101 |
$tpl->assign("titlepic_width", $art["pic_w"]); |
$tpl->assign("titlepic_width", $art["pic_w"]); |
102 |
$tpl->assign("titlepic_height", $art["pic_h"]); |
$tpl->assign("titlepic_height", $art["pic_h"]); |
103 |
$tpl->assign("date", $art["date"] ? strftime("%d.%m.%Y.", strtotime($art["date"])) : ""); |
$tpl->assign("date", $art["date"] ? strftime("%d.%m.%Y.", strtotime($art["date"])) : ""); |
|
include_once("author.php"); |
|
104 |
$tpl->assign("AUTHOR", GetAuthor($art["au_pic"], |
$tpl->assign("AUTHOR", GetAuthor($art["au_pic"], |
105 |
$art["au_alt"], $art["au_info"], |
$art["au_alt"], $art["au_info"], |
106 |
$art["au_w"], $art["au_h"])); |
$art["au_w"], $art["au_h"])); |
118 |
$tpl->assign("cat", $art["category"]); |
$tpl->assign("cat", $art["category"]); |
119 |
$tpl->assign("acat", $acat); |
$tpl->assign("acat", $acat); |
120 |
$tpl->assign("acat2", $acat2); |
$tpl->assign("acat2", $acat2); |
121 |
|
$tpl->assign("pgfs", count($art["text"])); |
122 |
global $PATH; |
global $PATH; |
123 |
if (is_array($PATH)) array_push($PATH, |
if (is_array($PATH)) array_push($PATH, |
124 |
MyUpper(MyEscape(convert_html($art["title"])))); |
MyUpper(MyEscape(convert_html($art["title"])))); |