/[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

Diff of /inc/pgHome.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by ravilov, Fri Aug 3 10:02:49 2001 UTC revision 1.15 by ravilov, Sat Oct 27 16:54:50 2001 UTC
# Line 1  Line 1 
1  <?php  <?php
2          include_once("inc/conn.php");          include("inc/conn.php");
3          include_once("inc/newsShow.php");          include_once("inc/newsShow.php");
4          if ($show) {          if ($show) {
5                  $arts = newsLoad($id, $cat);                  $arts = newsLoad($id, $cat);
6                  newsShow(array_shift($arts));                  newsShow(array_shift($arts));
7          } else {          } else {
8                  if ($del_id) {                  if ($isEdit) {
9                          include_once("inc/newsDelete.php");                          if ($del_id) {
10                          newsDelete($del_id);                                  include_once("inc/newsDelete.php");
11                          unset($top_edit, $wn_edit, $pn_edit);                                  newsDelete($del_id);
12                  }                                  unset($top_edit, $top2_edit, $wn_edit, $pn_edit);
13                  $empty = array("category" => "t", "limit" => 1, "npar" => 1);                          }
14                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                          if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");
15                  $art = array_shift($arts);                          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 = "";                  $ed = "";
27                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {                  $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");                          include_once("inc/newsEdit.php");
68                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");                          $ed = newsEdit($empty, "top_edit");
69                            if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
70                                    else $top_edit = false;
71                  }                  }
72                  if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
73                  else {                  $ed = "";
74                          if ($ed) $art = $ed;                  $a2 = array();
75                          $tpl->assign("top_id", $art["id"]);                  for ($i = 0; $i < count($arts); $i++) {
76                          $tpl->assign("top_title", MyEscape($art["title"]));                          $art = $arts[$i];
77                          $tpl->assign("top_lead", MyEscape($art["lead"]));                          $ed = "";
78                          $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));                          if ($top_edit && ($art["id"] == $ed_id)) {
79                          $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));                                  include_once("inc/newsEdit.php");
80                          $tpl->assign("top_titlepic_type", $art["pic_pos"]);                                  $ed = newsEdit($art, "top_edit");
81                          $tpl->assign("top_titlepic_width", $art["pic_w"]);                          }
82                          $tpl->assign("top_titlepic_height", $art["pic_h"]);                          if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
83                          for ($j = 0; $j < count($art["text"]); $j++)                          else {
84                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                                  if ($ed && $ed["category"] == $cat) $art = $ed;
85                          $tpl->assign("top_text", $art["text"]);                                  for ($j = 0; $j < count($art["text"]); $j++)
86                          include_once("inc/links.php");                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
87                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],                                  $read = $art["read"];
88                                  MyEscape($art["more"]), $art["id"], $empty["category"], "top"));                                  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                  $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "npar" => 0);                  $tpl->assign("top", $a2);
112                  if ($wn_edit && $ed_id <= 0) {                  $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");                          include_once("inc/newsEdit.php");
117                          $ed = newsEdit($empty, "wn_edit");                          $ed = newsEdit($empty, "wn_edit", true);
118                          if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
119                                  else $wn_edit = false;                                  else $wn_edit = false;
120                  }                  }
121                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
122                  $wn = array();                  $wn = array();
123                    $tmp2 = array();
124                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
125                          $art = $arts[$i];                          $art = $arts[$i];
126                          $ed = "";                          $ed = "";
127                          if ($wn_edit && $art["id"] == $ed_id) {                          if ($wn_edit && $art["id"] == $ed_id && $isEdit) {
128                                  include_once("inc/newsEdit.php");                                  include_once("inc/newsEdit.php");
129                                  $ed = newsEdit($art, "wn_edit");                                  $art["nlimit"] = count($arts);
130                                    $ed = newsEdit($art, "wn_edit", true);
131                          }                          }
132                          if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));                          if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
133                          else {                          else {
134                                  if ($ed) $art = $ed;                                  if ($ed && $ed["category"] == "w") $art = $ed;
135                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
136                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
137                                  include_once("inc/links.php");                                  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(                                  array_push($wn, array(
143                                          "id" => $art["id"],                                          "id" => $art["id"],
144                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
145                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
146                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
147                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
148                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
149                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
150                                          "width" => MyEscape($art["pic_w"]),                                          "width" => $art["pic_w"],
151                                          "height" => MyEscape($art["pic_h"]),                                          "height" => $art["pic_h"],
152                                          "links" => GetLinks($art["read"] && $art["id"],                                          "links" => GetLinks($read, $more, MyEscape($art["more_title"]), $art["id"], $empty["category"], "wn", true,
153                                                  MyEscape($art["more"]), $art["id"],                                                  ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
154                                                  $empty["category"], "wn"),                                          "read" => $read,
155                                            "more" => $more,
156                                            "more_title" => $art["more_title"],
157                                          "text" => $art["text"]                                          "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                  $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "npar" => 0);                  array_push($menu2, array(
167                  if ($pn_edit && $ed_id <= 0) {                          "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");                          include_once("inc/newsEdit.php");
176                          $ed = newsEdit($empty, "pn_edit");                          $ed = newsEdit($empty, "pn_edit", true);
177                          if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
178                                  else $pn_edit = false;                                  else $pn_edit = false;
179                  }                  }
180                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
181                  $pn = array();                  $pn = array();
182                    $tmp2 = array();
183                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
184                          $art = $arts[$i];                          $art = $arts[$i];
185                          $ed = "";                          $ed = "";
186                          if ($pn_edit && $art["id"] == $ed_id) {                          if ($pn_edit && $art["id"] == $ed_id && $isEdit) {
187                                  include_once("inc/newsEdit.php");                                  include_once("inc/newsEdit.php");
188                                  $ed = newsEdit($art, "pn_edit");                                  $art["nlimit"] = count($arts);
189                                    $ed = newsEdit($art, "pn_edit", true);
190                          }                          }
191                          if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));                          if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
192                          else {                          else {
193                                  if ($ed) $art = $ed;                                  if ($ed && $ed["category"] == "p") $art = $ed;
194                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
195                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
196                                  include_once("inc/links.php");                                  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(                                  array_push($pn, array(
202                                          "id" => $art["id"],                                          "id" => $art["id"],
203                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
204                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
205                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
206                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
207                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
208                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
209                                          "width" => MyEscape($art["pic_w"]),                                          "width" => MyEscape($art["pic_w"]),
210                                          "height" => MyEscape($art["pic_h"]),                                          "height" => MyEscape($art["pic_h"]),
211                                          "links" => GetLinks($art["read"] && $art["id"],                                          "links" => GetLinks($read, $more, MyEscape($art["more_title"]), $art["id"], $empty["category"], "pn", true,
212                                                  MyEscape($art["more"]), $art["id"],                                                  ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
213                                                  $empty["category"], "pn"),                                          "read" => $read,
214                                            "more" => $more,
215                                            "more_title" => $art["more_title"],
216                                          "text" => MyEscape($art["text"])                                          "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);                  $tpl->assign("wn", $wn);
232                  $tpl->assign("pn", $pn);                  $tpl->assign("pn", $pn);
233                  $tpl->assign("top_edit", $top_edit);                  $tpl->assign("top_edit", $top_edit);
234                  $tpl->assign("wn_edit", $wn_edit);                  $tpl->assign("wn_edit", $wn_edit);
235                  $tpl->assign("pn_edit", $pn_edit);                  $tpl->assign("pn_edit", $pn_edit);
236                    if (!$isMed) $tpl->assign("MENU2", $menu2);
237          }          }
238          $dbh->disconnect();          $dbh->disconnect();
239  ?>  ?>

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.26