/[health_html]/inc/pgStanja.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/pgStanja.php

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

revision 1.3 by ravilov, Wed Sep 26 13:04:28 2001 UTC revision 1.10 by ravilov, Tue Oct 23 16:13:59 2001 UTC
# Line 2  Line 2 
2          include("inc/conn.php");          include("inc/conn.php");
3          include_once("inc/newsShow.php");          include_once("inc/newsShow.php");
4          if ($show) {          if ($show) {
                 $section_menu = "main";  
5                  $arts = newsLoad($id, $cat);                  $arts = newsLoad($id, $cat);
6                  newsShow(array_shift($arts));                  newsShow(array_shift($arts));
7          } else {          } else {
# Line 10  Line 9 
9                          if ($del_id) {                          if ($del_id) {
10                                  include_once("inc/newsDelete.php");                                  include_once("inc/newsDelete.php");
11                                  newsDelete($del_id);                                  newsDelete($del_id);
12                                  unset($top_edit, $wn_edit, $pn_edit);                                  unset($top_edit);
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 = "c";                  $cat = "c"; $acat = "s";
19                  if ($section_menu == "zensko") $cat = "z";                  if ($section_menu == "zensko") { $cat = "z"; $acat2 = "z"; }
20                  if ($section_menu == "musko") $cat = "m";                  if ($section_menu == "musko") { $cat = "m"; $acat2 = "m"; }
21                  if ($section_menu == "majkadijete") $cat = "d";                  if ($section_menu == "mid") { $cat = "d"; $acat2 = "d"; }
22                  if ($section_menu == "treca") $cat = "r";                  if ($section_menu == "treca") { $cat = "r"; $acat2 = "t"; }
23                  if ($section_menu == "mladi") $cat = "e";                  if ($section_menu == "mladi") { $cat = "e"; $acat2 = "l"; }
24                  if ($section_menu == "ovisnosti") $cat = "o";                  if ($section_menu == "ovisnosti") { $cat = "o"; $acat2 = "o"; }
25                  if (!$offset) $offset = 0;                  if (!$offset) $offset = 0;
26                  $empty = array("category" => $cat, "limit" => 11, "offset" => $offset, "npar" => 0);                  $empty = array("category" => $cat, "limit" => 10, "offset" => $offset, "npar" => 0);
27                  if ($top_edit && $ed_id <= 0 && $isEdit) {                  if ($top_edit && $ed_id <= 0 && $isEdit) {
28                          include_once("inc/newsEdit.php");                          include_once("inc/newsEdit.php");
29                          $ed = newsEdit($empty, "top_edit");                          $ed = newsEdit($empty, "top_edit");
30                          if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);                          if ($ed && is_string($ed)) $tpl->assign("EDIT", $ed);
31                                  else $top_edit = false;                                  else $top_edit = false;
32                  }                  }
33                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], $empty["offset"], $empty["npar"]);                  $arts = newsLoad(-1, $empty["category"], $empty["limit"], 0, $empty["npar"]);
34                    $a2 = array();
35                    for ($i = 0; $i < count($arts); $i++) {
36                            array_push($a2, array(
37                                    "cat" => $empty["category"],
38                                    "id" => $arts[$i]["id"],
39                                    "title" => MyEscape($arts[$i]["title"]),
40                                    "abs" => $offset ? true : false
41                            ));
42                    }
43                    $tpl->assign("MENU2", array(
44                            array("title" => "", "class" => "head", "pre" => "", "items" => $a2)
45                    ));
46                    $arts = newsLoad(-1, $empty["category"], $empty["limit"] + 1, $empty["offset"], $empty["npar"]);
47                  $a2 = array();                  $a2 = array();
48                  $lm = count($arts);                  $lm = count($arts);
49                  if ($lm > $empty["limit"]) $lm = $empty["limit"];                  if ($lm > $empty["limit"]) $lm = $empty["limit"];
# Line 50  Line 63 
63                                          "id" => $art["id"],                                          "id" => $art["id"],
64                                          "title" => MyEscape($art["title"]),                                          "title" => MyEscape($art["title"]),
65                                          "lead" => MyEscape($art["lead"]),                                          "lead" => MyEscape($art["lead"]),
66                                            "pgfs" => (count($art["text"]) > 0) ? true : false,
67                                          "titlepic_url" => MyEscape($art["pic_url"]),                                          "titlepic_url" => MyEscape($art["pic_url"]),
68                                          "titlepic_alt" => MyEscape($art["pic_alt"]),                                          "titlepic_alt" => MyEscape($art["pic_alt"]),
69                                          "titlepic_type" => $art["pic_pos"],                                          "titlepic_type" => $art["pic_pos"],
70                                          "titlepic_width" => $art["pic_w"],                                          "titlepic_width" => $art["pic_w"],
71                                          "titlepic_height" => $art["pic_h"],                                          "titlepic_height" => $art["pic_h"],
72                                          "text" => $art["text"],                                          "text" => $art["text"],
73                                          "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"] : "",
74                                                  /* MyEscape($art["more"]) */ ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "",                                                  /* MyEscape($art["more"]) */ /* ((count($art["text"]) > 0 || strstr("?", $art["more"]) == 0) && $art["id"]) ? $art["more"] : "", */ "",
75                                                  MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",                                                  MyEscape($art["more_title"]), $art["id"], $empty["category"], "top",
76                                                  $isEdit, true, ($i > 0), ($i < count($arts) - 1))                                                  true, ($i > 0), ($i < count($arts) - 1), $art["show"], $art["related"]),
77                                            "read" => $art["read"] || ($art["more"] && !strstr($art["more"], "?")) ? $art["read"] : ""
78                                  ));                                  ));
79                          }                          }
80                  }                  }
81                  $tpl->assign("top", $a2);                  $tpl->assign("top", $a2);
82                  $tpl->assign("cat", $cat);                  $tpl->assign("cat", $cat);
83                  $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);                  $tpl->assign("next", (count($arts) > 10) ? ($offset + 10) : 0);
84                  $tpl->assign("prev", ($offset > 0) ? ($offset - 10) : false);                  $tpl->assign("prev", $offset ? ($offset - 10) : 0);
85                    $tpl->assign("offset", $offset);
86          }          }
87          $dbh->disconnect();          $dbh->disconnect();
88  ?>  ?>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.26