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

Contents of /inc/pgLifestyle.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations)
Fri Sep 28 23:34:37 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Changes since 1.7: +10 -8 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 = "l";
18 if ($section_menu == "sex") {
19 $cat = "x";
20 # if ($section_menu2 == "qa") $cat = "q";
21 if ($section_menu2 == "rjecnik") $cat = "j";
22 }
23 if ($section_menu == "zdrava") {
24 $cat = "h";
25 if ($section_menu2 == "tema") $cat = "a";
26 if ($section_menu2 == "nutri") $cat = "n";
27 # if ($section_menu2 == "qa") $cat = "a";
28 if ($section_menu2 == "kuhanje") $cat = "v";
29 # if ($section_menu2 == "dtd") $cat = "y";
30 # if ($section_menu2 == "vrijednosti") $cat = "i";
31 }
32 if ($section_menu == "fitness") {
33 $cat = "f";
34 if ($section_menu2 == "tema") $cat = "1";
35 # if ($section_menu2 == "qa") $cat = "1";
36 if ($section_menu2 == "trening") $cat = "g";
37 if ($section_menu2 == "istezanje") $cat = "s";
38 if ($section_menu2 == "ozljede") $cat = "2";
39 # if ($section_menu2 == "trener") $cat = "b";
40 if ($section_menu2 == "vjezbe") $cat = "u";
41 # if ($section_menu2 == "fitcenter") $cat = "k";
42 }
43 if (!$offset) $offset = 0;
44 $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0);
45 if ($top_edit && $ed_id <= 0 && $isEdit) {
46 include_once("inc/newsEdit.php");
47 $ed = newsEdit($empty, "top_edit");
48 if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
49 else $top_edit = false;
50 }
51 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
52 $a2 = array();
53 $lm = count($arts);
54 if ($lm > $empty["limit"]) $lm = $empty["limit"];
55 for ($i = 0; $i < $lm; $i++) {
56 $art = $arts[$i];
57 $ed = "";
58 if ($top_edit && ($art["id"] == $ed_id) && $isEdit) {
59 include_once("inc/newsEdit.php");
60 $ed = newsEdit($art, "top_edit");
61 }
62 if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
63 else {
64 if ($ed && $ed["category"] == $cat) $art = $ed;
65 for ($j = 0; $j < count($art["text"]); $j++)
66 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
67 array_push($a2, array(
68 "id" => $art["id"],
69 "title" => MyEscape($art["title"]),
70 "lead" => MyEscape($art["lead"]),
71 "pgfs" => (count($art["text"]) > 0) ? true : false,
72 "titlepic_url" => MyEscape($art["pic_url"]),
73 "titlepic_alt" => MyEscape($art["pic_alt"]),
74 "titlepic_type" => $art["pic_pos"],
75 "titlepic_width" => $art["pic_w"],
76 "titlepic_height" => $art["pic_h"],
77 "text" => $art["text"],
78 "links" => GetLinks($art["read"] && $art["id"],
79 /* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",
80 MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
81 $isEdit, true, ($i > 0), ($i < count($arts) - 1))
82 ));
83 }
84 }
85 $tpl->assign("top", $a2);
86 $tpl->assign("cat", $cat);
87 $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
88 $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);
89 }
90 $dbh->disconnect();
91 ?>

  ViewVC Help
Powered by ViewVC 1.1.26