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

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

  ViewVC Help
Powered by ViewVC 1.1.26