/[health_html]/inc/pgLifestyle.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/pgLifestyle.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Mon Aug 27 09:17:40 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Changes since 1.3: +3 -2 lines
Minor bug fixes. Started the Symptom Sorter.

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.3 # ---KLUDGE-BEGIN---
14     $cat = "";
15     if ($section == "conditions") $cat = "c";
16     if ($section == "lifestyle") $cat = "l";
17     # ---KLUDGE-END---
18     if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");
19     if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");
20     if (!$offset) $offset = 0;
21     $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 1);
22     if ($top_edit && $ed_id <= 0) {
23 ravilov 1.1 include_once("inc/newsEdit.php");
24 ravilov 1.3 $ed = newsEdit($empty, "top_edit");
25     if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
26     else $top_edit = false;
27 ravilov 1.1 }
28 ravilov 1.3 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
29     $a2 = array();
30     $lm = count($arts);
31     if ($lm > $empty["limit"]) $lm = $empty["limit"];
32     for ($i = 0; $i < $lm; $i++) {
33     $art = $arts[$i];
34     $ed = "";
35     if ($top_edit && ($art["id"] == $ed_id)) {
36     include_once("inc/newsEdit.php");
37     $ed = newsEdit($art, "top_edit");
38     }
39     if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
40     else {
41     if ($ed && $ed["category"] == $cat) $art = $ed;
42     for ($j = 0; $j < count($art["text"]); $j++)
43     $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));
44     include_once("inc/links.php");
45     array_push($a2, array(
46     "id" => $art["id"],
47     "title" => MyEscape($art["title"]),
48     "lead" => MyEscape($art["lead"]),
49     "titlepic_url" => MyEscape($art["pic_url"]),
50     "titlepic_alt" => MyEscape($art["pic_alt"]),
51     "titlepic_type" => $art["pic_pos"],
52     "titlepic_width" => $art["pic_w"],
53     "titlepic_height" => $art["pic_h"],
54     "text" => $art["text"],
55     "links" => GetLinks($art["read"] && $art["id"],
56     MyEscape($art["more"]), $art["id"],
57 ravilov 1.4 $empty["category"], "top", $isEdit, true,
58 ravilov 1.3 ($i > 0), ($i < count($arts) - 1))
59     ));
60     }
61 ravilov 1.1 }
62 ravilov 1.3 $tpl->assign("top", $a2);
63     $tpl->assign("cat", $cat);
64 ravilov 1.4 $tpl->assign("isedit", $isEdit);
65     $tpl->assign("ismed", $isMed);
66 ravilov 1.3 $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
67     $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);
68 ravilov 1.1 }
69     $dbh->disconnect();
70     ?>

  ViewVC Help
Powered by ViewVC 1.1.26