9 |
if ($del_id) { |
if ($del_id) { |
10 |
include_once("inc/newsDelete.php"); |
include_once("inc/newsDelete.php"); |
11 |
newsDelete($del_id); |
newsDelete($del_id); |
12 |
unset($top_edit, $wn_edit, $pn_edit); |
unset($top_edit); |
13 |
} |
} |
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 |
|
if ($flip_id) $dbh->dbh_do("UPDATE news SET prikazi = NOT prikazi WHERE (news_id = $flip_id)"); |
17 |
} |
} |
18 |
$cat = "c"; |
$cat = "c"; $acat = "s"; |
19 |
if ($section_menu == "zensko") $cat = "z"; |
if ($section_menu == "zensko") { $cat = "z"; $acat2 = "z"; } |
20 |
if ($section_menu == "musko") $cat = "m"; |
if ($section_menu == "musko") { $cat = "m"; $acat2 = "m"; } |
21 |
if ($section_menu == "mid") $cat = "d"; |
if ($section_menu == "mid") { $cat = "d"; $acat2 = "d"; } |
22 |
if ($section_menu == "treca") $cat = "r"; |
if ($section_menu == "treca") { $cat = "r"; $acat2 = "t"; } |
23 |
if ($section_menu == "mladi") $cat = "e"; |
if ($section_menu == "mladi") { $cat = "e"; $acat2 = "l"; } |
24 |
if ($section_menu == "ovisnosti") $cat = "o"; |
if ($section_menu == "ovisnosti") { $cat = "o"; $acat2 = "o"; } |
25 |
if (!$offset) $offset = 0; |
if (!$offset) $offset = 0; |
26 |
$empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0); |
$empty = array("category" => $cat, "limit" => 10, "offset" => $offset, "npar" => 0); |
27 |
if ($top_edit && $ed_id <= 0 && $isEdit) { |
if ($top_edit && $ed_id <= 0 && $isEdit) { |
28 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
29 |
$ed = newsEdit($empty, "top_edit"); |
$ed = newsEdit($empty, "top_edit"); |
30 |
if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed); |
31 |
else $top_edit = false; |
else $top_edit = false; |
32 |
} |
} |
33 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], 0, $empty["npar"]); |
34 |
|
$a2 = array(); |
35 |
|
for ($i = 0; $i < count($arts); $i++) { |
36 |
|
array_push($a2, array( |
37 |
|
"cat" => $empty["category"], |
38 |
|
"id" => $arts[$i]["id"], |
39 |
|
"title" => MyEscape($arts[$i]["title"]), |
40 |
|
"abs" => $offset ? true : false |
41 |
|
)); |
42 |
|
} |
43 |
|
$tpl->assign("MENU2", array( |
44 |
|
array("title" => "", "class" => "head", "pre" => "", "items" => $a2) |
45 |
|
)); |
46 |
|
$arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]); |
47 |
$a2 = array(); |
$a2 = array(); |
48 |
$lm = count($arts); |
$lm = count($arts); |
49 |
if ($lm > $empty["limit"]) $lm = $empty["limit"]; |
if ($lm > $empty["limit"]) $lm = $empty["limit"]; |
70 |
"titlepic_width" => $art["pic_w"], |
"titlepic_width" => $art["pic_w"], |
71 |
"titlepic_height" => $art["pic_h"], |
"titlepic_height" => $art["pic_h"], |
72 |
"text" => $art["text"], |
"text" => $art["text"], |
73 |
"links" => GetLinks($art["read"] && $art["id"], |
"links" => GetLinks((($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "", |
74 |
/* 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"] : "", */ "", |
75 |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
76 |
$isEdit, true, ($i > 0), ($i < count($arts) - 1)) |
true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]), |
77 |
|
"read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "" |
78 |
)); |
)); |
79 |
} |
} |
80 |
} |
} |
81 |
$tpl->assign("top", $a2); |
$tpl->assign("top", $a2); |
82 |
$tpl->assign("cat", $cat); |
$tpl->assign("cat", $cat); |
83 |
$tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0); |
$tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0); |
84 |
$tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false); |
$tpl->assign("prev", $offset ? ($offset - 10) : 0); |
85 |
|
$tpl->assign("offset", $offset); |
86 |
} |
} |
87 |
$dbh->disconnect(); |
$dbh->disconnect(); |
88 |
?> |
?> |