/[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

Annotation of /inc/pgHome.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations)
Mon Sep 3 15:52:15 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Changes since 1.5: +25 -6 lines
Made the menu on the left into images. More bugfixes.

1 ravilov 1.1 <?php
2     include_once("inc/conn.php");
3     include_once("inc/newsShow.php");
4     if ($show) {
5     $arts = newsLoad($id, $cat);
6     newsShow(array_shift($arts));
7     } else {
8     if ($del_id) {
9     include_once("inc/newsDelete.php");
10     newsDelete($del_id);
11     unset($top_edit, $wn_edit, $pn_edit);
12     }
13 ravilov 1.2 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)");
15 ravilov 1.3 $empty = array("category" => "t", "limit" => 1, "offset" => 0, "npar" => 1);
16     $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
17 ravilov 1.1 $art = array_shift($arts);
18     $ed = "";
19     if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {
20     include_once("inc/newsEdit.php");
21     $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");
22     }
23     if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
24     else {
25 ravilov 1.2 if ($ed && $ed["category"] == "t") $art = $ed;
26 ravilov 1.1 $tpl->assign("top_id", $art["id"]);
27     $tpl->assign("top_title", MyEscape($art["title"]));
28     $tpl->assign("top_lead", MyEscape($art["lead"]));
29     $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));
30     $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));
31     $tpl->assign("top_titlepic_type", $art["pic_pos"]);
32     $tpl->assign("top_titlepic_width", $art["pic_w"]);
33     $tpl->assign("top_titlepic_height", $art["pic_h"]);
34     for ($j = 0; $j < count($art["text"]); $j++)
35 ravilov 1.5 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
36 ravilov 1.1 $tpl->assign("top_text", $art["text"]);
37     include_once("inc/links.php");
38     $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],
39 ravilov 1.6 MyEscape($art["more"]), MyEscape($art["more_title"]),
40     $art["id"], $empty["category"], "top", $isEdit,
41     false, false, false));
42 ravilov 1.1 }
43 ravilov 1.6 $menu2 = array();
44 ravilov 1.3 $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "offset" => 0, "npar" => 0);
45 ravilov 1.2 $ed = "";
46 ravilov 1.1 if ($wn_edit && $ed_id <= 0) {
47     include_once("inc/newsEdit.php");
48     $ed = newsEdit($empty, "wn_edit");
49     if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
50     else $wn_edit = false;
51     }
52 ravilov 1.3 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
53 ravilov 1.1 $wn = array();
54     for ($i = 0; $i < count($arts); $i++) {
55     $art = $arts[$i];
56     $ed = "";
57     if ($wn_edit && $art["id"] == $ed_id) {
58     include_once("inc/newsEdit.php");
59 ravilov 1.2 $art["nlimit"] = count($arts);
60 ravilov 1.1 $ed = newsEdit($art, "wn_edit");
61     }
62     if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
63     else {
64 ravilov 1.2 if ($ed && $ed["category"] == "w") $art = $ed;
65 ravilov 1.1 for ($j = 0; $j < count($art["text"]); $j++)
66 ravilov 1.5 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
67 ravilov 1.1 include_once("inc/links.php");
68     array_push($wn, array(
69     "id" => $art["id"],
70     "title" => MyEscape($art["title"]),
71     "lead" => MyEscape($art["lead"]),
72     "pic" => MyEscape($art["pic_url"]),
73     "alt" => MyEscape($art["pic_alt"]),
74     "pos" => MyEscape($art["pic_pos"]),
75     "width" => MyEscape($art["pic_w"]),
76     "height" => MyEscape($art["pic_h"]),
77     "links" => GetLinks($art["read"] && $art["id"],
78 ravilov 1.6 MyEscape($art["more"]), MyEscape($art["more_title"]),
79     $art["id"], $empty["category"], "wn", $isEdit, true,
80 ravilov 1.3 ($i > 0), ($i < count($arts) - 1)),
81 ravilov 1.1 "text" => $art["text"]
82     ));
83 ravilov 1.6 array_push($menu2, array(
84     "pre" => "wn-",
85     "cat" => $empty["category"],
86     "id" => $art["id"],
87     "title" => MyEscape($art["title"]),
88     "url" => MyEscape($art["more"]),
89     "more" => MyEscape($art["read"])
90     ));
91 ravilov 1.1 }
92     }
93 ravilov 1.3 $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "offset" => 0, "npar" => 0);
94 ravilov 1.2 $ed = "";
95 ravilov 1.1 if ($pn_edit && $ed_id <= 0) {
96     include_once("inc/newsEdit.php");
97     $ed = newsEdit($empty, "pn_edit");
98     if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
99     else $pn_edit = false;
100     }
101 ravilov 1.3 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
102 ravilov 1.1 $pn = array();
103     for ($i = 0; $i < count($arts); $i++) {
104     $art = $arts[$i];
105     $ed = "";
106     if ($pn_edit && $art["id"] == $ed_id) {
107     include_once("inc/newsEdit.php");
108 ravilov 1.2 $art["nlimit"] = count($arts);
109 ravilov 1.1 $ed = newsEdit($art, "pn_edit");
110     }
111     if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
112     else {
113 ravilov 1.2 if ($ed && $ed["category"] == "p") $art = $ed;
114 ravilov 1.1 for ($j = 0; $j < count($art["text"]); $j++)
115 ravilov 1.5 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
116 ravilov 1.1 include_once("inc/links.php");
117     array_push($pn, array(
118     "id" => $art["id"],
119     "title" => MyEscape($art["title"]),
120     "lead" => MyEscape($art["lead"]),
121     "pic" => MyEscape($art["pic_url"]),
122     "alt" => MyEscape($art["pic_alt"]),
123     "pos" => MyEscape($art["pic_pos"]),
124     "width" => MyEscape($art["pic_w"]),
125     "height" => MyEscape($art["pic_h"]),
126     "links" => GetLinks($art["read"] && $art["id"],
127 ravilov 1.6 MyEscape($art["more"]), MyEscape($art["more_title"]),
128     $art["id"], $empty["category"], "pn", $isEdit, true,
129 ravilov 1.3 ($i > 0), ($i < count($arts) - 1)),
130 ravilov 1.1 "text" => MyEscape($art["text"])
131     ));
132 ravilov 1.6 array_push($menu2, array(
133     "pre" => "pn-",
134     "cat" => $empty["category"],
135     "id" => $art["id"],
136     "title" => MyEscape($art["title"]),
137     "url" => MyEscape($art["more"]),
138     "more" => MyEscape($art["read"])
139     ));
140 ravilov 1.1 }
141     }
142     $tpl->assign("wn", $wn);
143     $tpl->assign("pn", $pn);
144     $tpl->assign("top_edit", $top_edit);
145     $tpl->assign("wn_edit", $wn_edit);
146     $tpl->assign("pn_edit", $pn_edit);
147 ravilov 1.6 $tpl->assign("MENU2", $menu2);
148 ravilov 1.1 }
149     $dbh->disconnect();
150     ?>

  ViewVC Help
Powered by ViewVC 1.1.26