/[health_html]/inc/pgHome.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /inc/pgHome.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations)
Sat Oct 27 16:54:50 2001 UTC (22 years, 5 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +20 -12 lines
Rearranged the menu system on plivamed.net. Other fixes/improvements.

1 <?php
2 include("inc/conn.php");
3 include_once("inc/newsShow.php");
4 if ($show) {
5 $arts = newsLoad($id, $cat);
6 newsShow(array_shift($arts));
7 } else {
8 if ($isEdit) {
9 if ($del_id) {
10 include_once("inc/newsDelete.php");
11 newsDelete($del_id);
12 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)");
15 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)");
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"], "?")) || $art["related"]) ? $read : "";
42 if ($read && !$art["id"]) $read = "";
43 $more = ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "";
44 array_push($a2, array(
45 "id" => $art["id"],
46 "title" => MyEscape($art["title"]),
47 "lead" => MyEscape($art["lead"]),
48 "pgfs" => (count($art["text"]) > 0) ? true : false,
49 "titlepic_url" => MyEscape($art["pic_url"]),
50 "titlepic_alt" => MyEscape($art["pic_alt"]),
51 "titlepic_type" => $art["pic_pos"],
52 "titlepic_width" => $art["pic_w"],
53 "titlepic_height" => $art["pic_h"],
54 "text" => $art["text"],
55 "links" => GetLinks($read, $more, 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 "more" => $more,
59 "more_title" => $art["more_title"],
60 "AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], $art["au_cv"])
61 ));
62 }
63 }
64 $tpl->assign("top2", $a2);
65 $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);
66 if ($top_edit && $ed_id <= 0 && $isEdit) {
67 include_once("inc/newsEdit.php");
68 $ed = newsEdit($empty, "top_edit");
69 if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
70 else $top_edit = false;
71 }
72 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
73 $ed = "";
74 $a2 = array();
75 for ($i = 0; $i < count($arts); $i++) {
76 $art = $arts[$i];
77 $ed = "";
78 if ($top_edit && ($art["id"] == $ed_id)) {
79 include_once("inc/newsEdit.php");
80 $ed = newsEdit($art, "top_edit");
81 }
82 if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
83 else {
84 if ($ed && $ed["category"] == $cat) $art = $ed;
85 for ($j = 0; $j < count($art["text"]); $j++)
86 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
87 $read = $art["read"];
88 if ($read && count($art["text"]) <= 0) $read = (($art["more"] && !strstr($art["more"], "?")) || $art["related"]) ? $read : "";
89 if ($read && !$art["id"]) $read = "";
90 $more = ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "";
91 array_push($a2, array(
92 "id" => $art["id"],
93 "title" => MyEscape($art["title"]),
94 "lead" => MyEscape($art["lead"]),
95 "pgfs" => (count($art["text"]) > 0) ? true : false,
96 "titlepic_url" => MyEscape($art["pic_url"]),
97 "titlepic_alt" => MyEscape($art["pic_alt"]),
98 "titlepic_type" => $art["pic_pos"],
99 "titlepic_width" => $art["pic_w"],
100 "titlepic_height" => $art["pic_h"],
101 "text" => $art["text"],
102 "links" => GetLinks($read, $more, MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
103 true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
104 "read" => $read,
105 "more" => $more,
106 "more_title" => $art["more_title"],
107 "AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], $art["au_cv"])
108 ));
109 }
110 }
111 $tpl->assign("top", $a2);
112 $menu2 = array();
113 $empty = array("category" => "w", "limit" => ($wn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
114 $ed = "";
115 if ($wn_edit && $ed_id <= 0 && $isEdit) {
116 include_once("inc/newsEdit.php");
117 $ed = newsEdit($empty, "wn_edit", true);
118 if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
119 else $wn_edit = false;
120 }
121 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
122 $wn = array();
123 $tmp2 = array();
124 for ($i = 0; $i < count($arts); $i++) {
125 $art = $arts[$i];
126 $ed = "";
127 if ($wn_edit && $art["id"] == $ed_id && $isEdit) {
128 include_once("inc/newsEdit.php");
129 $art["nlimit"] = count($arts);
130 $ed = newsEdit($art, "wn_edit", true);
131 }
132 if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
133 else {
134 if ($ed && $ed["category"] == "w") $art = $ed;
135 for ($j = 0; $j < count($art["text"]); $j++)
136 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
137 list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
138 $read = $art["read"];
139 if ($read && count($art["text"]) <= 0) $read = (($art["more"] && !strstr($art["more"], "?")) || $art["related"]) ? $read : "";
140 if ($read && !$art["id"]) $read = "";
141 $more = ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "";
142 array_push($wn, array(
143 "id" => $art["id"],
144 "title" => MyEscape($art["title"]),
145 "lead" => MyEscape($art["lead"]),
146 "pgfs" => (count($art["text"]) > 0) ? true : false,
147 "pic" => MyEscape($art["pic_url"]),
148 "alt" => MyEscape($art["pic_alt"]),
149 "pos" => MyEscape($art["pic_pos"]),
150 "width" => $art["pic_w"],
151 "height" => $art["pic_h"],
152 "links" => GetLinks($read, $more, MyEscape($art["more_title"]), $art["id"], $empty["category"], "wn", true,
153 ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
154 "read" => $read,
155 "more" => $more,
156 "more_title" => $art["more_title"],
157 "text" => $art["text"]
158 ));
159 array_push($tmp2, array(
160 "cat" => $empty["category"],
161 "id" => $art["id"],
162 "title" => MyEscape($art["title"])
163 ));
164 }
165 }
166 array_push($menu2, array(
167 "title" => "Vijesti",
168 "class" => "wnhead",
169 "pre" => "wn-",
170 "items" => $tmp2
171 ));
172 $empty = array("category" => "p", "limit" => ($pn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
173 $ed = "";
174 if ($pn_edit && $ed_id <= 0 && $isEdit) {
175 include_once("inc/newsEdit.php");
176 $ed = newsEdit($empty, "pn_edit", true);
177 if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
178 else $pn_edit = false;
179 }
180 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
181 $pn = array();
182 $tmp2 = array();
183 for ($i = 0; $i < count($arts); $i++) {
184 $art = $arts[$i];
185 $ed = "";
186 if ($pn_edit && $art["id"] == $ed_id && $isEdit) {
187 include_once("inc/newsEdit.php");
188 $art["nlimit"] = count($arts);
189 $ed = newsEdit($art, "pn_edit", true);
190 }
191 if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
192 else {
193 if ($ed && $ed["category"] == "p") $art = $ed;
194 for ($j = 0; $j < count($art["text"]); $j++)
195 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
196 list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
197 $read = $art["read"];
198 if ($read && count($art["text"]) <= 0) $read = (($art["more"] && !strstr($art["more"], "?")) || $art["related"]) ? $read : "";
199 if ($read && !$art["id"]) $read = "";
200 $more = ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "";
201 array_push($pn, array(
202 "id" => $art["id"],
203 "title" => MyEscape($art["title"]),
204 "lead" => MyEscape($art["lead"]),
205 "pgfs" => (count($art["text"]) > 0) ? true : false,
206 "pic" => MyEscape($art["pic_url"]),
207 "alt" => MyEscape($art["pic_alt"]),
208 "pos" => MyEscape($art["pic_pos"]),
209 "width" => MyEscape($art["pic_w"]),
210 "height" => MyEscape($art["pic_h"]),
211 "links" => GetLinks($read, $more, MyEscape($art["more_title"]), $art["id"], $empty["category"], "pn", true,
212 ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
213 "read" => $read,
214 "more" => $more,
215 "more_title" => $art["more_title"],
216 "text" => MyEscape($art["text"])
217 ));
218 array_push($tmp2, array(
219 "cat" => $empty["category"],
220 "id" => $art["id"],
221 "title" => MyEscape($art["title"])
222 ));
223 }
224 }
225 array_push($menu2, array(
226 "title" => "Novo na PLIVA".($isMed ? "med.net" : "zdravlju"),
227 "class" => "pnhead",
228 "pre" => "pn-",
229 "items" => $tmp2
230 ));
231 $tpl->assign("wn", $wn);
232 $tpl->assign("pn", $pn);
233 $tpl->assign("top_edit", $top_edit);
234 $tpl->assign("wn_edit", $wn_edit);
235 $tpl->assign("pn_edit", $pn_edit);
236 if (!$isMed) $tpl->assign("MENU2", $menu2);
237 }
238 $dbh->disconnect();
239 ?>

  ViewVC Help
Powered by ViewVC 1.1.26