/[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.9 by ravilov, Tue Oct 2 16:18:09 2001 UTC revision 1.13 by ravilov, Tue Oct 23 16:13:59 2001 UTC
# Line 13  Line 13 
13                          }                          }
14                          if ($down_id) $dbh->dbh_do("UPDATE news SET ord = ord + 1 WHERE (news_id = $down_id)");                          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)");                          if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");
16                            if ($flip_id) $dbh->dbh_do("UPDATE news SET prikazi = NOT prikazi WHERE (news_id = $flip_id)");
17                  }                  }
18                  $cat = "l";                  $cat = "l"; $acat = "l";
19                  if ($section_menu == "sex") {                  if ($section_menu == "sex") {
20                          $cat = "x";                          $cat = "x"; $acat2 = "x";
                         # if ($section_menu2 == "qa") $cat = "q";  
21                          if ($section_menu2 == "rjecnik") $cat = "j";                          if ($section_menu2 == "rjecnik") $cat = "j";
22                  }                  }
23                  if ($section_menu == "zdrava") {                  if ($section_menu == "zdrava") {
24                          $cat = "h";                          $cat = "h"; $acat2 = "z";
25                          if ($section_menu2 == "tema") $cat = "a";                          if ($section_menu2 == "tema") $cat = "a";
26                          if ($section_menu2 == "nutri") $cat = "n";                          if ($section_menu2 == "nutri") $cat = "n";
                         # if ($section_menu2 == "qa") $cat = "a";  
27                          if ($section_menu2 == "kuhanje") $cat = "v";                          if ($section_menu2 == "kuhanje") $cat = "v";
                         # if ($section_menu2 == "dtd") $cat = "y";  
                         # if ($section_menu2 == "vrijednosti") $cat = "i";  
28                  }                  }
29                  if ($section_menu == "fitness") {                  if ($section_menu == "fitness") {
30                          $cat = "f";                          $cat = "f"; $acat2 = "f";
31                          if ($section_menu2 == "tema") $cat = "1";                          if ($section_menu2 == "tema") $cat = "1";
                         # if ($section_menu2 == "qa") $cat = "1";  
32                          if ($section_menu2 == "trening") $cat = "g";                          if ($section_menu2 == "trening") $cat = "g";
33                          if ($section_menu2 == "istezanje") $cat = "s";                          if ($section_menu2 == "istezanje") $cat = "s";
34                          if ($section_menu2 == "ozljede") $cat = "2";                          if ($section_menu2 == "ozljede") $cat = "2";
35                          # if ($section_menu2 == "trener") $cat = "b";                          # if ($section_menu2 == "trener") $cat = "b";
36                          if ($section_menu2 == "vjezbe") $cat = "u";                          if ($section_menu2 == "vjezbe") $cat = "u";
                         # if ($section_menu2 == "fitcenter") $cat = "k";  
37                  }                  }
38                  if ($cat == "x") {                  if ($cat == "x") {
39                          $empty = array("category" => "y", "limit" => 1, "offset" => 0, "npar" => 0);                          $empty = array("category" => "y", "limit" => 1, "offset" => 0, "npar" => 0);
# Line 65  Line 60 
60                                  for ($j = 0; $j < count($art["text"]); $j++)                                  for ($j = 0; $j < count($art["text"]); $j++)
61                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
62                                  $tpl->assign("kol_text", $art["text"]);                                  $tpl->assign("kol_text", $art["text"]);
                                 include_once("inc/author.php");  
63                                  $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],                                  $tpl->assign("AUTHOR", GetAuthor($art["au_pic"],
64                                          $art["au_alt"], $art["au_info"],                                          $art["au_alt"], $art["au_info"],
65                                          $art["au_w"], $art["au_h"]));                                          $art["au_w"], $art["au_h"], $art["au_cv"]));
66                                  $tpl->assign("kol_links", GetLinks($art["read"] && $art["id"],                                  $tpl->assign("kol_links", GetLinks(
67                                          /* MyEscape($art["more"]) */ (count($art["text"]) > 0 && $art["id"]) ? $art["more"] : "",                                          (($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"],                                          MyEscape($art["more_title"]), $art["id"], $empty["category"],
70                                          "kol", $isEdit, false, false, false));                                          "kol", false, false, false, $art["show"], $art["related"]));
71                                  $tpl->assign("kol_read", $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false);                                  $tpl->assign("kol_read", $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : "");
72                          }                          }
73                  }                  }
74                  if (!$offset) $offset = 0;                  if (!$offset) $offset = 0;
75                  $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0);                  $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) {                  if ($top_edit && $ed_id <= 0 && $isEdit) {
90                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
91                          $ed = newsEdit($empty, "top_edit");                          $ed = newsEdit($empty, "top_edit");
92                          if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
93                                  else $top_edit = false;                                  else $top_edit = false;
94                  }                  }
95                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]);
96                  $a2 = array();                  $a2 = array();
97                  $lm = count($arts);                  $lm = count($arts);
98                  if ($lm > $empty["limit"]) $lm = $empty["limit"];                  if ($lm > $empty["limit"]) $lm = $empty["limit"];
# Line 111  Line 119 
119                                          "titlepic_width" => $art["pic_w"],                                          "titlepic_width" => $art["pic_w"],
120                                          "titlepic_height" => $art["pic_h"],                                          "titlepic_height" => $art["pic_h"],
121                                          "text" => $art["text"],                                          "text" => $art["text"],
122                                          "links" => GetLinks($art["read"] && $art["id"],                                          "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"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",                                                  /* MyEscape($art["more"]) */ (strstr("?", $art["more"]) == 0 && $art["id"]) ? $art["more"] : "",
124                                                  MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",                                                  MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
125                                                  $isEdit, true, ($i > 0), ($i < count($arts) - 1)),                                                  true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
126                                          "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? true : false                                          "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : ""
127                                  ));                                  ));
128                          }                          }
129                  }                  }
130                  $tpl->assign("top", $a2);                  $tpl->assign("top", $a2);
131                  $tpl->assign("cat", $cat);                  $tpl->assign("cat", $cat);
132                  $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);                  $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
133                  $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);                  $tpl->assign("prev", $offset ? ($offset - 10) : 0);
134                    $tpl->assign("offset", $offset);
135          }          }
136          $dbh->disconnect();          $dbh->disconnect();
137  ?>  ?>

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

  ViewVC Help
Powered by ViewVC 1.1.26