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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Wed Oct 10 12:40:58 2001 UTC (17 years, 6 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +18 -3 lines
Improved Arhiva, Alergijski semafor and Home. Added a second Q&A page (test version). Other improvements & bugfixes.

1 <?php
2 include_once("inc/newsShow.php");
3 include("inc/conn.php");
4 if ($show) {
5 $arts = newsLoad($id, $cat);
6 newsShow(array_shift($arts));
7 } else {
8 $isHome = ($acat || $acat2) ? false : true;
9 $Kolumna = "";
10 $cat = "t";
11 $naslov = "";
12 if ($acat == "s") {
13 $cat = "c";
14 $naslov = "Stanja";
15 if ($acat2 == "z") { $cat = "z"; $naslov .= " - ®ensko zdravlje"; }
16 if ($acat2 == "m") { $cat = "m"; $naslov .= " - Mu¹ko zdravlje"; }
17 if ($acat2 == "d") { $cat = "d"; $naslov .= " - Majka i dijete"; }
18 if ($acat2 == "t") { $cat = "r"; $naslov .= " - Treæa dob"; }
19 if ($acat2 == "l") { $cat = "l"; $naslov .= " - Mladi"; }
20 if ($acat2 == "o") { $cat = "o"; $naslov .= " - Ovisnosti"; }
21 }
22 if ($acat == "l") {
23 $cat = "l";
24 $naslov = "Lifestyle";
25 if ($acat2 == "x") { $cat = "x"; $naslov .= " - Sex"; $Kolumna = "y"; }
26 if ($acat2 == "z") { $cat = "h"; $naslov .= " - Zdrava prehrana"; }
27 if ($acat2 == "f") { $cat = "f"; $naslov .= " - Fitness"; }
28 }
29 if ($acat == "z") { $cat = "i"; $naslov = "Zanimljivosti"; }
30 $arts = newsLoad(-1, $cat, 0, 0, 0);
31 $clanci = array();
32 for ($i = 0; $i < count($arts); $i++) {
33 array_push($clanci, array(
34 "naslov" => $arts[$i]["title"],
35 "date" => $arts[$i]["date"] ? strftime("%d.%m.%Y.", strtotime($arts[$i]["date"])) : "",
36 "read" => GetRead($arts[$i]["id"], $cat),
37 "autor" => $arts[$i]["au_name"]
38 ));
39 }
40 $tpl->assign("clanci", $clanci);
41 if ($Kolumna) {
42 $arts = newsLoad(-1, $Kolumna, 0, 0, 0);
43 $kolumne = array();
44 for ($i = 0; $i < count($arts); $i++) {
45 array_push($kolumne, array(
46 "naslov" => $arts[$i]["title"],
47 "date" => $arts[$i]["date"] ? strftime("%d.%m.%Y.", strtotime($arts[$i]["date"])) : "",
48 "read" => GetRead($arts[$i]["id"], $Kolumna),
49 "autor" => $arts[$i]["au_name"]
50 ));
51 }
52 $tpl->assign("kolumne", $kolumne);
53 }
54 if ($isHome) {
55 $vijesti = array();
56 $arts = newsLoad(-1, "w", 0, 0, 0);
57 for ($i = 0; $i < count($arts); $i++) {
58 array_push($vijesti, array(
59 "naslov" => $arts[$i]["title"],
60 "date" => $arts[$i]["date"] ? strftime("%d.%m.%Y.", strtotime($arts[$i]["date"])) : "",
61 "read" => GetRead($arts[$i]["id"], "w"),
62 "autor" => $arts[$i]["au_name"]
63 ));
64 }
65 $tpl->assign("vijesti", $vijesti);
66 $novosti = array();
67 $arts = newsLoad(-1, "p", 0, 0, 0);
68 for ($i = 0; $i < count($arts); $i++) {
69 array_push($novosti, array(
70 "naslov" => $arts[$i]["title"],
71 "date" => $arts[$i]["date"] ? strftime("%d.%m.%Y.", strtotime($arts[$i]["date"])) : "",
72 "read" => GetRead($arts[$i]["id"], "p"),
73 "autor" => $arts[$i]["au_name"]
74 ));
75 }
76 $tpl->assign("novosti", $novosti);
77 }
78 $tpl->assign("home", $isHome);
79 $tpl->assign("kolumna", $Kolumna ? true : false);
80 if ($spec) {
81 $sql = "SELECT opis FROM specijalizacije WHERE spec_id = $spec";
82 $sth = $dbh->prepare($sql);
83 if (!$sth) error("Cannot prepare query: \"$sql\"");
84 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
85 $row = $sth->fetchrow_array();
86 $sth->finish();
87 if ($row) $row = array_shift($row);
88 if ($row) {
89 if ($naslov) $naslov .= " - ";
90 $naslov .= $row;
91 }
92 }
93 if (!$naslov) $naslov = $isMed ? "SVE" : "HOME";
94 if ($naslov) array_push($PATH, MyUpper($naslov));
95 $tpl->assign("naslov", $naslov);
96 }
97 $dbh->disconnect();
98 ?>

  ViewVC Help
Powered by ViewVC 1.1.26