/[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.2 by ravilov, Tue Aug 7 13:55:51 2001 UTC revision 1.10 by ravilov, Tue Oct 2 16:18:09 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, $wn_edit, $pn_edit);
13                  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 ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");
15                  $empty = array("category" => "t", "limit" => 1, "npar" => 1);                          if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");
16                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                  }
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);                  $art = array_shift($arts);
20                  $ed = "";                  $ed = "";
21                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0) && $isEdit) {
22                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
23                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");
24                  }                  }
# Line 26  Line 28 
28                          $tpl->assign("top_id", $art["id"]);                          $tpl->assign("top_id", $art["id"]);
29                          $tpl->assign("top_title", MyEscape($art["title"]));                          $tpl->assign("top_title", MyEscape($art["title"]));
30                          $tpl->assign("top_lead", MyEscape($art["lead"]));                          $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"]));                          $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));
33                          $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));                          $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));
34                          $tpl->assign("top_titlepic_type", $art["pic_pos"]);                          $tpl->assign("top_titlepic_type", $art["pic_pos"]);
35                          $tpl->assign("top_titlepic_width", $art["pic_w"]);                          $tpl->assign("top_titlepic_width", $art["pic_w"]);
36                          $tpl->assign("top_titlepic_height", $art["pic_h"]);                          $tpl->assign("top_titlepic_height", $art["pic_h"]);
37                          for ($j = 0; $j < count($art["text"]); $j++)                          for ($j = 0; $j < count($art["text"]); $j++)
38                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
39                          $tpl->assign("top_text", $art["text"]);                          $tpl->assign("top_text", $art["text"]);
40                          include_once("inc/links.php");                          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"],                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],
45                                  MyEscape($art["more"]), $art["id"], $empty["category"], "top",                                  /* MyEscape($art["more"]) */ (count($art["text"]) > 0 && $art["id"]) ? $art["more"] : "",
46                                  false, false, false));                                  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                  $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "npar" => 0);                  $menu2 = array();
51                    $empty = array("category" => "w", "limit" => $isEdit ? 0 : ($wn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
52                  $ed = "";                  $ed = "";
53                  if ($wn_edit && $ed_id <= 0) {                  if ($wn_edit && $ed_id <= 0 && $isEdit) {
54                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
55                          $ed = newsEdit($empty, "wn_edit");                          $ed = newsEdit($empty, "wn_edit", true);
56                          if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
57                                  else $wn_edit = false;                                  else $wn_edit = false;
58                  }                  }
59                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
60                  $wn = array();                  $wn = array();
61                    $tmp2 = array();
62                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
63                          $art = $arts[$i];                          $art = $arts[$i];
64                          $ed = "";                          $ed = "";
65                          if ($wn_edit && $art["id"] == $ed_id) {                          if ($wn_edit && $art["id"] == $ed_id && $isEdit) {
66                                  include_once("inc/newsEdit.php");                                  include_once("inc/newsEdit.php");
67                                  $art["nlimit"] = count($arts);                                  $art["nlimit"] = count($arts);
68                                  $ed = newsEdit($art, "wn_edit");                                  $ed = newsEdit($art, "wn_edit", true);
69                          }                          }
70                          if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));                          if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
71                          else {                          else {
72                                  if ($ed && $ed["category"] == "w") $art = $ed;                                  if ($ed && $ed["category"] == "w") $art = $ed;
73                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
74                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
75                                  include_once("inc/links.php");                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
76                                  array_push($wn, array(                                  array_push($wn, array(
77                                          "id" => $art["id"],                                          "id" => $art["id"],
78                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
79                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
80                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
81                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
82                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
83                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
84                                          "width" => MyEscape($art["pic_w"]),                                          "width" => $art["pic_w"],
85                                          "height" => MyEscape($art["pic_h"]),                                          "height" => $art["pic_h"],
86                                          "links" => GetLinks($art["read"] && $art["id"],                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
87                                                  MyEscape($art["more"]), $art["id"],                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),
88                                                  $empty["category"], "wn", true, ($i > 0),                                                  $art["id"], $empty["category"], "wn", $isEdit, true,
89                                                  ($i < count($arts) - 1)),                                                  ($i > 0), ($i < count($arts) - 1)),
90                                            "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false,
91                                          "text" => $art["text"]                                          "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                  $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "npar" => 0);                  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 = "";                  $ed = "";
110                  if ($pn_edit && $ed_id <= 0) {                  if ($pn_edit && $ed_id <= 0 && $isEdit) {
111                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
112                          $ed = newsEdit($empty, "pn_edit");                          $ed = newsEdit($empty, "pn_edit", true);
113                          if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
114                                  else $pn_edit = false;                                  else $pn_edit = false;
115                  }                  }
116                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
117                  $pn = array();                  $pn = array();
118                    $tmp2 = array();
119                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
120                          $art = $arts[$i];                          $art = $arts[$i];
121                          $ed = "";                          $ed = "";
122                          if ($pn_edit && $art["id"] == $ed_id) {                          if ($pn_edit && $art["id"] == $ed_id && $isEdit) {
123                                  include_once("inc/newsEdit.php");                                  include_once("inc/newsEdit.php");
124                                  $art["nlimit"] = count($arts);                                  $art["nlimit"] = count($arts);
125                                  $ed = newsEdit($art, "pn_edit");                                  $ed = newsEdit($art, "pn_edit", true);
126                          }                          }
127                          if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));                          if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
128                          else {                          else {
129                                  if ($ed && $ed["category"] == "p") $art = $ed;                                  if ($ed && $ed["category"] == "p") $art = $ed;
130                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
131                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
132                                  include_once("inc/links.php");                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
133                                  array_push($pn, array(                                  array_push($pn, array(
134                                          "id" => $art["id"],                                          "id" => $art["id"],
135                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
136                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
137                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
138                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
139                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
140                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
141                                          "width" => MyEscape($art["pic_w"]),                                          "width" => MyEscape($art["pic_w"]),
142                                          "height" => MyEscape($art["pic_h"]),                                          "height" => MyEscape($art["pic_h"]),
143                                          "links" => GetLinks($art["read"] && $art["id"],                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
144                                                  MyEscape($art["more"]), $art["id"],                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),
145                                                  $empty["category"], "pn", true, ($i > 0),                                                  $art["id"], $empty["category"], "pn", $isEdit, true,
146                                                  ($i < count($arts) - 1)),                                                  ($i > 0), ($i < count($arts) - 1)),
147                                            "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false,
148                                          "text" => MyEscape($art["text"])                                          "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);                  $tpl->assign("wn", $wn);
166                  $tpl->assign("pn", $pn);                  $tpl->assign("pn", $pn);
167                  $tpl->assign("top_edit", $top_edit);                  $tpl->assign("top_edit", $top_edit);
168                  $tpl->assign("wn_edit", $wn_edit);                  $tpl->assign("wn_edit", $wn_edit);
169                  $tpl->assign("pn_edit", $pn_edit);                  $tpl->assign("pn_edit", $pn_edit);
170                    if (!$isMed) $tpl->assign("MENU2", $menu2);
171          }          }
172          $dbh->disconnect();          $dbh->disconnect();
173  ?>  ?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26