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

Contents of /inc/pgHome.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Fri Aug 3 10:02:49 2001 UTC (22 years, 8 months ago) by ravilov
Branch: MAIN
Branch point for: pliva
Initial revision

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 $empty = array("category" => "t", "limit" => 1, "npar" => 1);
14 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);
15 $art = array_shift($arts);
16 $ed = "";
17 if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {
18 include_once("inc/newsEdit.php");
19 $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");
20 }
21 if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
22 else {
23 if ($ed) $art = $ed;
24 $tpl->assign("top_id", $art["id"]);
25 $tpl->assign("top_title", MyEscape($art["title"]));
26 $tpl->assign("top_lead", MyEscape($art["lead"]));
27 $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));
28 $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));
29 $tpl->assign("top_titlepic_type", $art["pic_pos"]);
30 $tpl->assign("top_titlepic_width", $art["pic_w"]);
31 $tpl->assign("top_titlepic_height", $art["pic_h"]);
32 for ($j = 0; $j < count($art["text"]); $j++)
33 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));
34 $tpl->assign("top_text", $art["text"]);
35 include_once("inc/links.php");
36 $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],
37 MyEscape($art["more"]), $art["id"], $empty["category"], "top"));
38 }
39 $empty = array("category" => "w", "limit" => ($wn_edit ? 4 : 5), "npar" => 0);
40 if ($wn_edit && $ed_id <= 0) {
41 include_once("inc/newsEdit.php");
42 $ed = newsEdit($empty, "wn_edit");
43 if ($ed && is_string($ed)) $tpl->assign("WN_EDIT", $ed);
44 else $wn_edit = false;
45 }
46 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);
47 $wn = array();
48 for ($i = 0; $i < count($arts); $i++) {
49 $art = $arts[$i];
50 $ed = "";
51 if ($wn_edit && $art["id"] == $ed_id) {
52 include_once("inc/newsEdit.php");
53 $ed = newsEdit($art, "wn_edit");
54 }
55 if ($ed && is_string($ed)) array_push($wn, array("EDIT" => $ed));
56 else {
57 if ($ed) $art = $ed;
58 for ($j = 0; $j < count($art["text"]); $j++)
59 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));
60 include_once("inc/links.php");
61 array_push($wn, array(
62 "id" => $art["id"],
63 "title" => MyEscape($art["title"]),
64 "lead" => MyEscape($art["lead"]),
65 "pic" => MyEscape($art["pic_url"]),
66 "alt" => MyEscape($art["pic_alt"]),
67 "pos" => MyEscape($art["pic_pos"]),
68 "width" => MyEscape($art["pic_w"]),
69 "height" => MyEscape($art["pic_h"]),
70 "links" => GetLinks($art["read"] && $art["id"],
71 MyEscape($art["more"]), $art["id"],
72 $empty["category"], "wn"),
73 "text" => $art["text"]
74 ));
75 }
76 }
77 $empty = array("category" => "p", "limit" => ($pn_edit ? 4 : 5), "npar" => 0);
78 if ($pn_edit && $ed_id <= 0) {
79 include_once("inc/newsEdit.php");
80 $ed = newsEdit($empty, "pn_edit");
81 if ($ed && is_string($ed)) $tpl->assign("PN_EDIT", $ed);
82 else $pn_edit = false;
83 }
84 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);
85 $pn = array();
86 for ($i = 0; $i < count($arts); $i++) {
87 $art = $arts[$i];
88 $ed = "";
89 if ($pn_edit && $art["id"] == $ed_id) {
90 include_once("inc/newsEdit.php");
91 $ed = newsEdit($art, "pn_edit");
92 }
93 if ($ed && is_string($ed)) array_push($pn, array("EDIT" => $ed));
94 else {
95 if ($ed) $art = $ed;
96 for ($j = 0; $j < count($art["text"]); $j++)
97 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));
98 include_once("inc/links.php");
99 array_push($pn, array(
100 "id" => $art["id"],
101 "title" => MyEscape($art["title"]),
102 "lead" => MyEscape($art["lead"]),
103 "pic" => MyEscape($art["pic_url"]),
104 "alt" => MyEscape($art["pic_alt"]),
105 "pos" => MyEscape($art["pic_pos"]),
106 "width" => MyEscape($art["pic_w"]),
107 "height" => MyEscape($art["pic_h"]),
108 "links" => GetLinks($art["read"] && $art["id"],
109 MyEscape($art["more"]), $art["id"],
110 $empty["category"], "pn"),
111 "text" => MyEscape($art["text"])
112 ));
113 }
114 }
115 $tpl->assign("wn", $wn);
116 $tpl->assign("pn", $pn);
117 $tpl->assign("top_edit", $top_edit);
118 $tpl->assign("wn_edit", $wn_edit);
119 $tpl->assign("pn_edit", $pn_edit);
120 }
121 $dbh->disconnect();
122 ?>

  ViewVC Help
Powered by ViewVC 1.1.26