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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 ravilov 1.1 <?php
2     include("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 ($isEdit) {
9     if ($del_id) {
10     include_once("inc/newsDelete.php");
11     newsDelete($del_id);
12     unset($top_edit, $wn_edit, $pn_edit);
13     }
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     }
17 ravilov 1.3 $cat = "i"; $acat = "z";
18 ravilov 1.1 if (!$offset) $offset = 0;
19     $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0);
20     if ($top_edit && $ed_id <= 0 && $isEdit) {
21     include_once("inc/newsEdit.php");
22     $ed = newsEdit($empty, "top_edit");
23     if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
24     else $top_edit = false;
25     }
26     $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
27     $a2 = array();
28     $lm = count($arts);
29     if ($lm > $empty["limit"]) $lm = $empty["limit"];
30     for ($i = 0; $i < $lm; $i++) {
31     $art = $arts[$i];
32     $ed = "";
33     if ($top_edit && ($art["id"] == $ed_id)) {
34     include_once("inc/newsEdit.php");
35     $ed = newsEdit($art, "top_edit");
36     }
37     if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
38     else {
39     if ($ed && $ed["category"] == $cat) $art = $ed;
40     for ($j = 0; $j < count($art["text"]); $j++)
41     $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
42     include_once("inc/author.php");
43     array_push($a2, array(
44     "id" => $art["id"],
45     "title" => MyEscape($art["title"]),
46     "lead" => MyEscape($art["lead"]),
47     "pgfs" => (count($art["text"]) > 0) ? true : false,
48     "titlepic_url" => MyEscape($art["pic_url"]),
49     "titlepic_alt" => MyEscape($art["pic_alt"]),
50     "titlepic_type" => $art["pic_pos"],
51     "titlepic_width" => $art["pic_w"],
52     "titlepic_height" => $art["pic_h"],
53     "text" => $art["text"],
54     "links" => GetLinks($art["read"] && $art["id"],
55     /* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",
56     MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
57     $isEdit, true, ($i > 0), ($i < count($arts) - 1)),
58 ravilov 1.3 "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "",
59 ravilov 1.1 "AUTHOR" => GetAuthor($art["au_pic"],
60     $art["au_alt"], $art["au_info"],
61     $art["au_w"], $art["au_h"])
62     ));
63     }
64     }
65     $tpl->assign("top", $a2);
66     $tpl->assign("cat", $cat);
67     $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
68     $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);
69     }
70     $dbh->disconnect();
71     ?>

  ViewVC Help
Powered by ViewVC 1.1.26