/[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.7 - (show annotations)
Wed Sep 26 13:04:28 2001 UTC (22 years, 8 months ago) by ravilov
Branch: MAIN
Changes since 1.6: +1 -1 lines
Added some missing files, and some missing features...

1 <?php
2 include("inc/conn.php");
3 include_once("inc/newsShow.php");
4 if ($show) {
5 $section_menu = "main";
6 $arts = newsLoad($id, $cat);
7 newsShow(array_shift($arts));
8 } else {
9 if ($isEdit) {
10 if ($del_id) {
11 include_once("inc/newsDelete.php");
12 newsDelete($del_id);
13 unset($top_edit, $wn_edit, $pn_edit);
14 }
15 if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");
16 if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");
17 }
18 $cat = "l";
19 if ($section_menu == "sex") {
20 $cat = "x";
21 if ($section_menu2 == "qa") $cat = "q";
22 if ($section_menu2 == "rjecnik") $cat = "j";
23 }
24 if ($section_menu == "zdrava") {
25 $cat = "h";
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 == "qa") $cat = "1";
35 if ($section_menu2 == "trening") $cat = "g";
36 if ($section_menu2 == "istezanje") $cat = "s";
37 if ($section_menu2 == "ozljede") $cat = "2";
38 if ($section_menu2 == "trener") $cat = "b";
39 if ($section_menu2 == "vjezbe") $cat = "u";
40 if ($section_menu2 == "fitcenter") $cat = "k";
41 }
42 if (!$offset) $offset = 0;
43 $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0);
44 if ($top_edit && $ed_id <= 0 && $isEdit) {
45 include_once("inc/newsEdit.php");
46 $ed = newsEdit($empty, "top_edit");
47 if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
48 else $top_edit = false;
49 }
50 $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
51 $a2 = array();
52 $lm = count($arts);
53 if ($lm > $empty["limit"]) $lm = $empty["limit"];
54 for ($i = 0; $i < $lm; $i++) {
55 $art = $arts[$i];
56 $ed = "";
57 if ($top_edit && ($art["id"] == $ed_id) && $isEdit) {
58 include_once("inc/newsEdit.php");
59 $ed = newsEdit($art, "top_edit");
60 }
61 if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
62 else {
63 if ($ed && $ed["category"] == $cat) $art = $ed;
64 for ($j = 0; $j < count($art["text"]); $j++)
65 $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
66 array_push($a2, array(
67 "id" => $art["id"],
68 "title" => MyEscape($art["title"]),
69 "lead" => MyEscape($art["lead"]),
70 "titlepic_url" => MyEscape($art["pic_url"]),
71 "titlepic_alt" => MyEscape($art["pic_alt"]),
72 "titlepic_type" => $art["pic_pos"],
73 "titlepic_width" => $art["pic_w"],
74 "titlepic_height" => $art["pic_h"],
75 "text" => $art["text"],
76 "links" => GetLinks($art["read"] && $art["id"],
77 /* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",
78 MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
79 $isEdit, true, ($i > 0), ($i < count($arts) - 1))
80 ));
81 }
82 }
83 $tpl->assign("top", $a2);
84 $tpl->assign("cat", $cat);
85 $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
86 $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);
87 }
88 $dbh->disconnect();
89 ?>

  ViewVC Help
Powered by ViewVC 1.1.26