/[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.8 by ravilov, Tue Sep 25 15:38:04 2001 UTC revision 1.14 by ravilov, Tue Oct 23 16:13:59 2001 UTC
# Line 9  Line 9 
9                          if ($del_id) {                          if ($del_id) {
10                                  include_once("inc/newsDelete.php");                                  include_once("inc/newsDelete.php");
11                                  newsDelete($del_id);                                  newsDelete($del_id);
12                                  unset($top_edit, $wn_edit, $pn_edit);                                  unset($top_edit, $top2_edit, $wn_edit, $pn_edit);
13                          }                          }
14                          if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");                          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)");                          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                  }                  }
                 $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);  
25                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
                 $art = array_shift($arts);  
26                  $ed = "";                  $ed = "";
27                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0) && $isEdit) {                  $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"], "?")) ? $read : "";
42                                    if ($read && !$art["id"]) $read = "";
43                                    array_push($a2, array(
44                                            "id" => $art["id"],
45                                            "title" => MyEscape($art["title"]),
46                                            "lead" => MyEscape($art["lead"]),
47                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
48                                            "titlepic_url" => MyEscape($art["pic_url"]),
49                                            "titlepic_alt" => MyEscape($art["pic_alt"]),
50                                            "titlepic_type" => $art["pic_pos"],
51                                            "titlepic_width" => $art["pic_w"],
52                                            "titlepic_height" => $art["pic_h"],
53                                            "text" => $art["text"],
54                                            "links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "",
55                                                    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                                            "AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], $art["au_cv"])
59                                    ));
60                            }
61                    }
62                    $tpl->assign("top2", $a2);
63                    $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);
64                    if ($top_edit && $ed_id <= 0 && $isEdit) {
65                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
66                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");                          $ed = newsEdit($empty, "top_edit");
67                            if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
68                                    else $top_edit = false;
69                  }                  }
70                  if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
71                  else {                  $ed = "";
72                          if ($ed && $ed["category"] == "t") $art = $ed;                  $a2 = array();
73                          $tpl->assign("top_id", $art["id"]);                  for ($i = 0; $i < count($arts); $i++) {
74                          $tpl->assign("top_title", MyEscape($art["title"]));                          $art = $arts[$i];
75                          $tpl->assign("top_lead", MyEscape($art["lead"]));                          $ed = "";
76                          $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));                          if ($top_edit && ($art["id"] == $ed_id)) {
77                          $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));                                  include_once("inc/newsEdit.php");
78                          $tpl->assign("top_titlepic_type", $art["pic_pos"]);                                  $ed = newsEdit($art, "top_edit");
79                          $tpl->assign("top_titlepic_width", $art["pic_w"]);                          }
80                          $tpl->assign("top_titlepic_height", $art["pic_h"]);                          if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
81                          for ($j = 0; $j < count($art["text"]); $j++)                          else {
82                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                  if ($ed && $ed["category"] == $cat) $art = $ed;
83                          $tpl->assign("top_text", $art["text"]);                                  for ($j = 0; $j < count($art["text"]); $j++)
84                          include_once("inc/author.php");                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
85                          $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],                                  $read = $art["read"];
86                                  $art["au_alt"], $art["au_info"],                                  if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : "";
87                                  $art["au_w"], $art["au_h"]));                                  if ($read && !$art["id"]) $read = "";
88                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],                                  array_push($a2, array(
89                                  /* MyEscape($art["more"]) */ (count($art["text"]) > 0 && $art["id"]) ? $art["more"] : "",                                          "id" => $art["id"],
90                                  MyEscape($art["more_title"]), $art["id"], $empty["category"],                                          "title" => MyEscape($art["title"]),
91                                  "top", $isEdit, false, false, false));                                          "lead" => MyEscape($art["lead"]),
92                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
93                                            "titlepic_url" => MyEscape($art["pic_url"]),
94                                            "titlepic_alt" => MyEscape($art["pic_alt"]),
95                                            "titlepic_type" => $art["pic_pos"],
96                                            "titlepic_width" => $art["pic_w"],
97                                            "titlepic_height" => $art["pic_h"],
98                                            "text" => $art["text"],
99                                            "links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "",
100                                                    MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
101                                                    true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
102                                            "read" => $read,
103                                            "AUTHOR" => GetAuthor($art["au_pic"], $art["au_alt"], $art["au_info"], $art["au_w"], $art["au_h"], $art["au_cv"])
104                                    ));
105                            }
106                  }                  }
107                    $tpl->assign("top", $a2);
108                  $menu2 = array();                  $menu2 = array();
109                  $empty = array("category" => "w", "limit" => ($wn_edit && !$ed_id ? 4 : 5), "offset" => 0, "npar" => 0);                  $empty = array("category" => "w", "limit" => ($wn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
110                  $ed = "";                  $ed = "";
111                  if ($wn_edit && $ed_id <= 0 && $isEdit) {                  if ($wn_edit && $ed_id <= 0 && $isEdit) {
112                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
# Line 71  Line 131 
131                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
132                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
133                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
134                                    $read = $art["read"];
135                                    if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : "";
136                                    if ($read && !$art["id"]) $read = "";
137                                  array_push($wn, array(                                  array_push($wn, array(
138                                          "id" => $art["id"],                                          "id" => $art["id"],
139                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
140                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
141                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
142                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
143                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
144                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
145                                          "width" => $art["pic_w"],                                          "width" => $art["pic_w"],
146                                          "height" => $art["pic_h"],                                          "height" => $art["pic_h"],
147                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],                                          "links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "",
148                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),                                                  MyEscape($art["more_title"]), $art["id"], $empty["category"], "wn", true,
149                                                  $art["id"], $empty["category"], "wn", $isEdit, true,                                                  ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
150                                                  ($i > 0), ($i < count($arts) - 1)),                                          "read" => $read,
151                                          "text" => $art["text"]                                          "text" => $art["text"]
152                                  ));                                  ));
153                                  array_push($tmp2, array(                                  array_push($tmp2, array(
154                                          "cat" => $empty["category"],                                          "cat" => $empty["category"],
155                                          "id" => $art["id"],                                          "id" => $art["id"],
156                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"])
                                         "url" => MyEscape($art["more"]),  
                                         "more" => ($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"]  
157                                  ));                                  ));
158                          }                          }
159                  }                  }
# Line 101  Line 163 
163                          "pre" => "wn-",                          "pre" => "wn-",
164                          "items" => $tmp2                          "items" => $tmp2
165                  ));                  ));
166                  $empty = array("category" => "p", "limit" => ($pn_edit && !$ed_id ? 4 : 5), "offset" => 0, "npar" => 0);                  $empty = array("category" => "p", "limit" => ($pn_edit && !$ed_id ? 9 : 10), "offset" => 0, "npar" => 0);
167                  $ed = "";                  $ed = "";
168                  if ($pn_edit && $ed_id <= 0 && $isEdit) {                  if ($pn_edit && $ed_id <= 0 && $isEdit) {
169                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
# Line 126  Line 188 
188                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
189                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
190                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);                                  list($art["pic_w"], $art["pic_h"]) = PicResize($art["pic_w"], $art["pic_h"]);
191                                    $read = $art["read"];
192                                    if ($read && count($art["text"]) <= 0) $read = ($art["more"] && !strstr($art["more"], "?")) ? $read : "";
193                                    if ($read && !$art["id"]) $read = "";
194                                  array_push($pn, array(                                  array_push($pn, array(
195                                          "id" => $art["id"],                                          "id" => $art["id"],
196                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
197                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
198                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
199                                          "pic" => MyEscape($art["pic_url"]),                                          "pic" => MyEscape($art["pic_url"]),
200                                          "alt" => MyEscape($art["pic_alt"]),                                          "alt" => MyEscape($art["pic_alt"]),
201                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
202                                          "width" => MyEscape($art["pic_w"]),                                          "width" => MyEscape($art["pic_w"]),
203                                          "height" => MyEscape($art["pic_h"]),                                          "height" => MyEscape($art["pic_h"]),
204                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],                                          "links" => GetLinks($read, ($art["more"] && strstr($art["more"], "?") == 0) ? $art["more"] : "",
205                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),                                                  MyEscape($art["more_title"]), $art["id"], $empty["category"], "pn", true,
206                                                  $art["id"], $empty["category"], "pn", $isEdit, true,                                                  ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
207                                                  ($i > 0), ($i < count($arts) - 1)),                                          "read" => $read,
208                                          "text" => MyEscape($art["text"])                                          "text" => MyEscape($art["text"])
209                                  ));                                  ));
210                                  array_push($tmp2, array(                                  array_push($tmp2, array(
211                                          "cat" => $empty["category"],                                          "cat" => $empty["category"],
212                                          "id" => $art["id"],                                          "id" => $art["id"],
213                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"])
                                         "url" => MyEscape($art["more"]),  
                                         "more" => ($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"]  
214                                  ));                                  ));
215                          }                          }
216                  }                  }

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

  ViewVC Help
Powered by ViewVC 1.1.26