/[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.10 - (hide annotations)
Tue Oct 23 16:13:59 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
Added an author's CV. Added a secondary main article. Added the Related fields to news editor, and also fixed some bugs in it. Other bugfixes and improvements.

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.8 if ($flip_id) $dbh->dbh_do("UPDATE news SET prikazi = NOT prikazi WHERE (news_id = $flip_id)");
17 ravilov 1.1 }
18 ravilov 1.7 $cat = "c"; $acat = "s";
19     if ($section_menu == "zensko") { $cat = "z"; $acat2 = "z"; }
20     if ($section_menu == "musko") { $cat = "m"; $acat2 = "m"; }
21     if ($section_menu == "mid") { $cat = "d"; $acat2 = "d"; }
22     if ($section_menu == "treca") { $cat = "r"; $acat2 = "t"; }
23     if ($section_menu == "mladi") { $cat = "e"; $acat2 = "l"; }
24     if ($section_menu == "ovisnosti") { $cat = "o"; $acat2 = "o"; }
25 ravilov 1.1 if (!$offset) $offset = 0;
26 ravilov 1.7 $empty = array("category" => $cat, "limit" => 10, "offset" => $offset, "npar" => 0);
27 ravilov 1.1 if ($top_edit && $ed_id <= 0 && $isEdit) {
28     include_once("inc/newsEdit.php");
29     $ed = newsEdit($empty, "top_edit");
30     if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
31     else $top_edit = false;
32     }
33 ravilov 1.8 $arts = newsLoad(-1, $empty["category"], $empty["limit"], 0, $empty["npar"]);
34     $a2 = array();
35     for ($i = 0; $i < count($arts); $i++) {
36     array_push($a2, array(
37     "cat" => $empty["category"],
38     "id" => $arts[$i]["id"],
39     "title" => MyEscape($arts[$i]["title"]),
40     "abs" => $offset ? true : false
41     ));
42     }
43     $tpl->assign("MENU2", array(
44     array("title" => "", "class" => "head", "pre" => "", "items" => $a2)
45     ));
46 ravilov 1.7 $arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]);
47 ravilov 1.1 $a2 = array();
48     $lm = count($arts);
49     if ($lm > $empty["limit"]) $lm = $empty["limit"];
50     for ($i = 0; $i < $lm; $i++) {
51     $art = $arts[$i];
52     $ed = "";
53     if ($top_edit && ($art["id"] == $ed_id)) {
54     include_once("inc/newsEdit.php");
55     $ed = newsEdit($art, "top_edit");
56     }
57     if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
58     else {
59     if ($ed && $ed["category"] == $cat) $art = $ed;
60     for ($j = 0; $j < count($art["text"]); $j++)
61     $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
62     array_push($a2, array(
63     "id" => $art["id"],
64     "title" => MyEscape($art["title"]),
65     "lead" => MyEscape($art["lead"]),
66 ravilov 1.4 "pgfs" => (count($art["text"]) > 0) ? true : false,
67 ravilov 1.1 "titlepic_url" => MyEscape($art["pic_url"]),
68     "titlepic_alt" => MyEscape($art["pic_alt"]),
69     "titlepic_type" => $art["pic_pos"],
70     "titlepic_width" => $art["pic_w"],
71     "titlepic_height" => $art["pic_h"],
72     "text" => $art["text"],
73 ravilov 1.9 "links" => GetLinks((($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "",
74 ravilov 1.8 /* MyEscape($art["more"]) */ /* ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "", */ "",
75 ravilov 1.2 MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
76 ravilov 1.10 true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
77 ravilov 1.7 "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : ""
78 ravilov 1.1 ));
79     }
80     }
81     $tpl->assign("top", $a2);
82     $tpl->assign("cat", $cat);
83     $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
84 ravilov 1.7 $tpl->assign("prev", $offset ? ($offset - 10) : 0);
85     $tpl->assign("offset", $offset);
86 ravilov 1.1 }
87     $dbh->disconnect();
88     ?>

  ViewVC Help
Powered by ViewVC 1.1.26