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

Contents of /inc/pgStanja.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Fri Sep 28 23:34:37 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Changes since 1.3: +1 -1 lines
Added some new pages to PLIVAmed. Some bugfixes.

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 $cat = "c";
18 if ($section_menu == "zensko") $cat = "z";
19 if ($section_menu == "musko") $cat = "m";
20 if ($section_menu == "majkadijete") $cat = "d";
21 if ($section_menu == "treca") $cat = "r";
22 if ($section_menu == "mladi") $cat = "e";
23 if ($section_menu == "ovisnosti") $cat = "o";
24 if (!$offset) $offset = 0;
25 $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0);
26 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 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
33 $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 "pgfs" => (count($art["text"]) > 0) ? true : false,
53 "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 /* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",
61 MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
62 $isEdit, true, ($i > 0), ($i < count($arts) - 1))
63 ));
64 }
65 }
66 $tpl->assign("top", $a2);
67 $tpl->assign("cat", $cat);
68 $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
69 $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);
70 }
71 $dbh->disconnect();
72 ?>

  ViewVC Help
Powered by ViewVC 1.1.26