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 |
|
$section_menu = "main"; |
6 |
$arts = newsLoad($id, $cat); |
$arts = newsLoad($id, $cat); |
7 |
newsShow(array_shift($arts)); |
newsShow(array_shift($arts)); |
8 |
} else { |
} else { |
9 |
if ($del_id) { |
if ($isEdit) { |
10 |
include_once("inc/newsDelete.php"); |
if ($del_id) { |
11 |
newsDelete($del_id); |
include_once("inc/newsDelete.php"); |
12 |
unset($top_edit, $wn_edit, $pn_edit); |
newsDelete($del_id); |
13 |
|
unset($top_edit, $wn_edit, $pn_edit); |
14 |
|
} |
15 |
|
if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)"); |
16 |
|
if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)"); |
17 |
} |
} |
|
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)"); |
|
18 |
$cat = "c"; |
$cat = "c"; |
19 |
if ($section_menu == "zensko") $cat = "z"; |
if ($section_menu == "zensko") $cat = "z"; |
20 |
if ($section_menu == "musko") $cat = "m"; |
if ($section_menu == "musko") $cat = "m"; |
21 |
if ($section_menu == "majkadijete") $cat = "d"; |
if ($section_menu == "majkadijete") $cat = "d"; |
22 |
if ($section_menu == "treca") $cat = "r"; |
if ($section_menu == "treca") $cat = "r"; |
23 |
if ($section_menu == "teen") $cat = "e"; |
if ($section_menu == "mladi") $cat = "e"; |
24 |
|
if ($section_menu == "ovisnosti") $cat = "o"; |
25 |
if (!$offset) $offset = 0; |
if (!$offset) $offset = 0; |
26 |
$empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 1); |
$empty = array("category" => $cat, "limit" => 11, "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"); |
46 |
if ($ed && $ed["category"] == $cat) $art = $ed; |
if ($ed && $ed["category"] == $cat) $art = $ed; |
47 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
48 |
$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"); |
|
49 |
array_push($a2, array( |
array_push($a2, array( |
50 |
"id" => $art["id"], |
"id" => $art["id"], |
51 |
"title" => MyEscape($art["title"]), |
"title" => MyEscape($art["title"]), |
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 && $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 |
)); |
)); |
64 |
} |
} |
65 |
} |
} |