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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations)
Thu Oct 4 14:59:35 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Changes since 1.6: +12 -11 lines
Added the archive. Some more bug fixes.

1 ravilov 1.1 <?php
2 ravilov 1.2 include("inc/conn.php");
3 ravilov 1.1 include_once("inc/newsShow.php");
4     if ($show) {
5     $arts = newsLoad($id, $cat);
6     newsShow(array_shift($arts));
7     } else {
8 ravilov 1.2 if ($isEdit) {
9     if ($del_id) {
10     include_once("inc/newsDelete.php");
11     newsDelete($del_id);
12 ravilov 1.6 unset($top_edit);
13 ravilov 1.2 }
14     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)");
16 ravilov 1.1 }
17 ravilov 1.7 $cat = "c"; $acat = "s";
18     if ($section_menu == "zensko") { $cat = "z"; $acat2 = "z"; }
19     if ($section_menu == "musko") { $cat = "m"; $acat2 = "m"; }
20     if ($section_menu == "mid") { $cat = "d"; $acat2 = "d"; }
21     if ($section_menu == "treca") { $cat = "r"; $acat2 = "t"; }
22     if ($section_menu == "mladi") { $cat = "e"; $acat2 = "l"; }
23     if ($section_menu == "ovisnosti") { $cat = "o"; $acat2 = "o"; }
24 ravilov 1.1 if (!$offset) $offset = 0;
25 ravilov 1.7 $empty = array("category" => $cat, "limit" => 10, "offset" => $offset, "npar" => 0);
26 ravilov 1.1 if ($top_edit && $ed_id <= 0 && $isEdit) {
27     include_once("inc/newsEdit.php");
28     $ed = newsEdit($empty, "top_edit");
29     if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
30     else $top_edit = false;
31     }
32 ravilov 1.7 $arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]);
33 ravilov 1.1 $a2 = array();
34     $lm = count($arts);
35     if ($lm > $empty["limit"]) $lm = $empty["limit"];
36     for ($i = 0; $i < $lm; $i++) {
37     $art = $arts[$i];
38     $ed = "";
39     if ($top_edit && ($art["id"] == $ed_id)) {
40     include_once("inc/newsEdit.php");
41     $ed = newsEdit($art, "top_edit");
42     }
43     if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
44     else {
45     if ($ed && $ed["category"] == $cat) $art = $ed;
46     for ($j = 0; $j < count($art["text"]); $j++)
47     $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
48     array_push($a2, array(
49     "id" => $art["id"],
50     "title" => MyEscape($art["title"]),
51     "lead" => MyEscape($art["lead"]),
52 ravilov 1.4 "pgfs" => (count($art["text"]) > 0) ? true : false,
53 ravilov 1.1 "titlepic_url" => MyEscape($art["pic_url"]),
54     "titlepic_alt" => MyEscape($art["pic_alt"]),
55     "titlepic_type" => $art["pic_pos"],
56     "titlepic_width" => $art["pic_w"],
57     "titlepic_height" => $art["pic_h"],
58     "text" => $art["text"],
59     "links" => GetLinks($art["read"] && $art["id"],
60 ravilov 1.3 /* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",
61 ravilov 1.2 MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
62 ravilov 1.6 $isEdit, true, ($i > 0), ($i < count($arts) - 1)),
63 ravilov 1.7 "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : ""
64 ravilov 1.1 ));
65     }
66     }
67     $tpl->assign("top", $a2);
68     $tpl->assign("cat", $cat);
69     $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
70 ravilov 1.7 $tpl->assign("prev", $offset ? ($offset - 10) : 0);
71     $tpl->assign("offset", $offset);
72 ravilov 1.1 }
73     $dbh->disconnect();
74     ?>

  ViewVC Help
Powered by ViewVC 1.1.26