/[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.6 by ravilov, Mon Sep 3 15:52:15 2001 UTC revision 1.7 by ravilov, Wed Sep 19 12:23:57 2001 UTC
# Line 12  Line 12 
12                  }                  }
13                  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)");
14                  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)");
15                  $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 1);                  $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 0);
16                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
17                  $art = array_shift($arts);                  $art = array_shift($arts);
18                  $ed = "";                  $ed = "";
19                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0) && $isEdit) {
20                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
21                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");
22                  }                  }
# Line 35  Line 35 
35                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
36                          $tpl->assign("top_text", $art["text"]);                          $tpl->assign("top_text", $art["text"]);
37                          include_once("inc/links.php");                          include_once("inc/links.php");
38                            include_once("inc/author.php");
39                            $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],
40                                    $art["au_alt"], $art["au_info"],
41                                    $art["au_w"], $art["au_h"]));
42                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],
43                                  MyEscape($art["more"]), MyEscape($art["more_title"]),                                  /* MyEscape($art["more"]) */ (count($art["text"]) <= 0) ? true : false,
44                                  $art["id"], $empty["category"], "top", $isEdit,                                  MyEscape($art["more_title"]), $art["id"], $empty["category"],
45                                  false, false, false));                                  "top", $isEdit, false, false, false));
46                  }                  }
47                  $menu2 = array();                  $menu2 = array();
48                  $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "offset" => 0, "npar" => 0);                  $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "offset" => 0, "npar" => 0);
49                  $ed = "";                  $ed = "";
50                  if ($wn_edit && $ed_id <= 0) {                  if ($wn_edit && $ed_id <= 0 && $isEdit) {
51                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
52                          $ed = newsEdit($empty, "wn_edit");                          $ed = newsEdit($empty, "wn_edit", true);
53                          if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
54                                  else $wn_edit = false;                                  else $wn_edit = false;
55                  }                  }
# Line 54  Line 58 
58                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
59                          $art = $arts[$i];                          $art = $arts[$i];
60                          $ed = "";                          $ed = "";
61                          if ($wn_edit && $art["id"] == $ed_id) {                          if ($wn_edit && $art["id"] == $ed_id && $isEdit) {
62                                  include_once("inc/newsEdit.php");                                  include_once("inc/newsEdit.php");
63                                  $art["nlimit"] = count($arts);                                  $art["nlimit"] = count($arts);
64                                  $ed = newsEdit($art, "wn_edit");                                  $ed = newsEdit($art, "wn_edit", true);
65                          }                          }
66                          if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));                          if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
67                          else {                          else {
# Line 74  Line 78 
78                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
79                                          "width" => MyEscape($art["pic_w"]),                                          "width" => MyEscape($art["pic_w"]),
80                                          "height" => MyEscape($art["pic_h"]),                                          "height" => MyEscape($art["pic_h"]),
81                                          "links" => GetLinks($art["read"] && $art["id"],                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
82                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),
83                                                  $art["id"], $empty["category"], "wn", $isEdit, true,                                                  $art["id"], $empty["category"], "wn", $isEdit, true,
84                                                  ($i > 0), ($i < count($arts) - 1)),                                                  ($i > 0), ($i < count($arts) - 1)),
# Line 86  Line 90 
90                                          "id" => $art["id"],                                          "id" => $art["id"],
91                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
92                                          "url" => MyEscape($art["more"]),                                          "url" => MyEscape($art["more"]),
93                                          "more" => MyEscape($art["read"])                                          "more" => ($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"]
94                                  ));                                  ));
95                          }                          }
96                  }                  }
97                  $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "offset" => 0, "npar" => 0);                  $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "offset" => 0, "npar" => 0);
98                  $ed = "";                  $ed = "";
99                  if ($pn_edit && $ed_id <= 0) {                  if ($pn_edit && $ed_id <= 0 && $isEdit) {
100                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
101                          $ed = newsEdit($empty, "pn_edit");                          $ed = newsEdit($empty, "pn_edit", true);
102                          if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
103                                  else $pn_edit = false;                                  else $pn_edit = false;
104                  }                  }
# Line 103  Line 107 
107                  for ($i = 0; $i < count($arts); $i++) {                  for ($i = 0; $i < count($arts); $i++) {
108                          $art = $arts[$i];                          $art = $arts[$i];
109                          $ed = "";                          $ed = "";
110                          if ($pn_edit && $art["id"] == $ed_id) {                          if ($pn_edit && $art["id"] == $ed_id && $isEdit) {
111                                  include_once("inc/newsEdit.php");                                  include_once("inc/newsEdit.php");
112                                  $art["nlimit"] = count($arts);                                  $art["nlimit"] = count($arts);
113                                  $ed = newsEdit($art, "pn_edit");                                  $ed = newsEdit($art, "pn_edit", true);
114                          }                          }
115                          if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));                          if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
116                          else {                          else {
# Line 123  Line 127 
127                                          "pos" => MyEscape($art["pic_pos"]),                                          "pos" => MyEscape($art["pic_pos"]),
128                                          "width" => MyEscape($art["pic_w"]),                                          "width" => MyEscape($art["pic_w"]),
129                                          "height" => MyEscape($art["pic_h"]),                                          "height" => MyEscape($art["pic_h"]),
130                                          "links" => GetLinks($art["read"] && $art["id"],                                          "links" => GetLinks(($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"],
131                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),                                                  MyEscape($art["more"]), MyEscape($art["more_title"]),
132                                                  $art["id"], $empty["category"], "pn", $isEdit, true,                                                  $art["id"], $empty["category"], "pn", $isEdit, true,
133                                                  ($i > 0), ($i < count($arts) - 1)),                                                  ($i > 0), ($i < count($arts) - 1)),
# Line 135  Line 139 
139                                          "id" => $art["id"],                                          "id" => $art["id"],
140                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
141                                          "url" => MyEscape($art["more"]),                                          "url" => MyEscape($art["more"]),
142                                          "more" => MyEscape($art["read"])                                          "more" => ($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"]
143                                  ));                                  ));
144                          }                          }
145                  }                  }
# Line 144  Line 148 
148                  $tpl->assign("top_edit", $top_edit);                  $tpl->assign("top_edit", $top_edit);
149                  $tpl->assign("wn_edit", $wn_edit);                  $tpl->assign("wn_edit", $wn_edit);
150                  $tpl->assign("pn_edit", $pn_edit);                  $tpl->assign("pn_edit", $pn_edit);
151                  $tpl->assign("MENU2", $menu2);                  if (!$isMed) $tpl->assign("MENU2", $menu2);
152          }          }
153          $dbh->disconnect();          $dbh->disconnect();
154  ?>  ?>

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

  ViewVC Help
Powered by ViewVC 1.1.26