10 |
newsDelete($del_id); |
newsDelete($del_id); |
11 |
unset($top_edit, $wn_edit, $pn_edit); |
unset($top_edit, $wn_edit, $pn_edit); |
12 |
} |
} |
13 |
$empty = array("category" => "t", "limit" => 1, "npar" => 1); |
if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)"); |
14 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]); |
if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)"); |
15 |
|
$empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 1); |
16 |
|
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
17 |
$art = array_shift($arts); |
$art = array_shift($arts); |
18 |
$ed = ""; |
$ed = ""; |
19 |
if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) { |
if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) { |
22 |
} |
} |
23 |
if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed); |
24 |
else { |
else { |
25 |
if ($ed) $art = $ed; |
if ($ed && $ed["category"] == "t") $art = $ed; |
26 |
$tpl->assign("top_id", $art["id"]); |
$tpl->assign("top_id", $art["id"]); |
27 |
$tpl->assign("top_title", MyEscape($art["title"])); |
$tpl->assign("top_title", MyEscape($art["title"])); |
28 |
$tpl->assign("top_lead", MyEscape($art["lead"])); |
$tpl->assign("top_lead", MyEscape($art["lead"])); |
32 |
$tpl->assign("top_titlepic_width", $art["pic_w"]); |
$tpl->assign("top_titlepic_width", $art["pic_w"]); |
33 |
$tpl->assign("top_titlepic_height", $art["pic_h"]); |
$tpl->assign("top_titlepic_height", $art["pic_h"]); |
34 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
35 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"])); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
36 |
$tpl->assign("top_text", $art["text"]); |
$tpl->assign("top_text", $art["text"]); |
37 |
include_once("inc/links.php"); |
include_once("inc/links.php"); |
38 |
$tpl->assign("top_links", GetLinks($art["read"] && $art["id"], |
$tpl->assign("top_links", GetLinks($art["read"] && $art["id"], |
39 |
MyEscape($art["more"]), $art["id"], $empty["category"], "top")); |
MyEscape($art["more"]), MyEscape($art["more_title"]), |
40 |
|
$art["id"], $empty["category"], "top", $isEdit, |
41 |
|
false, false, false)); |
42 |
} |
} |
43 |
$empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "npar" => 0); |
$menu2 = array(); |
44 |
|
$empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "offset" => 0, "npar" => 0); |
45 |
|
$ed = ""; |
46 |
if ($wn_edit && $ed_id <= 0) { |
if ($wn_edit && $ed_id <= 0) { |
47 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
48 |
$ed = newsEdit($empty, "wn_edit"); |
$ed = newsEdit($empty, "wn_edit"); |
49 |
if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed); |
50 |
else $wn_edit = false; |
else $wn_edit = false; |
51 |
} |
} |
52 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]); |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
53 |
$wn = array(); |
$wn = array(); |
54 |
for ($i = 0; $i < count($arts); $i++) { |
for ($i = 0; $i < count($arts); $i++) { |
55 |
$art = $arts[$i]; |
$art = $arts[$i]; |
56 |
$ed = ""; |
$ed = ""; |
57 |
if ($wn_edit && $art["id"] == $ed_id) { |
if ($wn_edit && $art["id"] == $ed_id) { |
58 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
59 |
|
$art["nlimit"] = count($arts); |
60 |
$ed = newsEdit($art, "wn_edit"); |
$ed = newsEdit($art, "wn_edit"); |
61 |
} |
} |
62 |
if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed)); |
if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed)); |
63 |
else { |
else { |
64 |
if ($ed) $art = $ed; |
if ($ed && $ed["category"] == "w") $art = $ed; |
65 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
66 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"])); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
67 |
include_once("inc/links.php"); |
include_once("inc/links.php"); |
68 |
array_push($wn, array( |
array_push($wn, array( |
69 |
"id" => $art["id"], |
"id" => $art["id"], |
75 |
"width" => MyEscape($art["pic_w"]), |
"width" => MyEscape($art["pic_w"]), |
76 |
"height" => MyEscape($art["pic_h"]), |
"height" => MyEscape($art["pic_h"]), |
77 |
"links" => GetLinks($art["read"] && $art["id"], |
"links" => GetLinks($art["read"] && $art["id"], |
78 |
MyEscape($art["more"]), $art["id"], |
MyEscape($art["more"]), MyEscape($art["more_title"]), |
79 |
$empty["category"], "wn"), |
$art["id"], $empty["category"], "wn", $isEdit, true, |
80 |
|
($i > 0), ($i < count($arts) - 1)), |
81 |
"text" => $art["text"] |
"text" => $art["text"] |
82 |
)); |
)); |
83 |
|
array_push($menu2, array( |
84 |
|
"pre" => "wn-", |
85 |
|
"cat" => $empty["category"], |
86 |
|
"id" => $art["id"], |
87 |
|
"title" => MyEscape($art["title"]), |
88 |
|
"url" => MyEscape($art["more"]), |
89 |
|
"more" => MyEscape($art["read"]) |
90 |
|
)); |
91 |
} |
} |
92 |
} |
} |
93 |
$empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "npar" => 0); |
$empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "offset" => 0, "npar" => 0); |
94 |
|
$ed = ""; |
95 |
if ($pn_edit && $ed_id <= 0) { |
if ($pn_edit && $ed_id <= 0) { |
96 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
97 |
$ed = newsEdit($empty, "pn_edit"); |
$ed = newsEdit($empty, "pn_edit"); |
98 |
if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed); |
99 |
else $pn_edit = false; |
else $pn_edit = false; |
100 |
} |
} |
101 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]); |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
102 |
$pn = array(); |
$pn = array(); |
103 |
for ($i = 0; $i < count($arts); $i++) { |
for ($i = 0; $i < count($arts); $i++) { |
104 |
$art = $arts[$i]; |
$art = $arts[$i]; |
105 |
$ed = ""; |
$ed = ""; |
106 |
if ($pn_edit && $art["id"] == $ed_id) { |
if ($pn_edit && $art["id"] == $ed_id) { |
107 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
108 |
|
$art["nlimit"] = count($arts); |
109 |
$ed = newsEdit($art, "pn_edit"); |
$ed = newsEdit($art, "pn_edit"); |
110 |
} |
} |
111 |
if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed)); |
if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed)); |
112 |
else { |
else { |
113 |
if ($ed) $art = $ed; |
if ($ed && $ed["category"] == "p") $art = $ed; |
114 |
for ($j = 0; $j < count($art["text"]); $j++) |
for ($j = 0; $j < count($art["text"]); $j++) |
115 |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"])); |
$art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true); |
116 |
include_once("inc/links.php"); |
include_once("inc/links.php"); |
117 |
array_push($pn, array( |
array_push($pn, array( |
118 |
"id" => $art["id"], |
"id" => $art["id"], |
124 |
"width" => MyEscape($art["pic_w"]), |
"width" => MyEscape($art["pic_w"]), |
125 |
"height" => MyEscape($art["pic_h"]), |
"height" => MyEscape($art["pic_h"]), |
126 |
"links" => GetLinks($art["read"] && $art["id"], |
"links" => GetLinks($art["read"] && $art["id"], |
127 |
MyEscape($art["more"]), $art["id"], |
MyEscape($art["more"]), MyEscape($art["more_title"]), |
128 |
$empty["category"], "pn"), |
$art["id"], $empty["category"], "pn", $isEdit, true, |
129 |
|
($i > 0), ($i < count($arts) - 1)), |
130 |
"text" => MyEscape($art["text"]) |
"text" => MyEscape($art["text"]) |
131 |
)); |
)); |
132 |
|
array_push($menu2, array( |
133 |
|
"pre" => "pn-", |
134 |
|
"cat" => $empty["category"], |
135 |
|
"id" => $art["id"], |
136 |
|
"title" => MyEscape($art["title"]), |
137 |
|
"url" => MyEscape($art["more"]), |
138 |
|
"more" => MyEscape($art["read"]) |
139 |
|
)); |
140 |
} |
} |
141 |
} |
} |
142 |
$tpl->assign("wn", $wn); |
$tpl->assign("wn", $wn); |
144 |
$tpl->assign("top_edit", $top_edit); |
$tpl->assign("top_edit", $top_edit); |
145 |
$tpl->assign("wn_edit", $wn_edit); |
$tpl->assign("wn_edit", $wn_edit); |
146 |
$tpl->assign("pn_edit", $pn_edit); |
$tpl->assign("pn_edit", $pn_edit); |
147 |
|
$tpl->assign("MENU2", $menu2); |
148 |
} |
} |
149 |
$dbh->disconnect(); |
$dbh->disconnect(); |
150 |
?> |
?> |