/[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.10 - (show annotations)
Tue Oct 2 16:18:09 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
Changes since 1.9: +3 -0 lines
Users can now pick their username/password on registration (PLIVAmed). Other bugfixes.

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, $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 }
17 $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);
18 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
19 $art = array_shift($arts);
20 $ed = "";
21 if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0) && $isEdit) {
22 include_once("inc/newsEdit.php");
23 $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");
24 }
25 if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
26 else {
27 if ($ed && $ed["category"] == "t") $art = $ed;
28 $tpl->assign("top_id", $art["id"]);
29 $tpl->assign("top_title", MyEscape($art["title"]));
30 $tpl->assign("top_lead", MyEscape($art["lead"]));
31 $tpl->assign("top_pgfs", (count($art["text"]) > 0) ? true : false);
32 $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));
33 $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));
34 $tpl->assign("top_titlepic_type", $art["pic_pos"]);
35 $tpl->assign("top_titlepic_width", $art["pic_w"]);
36 $tpl->assign("top_titlepic_height", $art["pic_h"]);
37 for ($j = 0; $j < count($art["text"]); $j++)
38 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
39 $tpl->assign("top_text", $art["text"]);
40 include_once("inc/author.php");
41 $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],
42 $art["au_alt"], $art["au_info"],
43 $art["au_w"], $art["au_h"]));
44 $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],
45 /* MyEscape($art["more"]) */ (count($art["text"]) > 0 && $art["id"]) ? $art["more"] : "",
46 MyEscape($art["more_title"]), $art["id"], $empty["category"],
47 "top", $isEdit, false, false, false));
48 $tpl->assign("top_read", $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false);
49 }
50 $menu2 = array();
51 $empty = array("category" => "w", "limit" => $isEdit ? 0 : ($wn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
52 $ed = "";
53 if ($wn_edit && $ed_id <= 0 && $isEdit) {
54 include_once("inc/newsEdit.php");
55 $ed = newsEdit($empty, "wn_edit", true);
56 if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
57 else $wn_edit = false;
58 }
59 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
60 $wn = array();
61 $tmp2 = array();
62 for ($i = 0; $i < count($arts); $i++) {
63 $art = $arts[$i];
64 $ed = "";
65 if ($wn_edit && $art["id"] == $ed_id && $isEdit) {
66 include_once("inc/newsEdit.php");
67 $art["nlimit"] = count($arts);
68 $ed = newsEdit($art, "wn_edit", true);
69 }
70 if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
71 else {
72 if ($ed && $ed["category"] == "w") $art = $ed;
73 for ($j = 0; $j < count($art["text"]); $j++)
74 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
75 list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
76 array_push($wn, array(
77 "id" => $art["id"],
78 "title" => MyEscape($art["title"]),
79 "lead" => MyEscape($art["lead"]),
80 "pgfs" => (count($art["text"]) > 0) ? true : false,
81 "pic" => MyEscape($art["pic_url"]),
82 "alt" => MyEscape($art["pic_alt"]),
83 "pos" => MyEscape($art["pic_pos"]),
84 "width" => $art["pic_w"],
85 "height" => $art["pic_h"],
86 "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
87 MyEscape($art["more"]), MyEscape($art["more_title"]),
88 $art["id"], $empty["category"], "wn", $isEdit, true,
89 ($i > 0), ($i < count($arts) - 1)),
90 "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false,
91 "text" => $art["text"]
92 ));
93 array_push($tmp2, array(
94 "cat" => $empty["category"],
95 "id" => $art["id"],
96 "title" => MyEscape($art["title"]),
97 "url" => MyEscape($art["more"]),
98 "more" => ($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"]
99 ));
100 }
101 }
102 array_push($menu2, array(
103 "title" => "Vijesti",
104 "class" => "wnhead",
105 "pre" => "wn-",
106 "items" => $tmp2
107 ));
108 $empty = array("category" => "p", $isEdit ? 0 : "limit" => ($pn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
109 $ed = "";
110 if ($pn_edit && $ed_id <= 0 && $isEdit) {
111 include_once("inc/newsEdit.php");
112 $ed = newsEdit($empty, "pn_edit", true);
113 if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
114 else $pn_edit = false;
115 }
116 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
117 $pn = array();
118 $tmp2 = array();
119 for ($i = 0; $i < count($arts); $i++) {
120 $art = $arts[$i];
121 $ed = "";
122 if ($pn_edit && $art["id"] == $ed_id && $isEdit) {
123 include_once("inc/newsEdit.php");
124 $art["nlimit"] = count($arts);
125 $ed = newsEdit($art, "pn_edit", true);
126 }
127 if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
128 else {
129 if ($ed && $ed["category"] == "p") $art = $ed;
130 for ($j = 0; $j < count($art["text"]); $j++)
131 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
132 list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
133 array_push($pn, array(
134 "id" => $art["id"],
135 "title" => MyEscape($art["title"]),
136 "lead" => MyEscape($art["lead"]),
137 "pgfs" => (count($art["text"]) > 0) ? true : false,
138 "pic" => MyEscape($art["pic_url"]),
139 "alt" => MyEscape($art["pic_alt"]),
140 "pos" => MyEscape($art["pic_pos"]),
141 "width" => MyEscape($art["pic_w"]),
142 "height" => MyEscape($art["pic_h"]),
143 "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
144 MyEscape($art["more"]), MyEscape($art["more_title"]),
145 $art["id"], $empty["category"], "pn", $isEdit, true,
146 ($i > 0), ($i < count($arts) - 1)),
147 "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false,
148 "text" => MyEscape($art["text"])
149 ));
150 array_push($tmp2, array(
151 "cat" => $empty["category"],
152 "id" => $art["id"],
153 "title" => MyEscape($art["title"]),
154 "url" => MyEscape($art["more"]),
155 "more" => ($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"]
156 ));
157 }
158 }
159 array_push($menu2, array(
160 "title" => "Novo na PLIVA".($isMed ? "med.net" : "zdravlju"),
161 "class" => "pnhead",
162 "pre" => "pn-",
163 "items" => $tmp2
164 ));
165 $tpl->assign("wn", $wn);
166 $tpl->assign("pn", $pn);
167 $tpl->assign("top_edit", $top_edit);
168 $tpl->assign("wn_edit", $wn_edit);
169 $tpl->assign("pn_edit", $pn_edit);
170 if (!$isMed) $tpl->assign("MENU2", $menu2);
171 }
172 $dbh->disconnect();
173 ?>

  ViewVC Help
Powered by ViewVC 1.1.26