12 |
} |
} |
13 |
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)"); |
14 |
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)"); |
15 |
$empty = array("category" => "t", "limit" => 1, "npar" => 1); |
$empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 1); |
16 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]); |
$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)) { |
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"]), $art["id"], $empty["category"], "top", |
40 |
false, false, false)); |
isEdit(), false, false, false)); |
41 |
} |
} |
42 |
$empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "npar" => 0); |
$empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "offset" => 0, "npar" => 0); |
43 |
$ed = ""; |
$ed = ""; |
44 |
if ($wn_edit && $ed_id <= 0) { |
if ($wn_edit && $ed_id <= 0) { |
45 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
47 |
if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed); |
48 |
else $wn_edit = false; |
else $wn_edit = false; |
49 |
} |
} |
50 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]); |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
51 |
$wn = array(); |
$wn = array(); |
52 |
for ($i = 0; $i < count($arts); $i++) { |
for ($i = 0; $i < count($arts); $i++) { |
53 |
$art = $arts[$i]; |
$art = $arts[$i]; |
74 |
"height" => MyEscape($art["pic_h"]), |
"height" => MyEscape($art["pic_h"]), |
75 |
"links" => GetLinks($art["read"] && $art["id"], |
"links" => GetLinks($art["read"] && $art["id"], |
76 |
MyEscape($art["more"]), $art["id"], |
MyEscape($art["more"]), $art["id"], |
77 |
$empty["category"], "wn", true, ($i > 0), |
$empty["category"], "wn", isEdit(), true, |
78 |
($i < count($arts) - 1)), |
($i > 0), ($i < count($arts) - 1)), |
79 |
"text" => $art["text"] |
"text" => $art["text"] |
80 |
)); |
)); |
81 |
} |
} |
82 |
} |
} |
83 |
$empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "npar" => 0); |
$empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "offset" => 0, "npar" => 0); |
84 |
$ed = ""; |
$ed = ""; |
85 |
if ($pn_edit && $ed_id <= 0) { |
if ($pn_edit && $ed_id <= 0) { |
86 |
include_once("inc/newsEdit.php"); |
include_once("inc/newsEdit.php"); |
88 |
if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed); |
if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed); |
89 |
else $pn_edit = false; |
else $pn_edit = false; |
90 |
} |
} |
91 |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]); |
$arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]); |
92 |
$pn = array(); |
$pn = array(); |
93 |
for ($i = 0; $i < count($arts); $i++) { |
for ($i = 0; $i < count($arts); $i++) { |
94 |
$art = $arts[$i]; |
$art = $arts[$i]; |
115 |
"height" => MyEscape($art["pic_h"]), |
"height" => MyEscape($art["pic_h"]), |
116 |
"links" => GetLinks($art["read"] && $art["id"], |
"links" => GetLinks($art["read"] && $art["id"], |
117 |
MyEscape($art["more"]), $art["id"], |
MyEscape($art["more"]), $art["id"], |
118 |
$empty["category"], "pn", true, ($i > 0), |
$empty["category"], "pn", isEdit(), true, |
119 |
($i < count($arts) - 1)), |
($i > 0), ($i < count($arts) - 1)), |
120 |
"text" => MyEscape($art["text"]) |
"text" => MyEscape($art["text"]) |
121 |
)); |
)); |
122 |
} |
} |
126 |
$tpl->assign("top_edit", $top_edit); |
$tpl->assign("top_edit", $top_edit); |
127 |
$tpl->assign("wn_edit", $wn_edit); |
$tpl->assign("wn_edit", $wn_edit); |
128 |
$tpl->assign("pn_edit", $pn_edit); |
$tpl->assign("pn_edit", $pn_edit); |
129 |
|
$tpl->assign("isedit", isEdit()); |
130 |
} |
} |
131 |
$dbh->disconnect(); |
$dbh->disconnect(); |
132 |
?> |
?> |