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, $top2_edit, $wn_edit, $pn_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)"); |
if ($flip_id) $dbh->dbh_do("UPDATE news SET prikazi = NOT prikazi WHERE (news_id = $flip_id)"); |
17 |
} |
} |
18 |
|
$empty = array("category" => "3", "limit" => 1, "offset" => 0, "npar" => 0); |
19 |
|
if ($top2_edit && $ed_id <= 0 && $isEdit) { |
20 |
|
include_once("inc/newsEdit.php"); |
21 |
|
$ed = newsEdit($empty, "top2_edit"); |
22 |
|
if ($ed && is_string($ed)) $tpl->assign("EDIT2", $ed); |
23 |
|
else $top2_edit = false; |
24 |
|
} |
25 |
|
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
26 |
|
$ed = ""; |
27 |
|
$a2 = array(); |
28 |
|
for ($i = 0; $i < count($arts); $i++) { |
29 |
|
$art = $arts[$i]; |
30 |
|
$ed = ""; |
31 |
|
if ($top2_edit && ($art["id"] == $ed_id)) { |
32 |
|
include_once("inc/newsEdit.php"); |
33 |
|
$ed = newsEdit($art, "top2_edit"); |
34 |
|
} |
35 |
|
if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed)); |
36 |
|
else { |
37 |
|
if ($ed && $ed["category"] == $cat) $art = $ed; |
38 |
|
for ($j = 0; $j < count($art["text"]); $j++) |
39 |
|
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
40 |
|
$read = $art["read"]; |
41 |
|
if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : ""; |
42 |
|
if ($read && !$art["id"]) $read = ""; |
43 |
|
array_push($a2, array( |
44 |
|
"id" => $art["id"], |
45 |
|
"title" => MyEscape($art["title"]), |
46 |
|
"lead" => MyEscape($art["lead"]), |
47 |
|
"pgfs" => (count($art["text"]) > 0) ? true : false, |
48 |
|
"titlepic_url" => MyEscape($art["pic_url"]), |
49 |
|
"titlepic_alt" => MyEscape($art["pic_alt"]), |
50 |
|
"titlepic_type" => $art["pic_pos"], |
51 |
|
"titlepic_width" => $art["pic_w"], |
52 |
|
"titlepic_height" => $art["pic_h"], |
53 |
|
"text" => $art["text"], |
54 |
|
"links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "", |
55 |
|
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top2", |
56 |
|
true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]), |
57 |
|
"read" => $read, |
58 |
|
"AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], $art["au_cv"]) |
59 |
|
)); |
60 |
|
} |
61 |
|
} |
62 |
|
$tpl->assign("top2", $a2); |
63 |
$empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0); |
$empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0); |
64 |
if ($top_edit && $ed_id <= 0 && $isEdit) { |
if ($top_edit && $ed_id <= 0 && $isEdit) { |
65 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
82 |
if ($ed && $ed["category"] == $cat) $art = $ed; |
if ($ed && $ed["category"] == $cat) $art = $ed; |
83 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
84 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
85 |
|
$read = $art["read"]; |
86 |
|
if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : ""; |
87 |
|
if ($read && !$art["id"]) $read = ""; |
88 |
array_push($a2, array( |
array_push($a2, array( |
89 |
"id" => $art["id"], |
"id" => $art["id"], |
90 |
"title" => MyEscape($art["title"]), |
"title" => MyEscape($art["title"]), |
96 |
"titlepic_width" => $art["pic_w"], |
"titlepic_width" => $art["pic_w"], |
97 |
"titlepic_height" => $art["pic_h"], |
"titlepic_height" => $art["pic_h"], |
98 |
"text" => $art["text"], |
"text" => $art["text"], |
99 |
"links" => GetLinks((($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "", |
"links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "", |
|
/* MyEscape($art["more"]) */ /* ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "" */ "", |
|
100 |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
101 |
true, ($i > 0), ($i < count($arts) - 1), $art["show"]), |
true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]), |
102 |
"read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "", |
"read" => $read, |
103 |
"AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"]) |
"AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], $art["au_cv"]) |
104 |
)); |
)); |
105 |
} |
} |
106 |
} |
} |
131 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
132 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
133 |
list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]); |
list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]); |
134 |
|
$read = $art["read"]; |
135 |
|
if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : ""; |
136 |
|
if ($read && !$art["id"]) $read = ""; |
137 |
array_push($wn, array( |
array_push($wn, array( |
138 |
"id" => $art["id"], |
"id" => $art["id"], |
139 |
"title" => MyEscape($art["title"]), |
"title" => MyEscape($art["title"]), |
144 |
"pos" => MyEscape($art["pic_pos"]), |
"pos" => MyEscape($art["pic_pos"]), |
145 |
"width" => $art["pic_w"], |
"width" => $art["pic_w"], |
146 |
"height" => $art["pic_h"], |
"height" => $art["pic_h"], |
147 |
"links" => GetLinks((($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "", |
"links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "", |
148 |
/* MyEscape($art["more"]) */ "", MyEscape($art["more_title"]), |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "wn", true, |
149 |
$art["id"], $empty["category"], "wn", true, |
($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]), |
150 |
($i > 0), ($i < count($arts) - 1), $art["show"]), |
"read" => $read, |
|
"read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "", |
|
151 |
"text" => $art["text"] |
"text" => $art["text"] |
152 |
)); |
)); |
153 |
array_push($tmp2, array( |
array_push($tmp2, array( |
188 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
189 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
190 |
list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]); |
list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]); |
191 |
|
$read = $art["read"]; |
192 |
|
if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : ""; |
193 |
|
if ($read && !$art["id"]) $read = ""; |
194 |
array_push($pn, array( |
array_push($pn, array( |
195 |
"id" => $art["id"], |
"id" => $art["id"], |
196 |
"title" => MyEscape($art["title"]), |
"title" => MyEscape($art["title"]), |
201 |
"pos" => MyEscape($art["pic_pos"]), |
"pos" => MyEscape($art["pic_pos"]), |
202 |
"width" => MyEscape($art["pic_w"]), |
"width" => MyEscape($art["pic_w"]), |
203 |
"height" => MyEscape($art["pic_h"]), |
"height" => MyEscape($art["pic_h"]), |
204 |
"links" => GetLinks((($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "", |
"links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "", |
205 |
MyEscape($art["more"]), MyEscape($art["more_title"]), |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "pn", true, |
206 |
$art["id"], $empty["category"], "pn", true, |
($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]), |
207 |
($i > 0), ($i < count($arts) - 1), $art["show"]), |
"read" => $read, |
|
"read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "", |
|
208 |
"text" => MyEscape($art["text"]) |
"text" => MyEscape($art["text"]) |
209 |
)); |
)); |
210 |
array_push($tmp2, array( |
array_push($tmp2, array( |