/[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.8 - (show annotations)
Tue Sep 25 15:38:04 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
Changes since 1.7: +32 -19 lines
Major changes. Too numeruous to mention all here.

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

  ViewVC Help
Powered by ViewVC 1.1.26