1 |
<?php |
<?php |
2 |
include_once("inc/conn.php"); |
include("inc/conn.php"); |
3 |
include_once("inc/newsShow.php"); |
include_once("inc/newsShow.php"); |
4 |
if ($show) { |
if ($show) { |
5 |
$arts = newsLoad($id, $cat); |
$arts = newsLoad($id, $cat); |
6 |
newsShow(array_shift($arts)); |
newsShow(array_shift($arts)); |
7 |
} else { |
} else { |
8 |
if ($del_id) { |
if ($isEdit) { |
9 |
include_once("inc/newsDelete.php"); |
if ($del_id) { |
10 |
newsDelete($del_id); |
include_once("inc/newsDelete.php"); |
11 |
unset($top_edit, $wn_edit, $pn_edit); |
newsDelete($del_id); |
12 |
|
unset($top_edit); |
13 |
|
} |
14 |
|
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)"); |
16 |
} |
} |
|
if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)"); |
|
|
if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)"); |
|
17 |
$cat = "c"; |
$cat = "c"; |
18 |
if ($section_menu == "zensko") $cat = "z"; |
if ($section_menu == "zensko") $cat = "z"; |
19 |
if ($section_menu == "musko") $cat = "m"; |
if ($section_menu == "musko") $cat = "m"; |
20 |
if ($section_menu == "majkadijete") $cat = "d"; |
if ($section_menu == "mid") $cat = "d"; |
21 |
if ($section_menu == "treca") $cat = "r"; |
if ($section_menu == "treca") $cat = "r"; |
22 |
if ($section_menu == "teen") $cat = "e"; |
if ($section_menu == "mladi") $cat = "e"; |
23 |
|
if ($section_menu == "ovisnosti") $cat = "o"; |
24 |
if (!$offset) $offset = 0; |
if (!$offset) $offset = 0; |
25 |
$empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 1); |
$empty = array("category" => $cat, "limit" => 11, "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"); |
45 |
if ($ed && $ed["category"] == $cat) $art = $ed; |
if ($ed && $ed["category"] == $cat) $art = $ed; |
46 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
47 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
|
include_once("inc/links.php"); |
|
48 |
array_push($a2, array( |
array_push($a2, array( |
49 |
"id" => $art["id"], |
"id" => $art["id"], |
50 |
"title" => MyEscape($art["title"]), |
"title" => MyEscape($art["title"]), |
51 |
"lead" => MyEscape($art["lead"]), |
"lead" => MyEscape($art["lead"]), |
52 |
|
"pgfs" => (count($art["text"]) > 0) ? true : false, |
53 |
"titlepic_url" => MyEscape($art["pic_url"]), |
"titlepic_url" => MyEscape($art["pic_url"]), |
54 |
"titlepic_alt" => MyEscape($art["pic_alt"]), |
"titlepic_alt" => MyEscape($art["pic_alt"]), |
55 |
"titlepic_type" => $art["pic_pos"], |
"titlepic_type" => $art["pic_pos"], |
57 |
"titlepic_height" => $art["pic_h"], |
"titlepic_height" => $art["pic_h"], |
58 |
"text" => $art["text"], |
"text" => $art["text"], |
59 |
"links" => GetLinks($art["read"] && $art["id"], |
"links" => GetLinks($art["read"] && $art["id"], |
60 |
MyEscape($art["more"]), MyEscape($art["more_title"]), |
/* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "", |
61 |
$art["id"], $empty["category"], "top", $isEdit, true, |
MyEscape($art["more_title"]), $art["id"], $empty["category"], "top", |
62 |
($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 |
64 |
)); |
)); |
65 |
} |
} |
66 |
} |
} |