/[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.6 by ravilov, Tue Sep 25 15:38:04 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                    $section_menu = "main";
6                  $arts = newsLoad($id, $cat);                  $arts = newsLoad($id, $cat);
7                  newsShow(array_shift($arts));                  newsShow(array_shift($arts));
8          } else {          } else {
9                  if ($del_id) {                  if ($isEdit) {
10                          include_once("inc/newsDelete.php");                          if ($del_id) {
11                          newsDelete($del_id);                                  include_once("inc/newsDelete.php");
12                          unset($top_edit, $wn_edit, $pn_edit);                                  newsDelete($del_id);
13                  }                                  unset($top_edit, $wn_edit, $pn_edit);
14                  $empty = array("category" => "l", "limit" => 1, "npar" => 1);                          }
15                  $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)");
16                  $art = array_shift($arts);                          if ($up_id) $dbh->dbh_do("UPDATE news SET ord = ord - 1 WHERE (news_id = $up_id)");
17                  $ed = "";                  }
18                  if ($top_edit && ($art["id"] == $ed_id || $ed_id <= 0)) {                  $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");                          include_once("inc/newsEdit.php");
46                          $ed = newsEdit(($ed_id > 0) ? $art : $empty, "top_edit");                          $ed = newsEdit($empty, "top_edit");
47                            if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
48                                    else $top_edit = false;
49                  }                  }
50                  if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);
51                  else {                  $a2 = array();
52                          if ($ed) $art = $ed;                  $lm = count($arts);
53                          $tpl->assign("top_id", $art["id"]);                  if ($lm > $empty["limit"]) $lm = $empty["limit"];
54                          $tpl->assign("top_title", MyEscape($art["title"]));                  for ($i = 0; $i < $lm; $i++) {
55                          $tpl->assign("top_lead", MyEscape($art["lead"]));                          $art = $arts[$i];
56                          $tpl->assign("top_titlepic_url", MyEscape($art["pic_url"]));                          $ed = "";
57                          $tpl->assign("top_titlepic_alt", MyEscape($art["pic_alt"]));                          if ($top_edit && ($art["id"] == $ed_id) && $isEdit) {
58                          $tpl->assign("top_titlepic_type", $art["pic_pos"]);                                  include_once("inc/newsEdit.php");
59                          $tpl->assign("top_titlepic_width", $art["pic_w"]);                                  $ed = newsEdit($art, "top_edit");
60                          $tpl->assign("top_titlepic_height", $art["pic_h"]);                          }
61                          for ($j = 0; $j < count($art["text"]); $j++)                          if ($ed && is_string($ed)) array_push($a2, array("EDIT" => $ed));
62                                  $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]));                          else {
63                          $tpl->assign("top_text", $art["text"]);                                  if ($ed && $ed["category"] == $cat) $art = $ed;
64                          include_once("inc/links.php");                                  for ($j = 0; $j < count($art["text"]); $j++)
65                          $tpl->assign("top_links", GetLinks($art["read"] && $art["id"],                                          $art["text"][$j]["text"] = ParseNewline(MyEscape($art["text"][$j]["text"]), true);
66                                  MyEscape($art["more"]), $art["id"], $empty["category"], "top"));                                  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 && $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_edit", $top_edit);                  $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();          $dbh->disconnect();
89  ?>  ?>

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

  ViewVC Help
Powered by ViewVC 1.1.26