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

Diff of /inc/pgLifestyle.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by ravilov, Fri Aug 3 10:03:20 2001 UTC revision 1.13 by ravilov, Tue Oct 23 16:13:59 2001 UTC
# Line 1  Line 1 
1  <?php  <?php
2          include_once("inc/conn.php");          include("inc/conn.php");
3          include_once("inc/newsShow.php");          include_once("inc/newsShow.php");
4          if ($show) {          if ($show) {
5                  $arts = newsLoad($id, $cat);                  $arts = newsLoad($id, $cat);
6                  newsShow(array_shift($arts));                  newsShow(array_shift($arts));
7          } else {          } else {
8                  if ($del_id) {                  if ($isEdit) {
9                          include_once("inc/newsDelete.php");                          if ($del_id) {
10                          newsDelete($del_id);                                  include_once("inc/newsDelete.php");
11                          unset($top_edit, $wn_edit, $pn_edit);                                  newsDelete($del_id);
12                  }                                  unset($top_edit);
13                  $empty = array("category" => "l", "limit" => 1, "npar" => 1);                          }
14                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["npar"]);                          if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");
15                  $art = array_shift($arts);                          if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");
16                  $ed = "";                          if ($flip_id) $dbh->dbh_do("UPDATE news SET prikazi = NOT prikazi WHERE (news_id = $flip_id)");
17                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {                  }
18                    $cat = "l"; $acat = "l";
19                    if ($section_menu == "sex") {
20                            $cat = "x"; $acat2 = "x";
21                            if ($section_menu2 == "rjecnik") $cat = "j";
22                    }
23                    if ($section_menu == "zdrava") {
24                            $cat = "h"; $acat2 = "z";
25                            if ($section_menu2 == "tema") $cat = "a";
26                            if ($section_menu2 == "nutri") $cat = "n";
27                            if ($section_menu2 == "kuhanje") $cat = "v";
28                    }
29                    if ($section_menu == "fitness") {
30                            $cat = "f"; $acat2 = "f";
31                            if ($section_menu2 == "tema") $cat = "1";
32                            if ($section_menu2 == "trening") $cat = "g";
33                            if ($section_menu2 == "istezanje") $cat = "s";
34                            if ($section_menu2 == "ozljede") $cat = "2";
35                            # if ($section_menu2 == "trener") $cat = "b";
36                            if ($section_menu2 == "vjezbe") $cat = "u";
37                    }
38                    if ($cat == "x") {
39                            $empty = array("category" => "y", "limit" => 1, "offset" => 0, "npar" => 0);
40                            include_once("inc/newsShow.php");
41                            $art = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
42                            $art = array_shift($art);
43                            $ed = "";
44                            if ($kol_edit && ($art["id"] == $ed_id || $ed_id <= 0) && $isEdit) {
45                                    include_once("inc/newsEdit.php");
46                                    $ed = newsEdit(($ed_id > 0) ? $art : $empty, "kol_edit");
47                            }
48                            if ($ed && is_string($ed)) $tpl->assign("KOL_EDIT", $ed);
49                            else {
50                                    if ($ed && $ed["category"] == "y") $art = $ed;
51                                    $tpl->assign("kol_id", $art["id"]);
52                                    $tpl->assign("kol_title", MyEscape($art["title"]));
53                                    $tpl->assign("kol_lead", MyEscape($art["lead"]));
54                                    $tpl->assign("kol_pgfs", (count($art["text"]) > 0) ? true : false);
55                                    $tpl->assign("kol_titlepic_url", MyEscape($art["pic_url"]));
56                                    $tpl->assign("kol_titlepic_alt", MyEscape($art["pic_alt"]));
57                                    $tpl->assign("kol_titlepic_type", $art["pic_pos"]);
58                                    $tpl->assign("kol_titlepic_width", $art["pic_w"]);
59                                    $tpl->assign("kol_titlepic_height", $art["pic_h"]);
60                                    for ($j = 0; $j < count($art["text"]); $j++)
61                                            $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
62                                    $tpl->assign("kol_text", $art["text"]);
63                                    $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],
64                                            $art["au_alt"], $art["au_info"],
65                                            $art["au_w"], $art["au_h"], $art["au_cv"]));
66                                    $tpl->assign("kol_links", GetLinks(
67                                            (($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "",
68                                            /* MyEscape($art["more"]) */  (strstr("?", $art["more"]) == 0 && $art["id"]) ? $art["more"] : "",
69                                            MyEscape($art["more_title"]), $art["id"], $empty["category"],
70                                            "kol", false, false, false, $art["show"], $art["related"]));
71                                    $tpl->assign("kol_read", $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "");
72                            }
73                    }
74                    if (!$offset) $offset = 0;
75                    $empty = array("category" => $cat, "limit" => 10, "offset" => $offset, "npar" => 0);
76                    $arts = newsLoad(-1, $empty["category"], $empty["limit"], 0, $empty["npar"]);
77                    $a2 = array();
78                    for ($i = 0; $i < count($arts); $i++) {
79                            array_push($a2, array(
80                                    "cat" => $empty["category"],
81                                    "id" => $arts[$i]["id"],
82                                    "title" => MyEscape($arts[$i]["title"]),
83                                    "abs" => $offset ? true : false
84                            ));
85                    }
86                    $tpl->assign("MENU2", array(
87                            array("title" => "", "class" => "head", "pre" => "", "items" => $a2)
88                    ));
89                    if ($top_edit && $ed_id <= 0 && $isEdit) {
90                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
91                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");                          $ed = newsEdit($empty, "top_edit");
92                            if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
93                                    else $top_edit = false;
94                  }                  }
95                  if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]);
96                  else {                  $a2 = array();
97                          if ($ed) $art = $ed;                  $lm = count($arts);
98                          $tpl->assign("top_id", $art["id"]);                  if ($lm > $empty["limit"]) $lm = $empty["limit"];
99                          $tpl->assign("top_title", MyEscape($art["title"]));                  for ($i = 0; $i < $lm; $i++) {
100                          $tpl->assign("top_lead", MyEscape($art["lead"]));                          $art = $arts[$i];
101                          $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));                          $ed = "";
102                          $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));                          if ($top_edit && ($art["id"] == $ed_id) && $isEdit) {
103                          $tpl->assign("top_titlepic_type", $art["pic_pos"]);                                  include_once("inc/newsEdit.php");
104                          $tpl->assign("top_titlepic_width", $art["pic_w"]);                                  $ed = newsEdit($art, "top_edit");
105                          $tpl->assign("top_titlepic_height", $art["pic_h"]);                          }
106                          for ($j = 0; $j < count($art["text"]); $j++)                          if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
107                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                          else {
108                          $tpl->assign("top_text", $art["text"]);                                  if ($ed && $ed["category"] == $cat) $art = $ed;
109                          include_once("inc/links.php");                                  for ($j = 0; $j < count($art["text"]); $j++)
110                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
111                                  MyEscape($art["more"]), $art["id"], $empty["category"], "top"));                                  array_push($a2, array(
112                                            "id" => $art["id"],
113                                            "title" => MyEscape($art["title"]),
114                                            "lead" => MyEscape($art["lead"]),
115                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
116                                            "titlepic_url" => MyEscape($art["pic_url"]),
117                                            "titlepic_alt" => MyEscape($art["pic_alt"]),
118                                            "titlepic_type" => $art["pic_pos"],
119                                            "titlepic_width" => $art["pic_w"],
120                                            "titlepic_height" => $art["pic_h"],
121                                            "text" => $art["text"],
122                                            "links" => GetLinks((($art["read"] || $art["au_pic"] || $art["au_info"]) && $art["id"] && (!$art["more"] || ($art["more"] && !strpos($art["more"], "?")))) ? $art["read"] : "",
123                                                    /* MyEscape($art["more"]) */ (strstr("?", $art["more"]) == 0 && $art["id"]) ? $art["more"] : "",
124                                                    MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
125                                                    true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
126                                            "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : ""
127                                    ));
128                            }
129                  }                  }
130                  $tpl->assign("top_edit", $top_edit);                  $tpl->assign("top", $a2);
131                    $tpl->assign("cat", $cat);
132                    $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
133                    $tpl->assign("prev", $offset ? ($offset - 10) : 0);
134                    $tpl->assign("offset", $offset);
135          }          }
136          $dbh->disconnect();          $dbh->disconnect();
137  ?>  ?>

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.26