/[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.7 by ravilov, Wed Sep 19 12:23:57 2001 UTC revision 1.8 by ravilov, Tue Sep 25 15:38:04 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                  }                  }
                 if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");  
                 if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");  
17                  $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);                  $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);
18                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
19                  $art = array_shift($arts);                  $art = array_shift($arts);
# Line 34  Line 36 
36                          for ($j = 0; $j < count($art["text"]); $j++)                          for ($j = 0; $j < count($art["text"]); $j++)
37                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
38                          $tpl->assign("top_text", $art["text"]);                          $tpl->assign("top_text", $art["text"]);
                         include_once("inc/links.php");  
39                          include_once("inc/author.php");                          include_once("inc/author.php");
40                          $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],                          $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],
41                                  $art["au_alt"], $art["au_info"],                                  $art["au_alt"], $art["au_info"],
42                                  $art["au_w"], $art["au_h"]));                                  $art["au_w"], $art["au_h"]));
43                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],
44                                  /* MyEscape($art["more"]) */ (count($art["text"]) <= 0) ? true : false,                                  /* MyEscape($art["more"]) */ (count($art["text"]) > 0 && $art["id"]) ? $art["more"] : "",
45                                  MyEscape($art["more_title"]), $art["id"], $empty["category"],                                  MyEscape($art["more_title"]), $art["id"], $empty["category"],
46                                  "top", $isEdit, false, false, false));                                  "top", $isEdit, false, false, false));
47                  }                  }
48                  $menu2 = array();                  $menu2 = array();
49                  $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "offset" => 0, "npar" => 0);                  $empty = array("category" => "w", "limit" => ($wn_edit && !$ed_id ? 4 : 5), "offset" => 0, "npar" => 0);
50                  $ed = "";                  $ed = "";
51                  if ($wn_edit && $ed_id <= 0 && $isEdit) {                  if ($wn_edit && $ed_id <= 0 && $isEdit) {
52                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
# Line 55  Line 56 
56                  }                  }
57                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
58                  $wn = array();                  $wn = array();
59                    $tmp2 = array();
60                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
61                          $art = $arts[$i];                          $art = $arts[$i];
62                          $ed = "";                          $ed = "";
# Line 68  Line 70 
70                                  if ($ed && $ed["category"] == "w") $art = $ed;                                  if ($ed && $ed["category"] == "w") $art = $ed;
71                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
72                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
73                                  include_once("inc/links.php");                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
74                                  array_push($wn, array(                                  array_push($wn, array(
75                                          "id" => $art["id"],                                          "id" => $art["id"],
76                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
# Line 76  Line 78 
78                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
79                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
80                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
81                                          "width" => MyEscape($art["pic_w"]),                                          "width" => $art["pic_w"],
82                                          "height" => MyEscape($art["pic_h"]),                                          "height" => $art["pic_h"],
83                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
84                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),
85                                                  $art["id"], $empty["category"], "wn", $isEdit, true,                                                  $art["id"], $empty["category"], "wn", $isEdit, true,
86                                                  ($i > 0), ($i < count($arts) - 1)),                                                  ($i > 0), ($i < count($arts) - 1)),
87                                          "text" => $art["text"]                                          "text" => $art["text"]
88                                  ));                                  ));
89                                  array_push($menu2, array(                                  array_push($tmp2, array(
                                         "pre" => "wn-",  
90                                          "cat" => $empty["category"],                                          "cat" => $empty["category"],
91                                          "id" => $art["id"],                                          "id" => $art["id"],
92                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
# Line 94  Line 95 
95                                  ));                                  ));
96                          }                          }
97                  }                  }
98                  $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "offset" => 0, "npar" => 0);                  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 = "";                  $ed = "";
106                  if ($pn_edit && $ed_id <= 0 && $isEdit) {                  if ($pn_edit && $ed_id <= 0 && $isEdit) {
107                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
# Line 104  Line 111 
111                  }                  }
112                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
113                  $pn = array();                  $pn = array();
114                    $tmp2 = array();
115                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
116                          $art = $arts[$i];                          $art = $arts[$i];
117                          $ed = "";                          $ed = "";
# Line 117  Line 125 
125                                  if ($ed && $ed["category"] == "p") $art = $ed;                                  if ($ed && $ed["category"] == "p") $art = $ed;
126                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
127                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
128                                  include_once("inc/links.php");                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
129                                  array_push($pn, array(                                  array_push($pn, array(
130                                          "id" => $art["id"],                                          "id" => $art["id"],
131                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
# Line 133  Line 141 
141                                                  ($i > 0), ($i < count($arts) - 1)),                                                  ($i > 0), ($i < count($arts) - 1)),
142                                          "text" => MyEscape($art["text"])                                          "text" => MyEscape($art["text"])
143                                  ));                                  ));
144                                  array_push($menu2, array(                                  array_push($tmp2, array(
                                         "pre" => "pn-",  
145                                          "cat" => $empty["category"],                                          "cat" => $empty["category"],
146                                          "id" => $art["id"],                                          "id" => $art["id"],
147                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
# Line 143  Line 150 
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);                  $tpl->assign("wn", $wn);
160                  $tpl->assign("pn", $pn);                  $tpl->assign("pn", $pn);
161                  $tpl->assign("top_edit", $top_edit);                  $tpl->assign("top_edit", $top_edit);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26