14 |
if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)"); |
if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)"); |
15 |
if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)"); |
if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)"); |
16 |
} |
} |
17 |
$cat = "c"; |
$cat = "c"; $acat = "s"; |
18 |
if ($section_menu == "zensko") $cat = "z"; |
if ($section_menu == "zensko") { $cat = "z"; $acat2 = "z"; } |
19 |
if ($section_menu == "musko") $cat = "m"; |
if ($section_menu == "musko") { $cat = "m"; $acat2 = "m"; } |
20 |
if ($section_menu == "mid") $cat = "d"; |
if ($section_menu == "mid") { $cat = "d"; $acat2 = "d"; } |
21 |
if ($section_menu == "treca") $cat = "r"; |
if ($section_menu == "treca") { $cat = "r"; $acat2 = "t"; } |
22 |
if ($section_menu == "mladi") $cat = "e"; |
if ($section_menu == "mladi") { $cat = "e"; $acat2 = "l"; } |
23 |
if ($section_menu == "ovisnosti") $cat = "o"; |
if ($section_menu == "ovisnosti") { $cat = "o"; $acat2 = "o"; } |
24 |
if (!$offset) $offset = 0; |
if (!$offset) $offset = 0; |
25 |
$empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0); |
$empty = array("category" => $cat, "limit" => 10, "offset" => $offset, "npar" => 0); |
26 |
if ($top_edit && $ed_id <= 0 && $isEdit) { |
if ($top_edit && $ed_id <= 0 && $isEdit) { |
27 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
28 |
$ed = newsEdit($empty, "top_edit"); |
$ed = newsEdit($empty, "top_edit"); |
29 |
if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed); |
30 |
else $top_edit = false; |
else $top_edit = false; |
31 |
} |
} |
32 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
$arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]); |
33 |
$a2 = array(); |
$a2 = array(); |
34 |
$lm = count($arts); |
$lm = count($arts); |
35 |
if ($lm > $empty["limit"]) $lm = $empty["limit"]; |
if ($lm > $empty["limit"]) $lm = $empty["limit"]; |
60 |
/* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "", |
/* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "", |
61 |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
62 |
$isEdit, true, ($i > 0), ($i < count($arts) - 1)), |
$isEdit, true, ($i > 0), ($i < count($arts) - 1)), |
63 |
"read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false |
"read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "" |
64 |
)); |
)); |
65 |
} |
} |
66 |
} |
} |
67 |
$tpl->assign("top", $a2); |
$tpl->assign("top", $a2); |
68 |
$tpl->assign("cat", $cat); |
$tpl->assign("cat", $cat); |
69 |
$tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0); |
$tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0); |
70 |
$tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false); |
$tpl->assign("prev", $offset ? ($offset - 10) : 0); |
71 |
|
$tpl->assign("offset", $offset); |
72 |
} |
} |
73 |
$dbh->disconnect(); |
$dbh->disconnect(); |
74 |
?> |
?> |