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

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

revision 1.11 by ravilov, Wed Sep 19 12:23:56 2001 UTC revision 1.12 by ravilov, Tue Sep 25 15:38:04 2001 UTC
# Line 1  Line 1 
1  <?php  <?php
2          include_once("inc/global.php");          include_once("inc/global.php");
3          include_once("inc/util.php");          include_once("inc/util.php");
4          $picdir = dirname($PHP_SELF)."/img/news";          $picdir = str_replace("//", "/", dirname($PHP_SELF));
5          $aupicdir = dirname($PHP_SELF)."/img/autori";          $picdir = ($picdir == "/") ? "" : $picdir;
6            $aupicdir = $vadpicdir = $picdir;
7            $picdir .= "/img/news";
8            $aupicdir .= "/img/autori";
9            $vadpicdir .= "/img/vademecum";
10          $syspicdir = $HTTP_SERVER_VARS["DOCUMENT_ROOT"].$picdir;          $syspicdir = $HTTP_SERVER_VARS["DOCUMENT_ROOT"].$picdir;
11          $sysaupicdir = $HTTP_SERVER_VARS["DOCUMENT_ROOT"].$aupicdir;          $sysaupicdir = $HTTP_SERVER_VARS["DOCUMENT_ROOT"].$aupicdir;
12            $sysvadpicdir = $HTTP_SERVER_VARS["DOCUMENT_ROOT"].$vadpicdir;
13          include_once("inc/Smarty.class.php");          include_once("inc/Smarty.class.php");
14          include_once("inc/Smarty.local.php");          include_once("inc/Smarty.local.php");
15          $onload = "";          $onload = $refresh = $main = "";
16          $tpl = new Smarty();          $tpl = new Smarty();
17          $ns4 = strstr($HTTP_USER_AGENT, 'Mozilla/4.7') ? true : false;          $ns4 = strstr($HTTP_USER_AGENT, 'Mozilla/4.7') ? true : false;
18          $tpl->assign("ns4", $ns4);          $tpl->assign("ns4", $ns4);
19          if (!$section) $section = "home";          if (!$isReg && $section != "registracija") $section = "prijava";
20            if (!$section) $section = $isReg ? "home" : "prijava";
21          $main_template = "index.tpl";          $main_template = "index.tpl";
22          $fname = "$section.tpl";          $fname = "$section.tpl";
23          $section_name = "";          $section_name = "";
24          $inc = $mnu = "";          $inc = $mnu = "";
25          $PATH = array($isMed ? "PLIVAMED.NET" : "PLIVAHEALTH.HR");          $PATH = array($isMed ? "PLIVAMED.NET" : "PLIVAHEALTH.HR");
26          if ($isMed) {          if ($isMed) {
27                  $mnu = "inc/menuMED.php";                  $mnu = "menuMED.php";
28                  if ($section == "home") {                  if ($section == "home") {
29                          $section_name = "Home";                          $section_name = "Home";
30                          $inc = "inc/pgHome";                          $inc = "pgHome";
31                  } else if ($section == "registracija") {                  } else if ($section == "search") {
32                          $section_name = "Registracija";                          $section_name = "Pretraživanje";
33                          $inc = "inc/pgRegistracija";                          $mnu = "";
34                            $inc = "pgSearch";
35                  } else if ($section == "onama") {                  } else if ($section == "onama") {
36                          $section_name = "O nama";                          $section_name = "O nama";
37                          $inc = "inc/pgONama";                          $mnu = "";
38                            $inc = "";
39                    } else if ($section == "prijava") {
40                            $section_name = "Prijava";
41                            $inc = "pgPrijava";
42                    } else if ($section == "registracija") {
43                            $section_name = "Registracija";
44                            $inc = "pgRegistracija";
45                  } else if ($section == "knjiznica") {                  } else if ($section == "knjiznica") {
46                          $section_name = "Knjižnica";                          $section_name = "Knjižnica";
47                          $inc = "inc/pgKnjiznica2";                          $inc = "pgKnjiznica2";
48                  } else if ($section == "linkovi") {                  } else if ($section == "linkovi") {
49                          $section_name = "Linkovi";                          $section_name = "Linkovi";
50                          $inc = "inc/pgLinkovi";                          $inc = "pgLinkovi";
51                  } else if ($section == "pretrazivanje") {                  } else if ($section == "pretrazivanje") {
52                          $section_name = "Pretraživanje";                          $section_name = "Pretraživanje";
53                          $inc = "inc/pgPretrazivanje";                          $inc = "pgPretrazivanje";
54                  }                  }
55          } else {          } else {
56                  if ($section == "home") {                  if ($section == "home") {
57                          $section_name = "Home";                          $section_name = "Home";
58                          $mnu = "inc/menuHome.php";                          $mnu = "menuHome.php";
59                          $inc = "inc/pgHome";                          $inc = "pgHome";
60                    } else if ($section == "search") {
61                            $section_name = "Pretraživanje";
62                            $mnu = "";
63                            $inc = "pgSearch";
64                    } else if ($section == "onama") {
65                            $section_name = "O nama";
66                            $mnu = "";
67                            $inc = "";
68                  } else if ($section == "bolesti") {                  } else if ($section == "bolesti") {
69                          $section_name = "Bolesti";                          $section_name = "Bolesti";
70                          $mnu = "inc/menuBolesti.php";                          $mnu = "menuBolesti.php";
71                          $inc = "inc/pgBolesti";                          $inc = "pgBolesti";
72                  } else if ($section == "simptomi") {                  } else if ($section == "simptomi") {
73                          $section_name = "Simptomi";                          $section_name = "Simptomi";
74                          $mnu = "inc/menuSimptomi.php";                          $mnu = "menuSimptomi.php";
75                          $inc = "inc/pgSimptomi";                          $inc = "pgSimptomi";
76                  } else if ($section == "stanja") {                  } else if ($section == "stanja") {
77                          $section_name = "Stanja";                          $section_name = "Stanja";
78                          $mnu = "inc/menuStanja.php";                          $mnu = "menuStanja.php";
79                          $inc = "inc/pgStanja";                          $inc = "pgStanja";
80                  } else if ($section == "lifestyle") {                  } else if ($section == "lifestyle") {
81                          $section_name = "Lifestyle";                          $section_name = "Lifestyle";
82                          $mnu = "inc/menuLifestyle.php";                          $mnu = "menuLifestyle.php";
83                          $inc = "inc/pgLifestyle";                          $inc = "pgLifestyle";
84                  } else if ($section == "knjiznica") {                  } else if ($section == "knjiznica") {
85                          $section_name = "Knjižnica";                          $section_name = "Knjižnica";
86                          $mnu = "inc/menuKnjiznica.php";                          $mnu = "menuKnjiznica.php";
87                          $inc = "inc/pgKnjiznica";                          $inc = "pgKnjiznica";
88                    } else if ($section == "bmi") {
89                            $section_name = "BMI";
90                            $mnu = "";
91                            $inc = "pgBMI";
92                    } else if ($section == "ovulacija") {
93                            $section_name = "Kalendar ovulacije";
94                            $mnu = "";
95                            $inc = "pgOvulacija";
96                  }                  }
97          }          }
98          if ($mnu && file_exists($mnu)) {          if ($mnu && file_exists("inc/$mnu")) {
99                  $keep_template = false;                  $keep_template = false;
100                  include_once($mnu);                  include_once("inc/$mnu");
101                  # if (!$section_menu) $section_menu = $menu[0]["name"];                  # if (!$section_menu) $section_menu = $menu[0]["name"];
102                    if (!$menu) $menu = array();
103                  $section_menu_name = "";                  $section_menu_name = "";
104                  while (list($k, $v) = each($menu)) {                  while (list($k, $v) = each($menu)) {
105                          $menu[$k]["caption2"] = urlencode($menu[$k]["caption"]);                          $menu[$k]["caption2"] = urlencode($menu[$k]["caption"]);
# Line 78  Line 109 
109                  if ($section_menu && !$keep_template)                  if ($section_menu && !$keep_template)
110                          $fname = eregi_replace("(".$tpl->tpl_file_ext.")$", "-$section_menu\\1", $fname);                          $fname = eregi_replace("(".$tpl->tpl_file_ext.")$", "-$section_menu\\1", $fname);
111                  $inc2 = $inc.($section_menu?"-$section_menu":"");                  $inc2 = $inc.($section_menu?"-$section_menu":"");
112                  $inc .= ".php";                  if ($inc2 && file_exists("inc/$inc2.php")) $inc = $inc2;
                 $inc2 .= ".php";  
                 if ($inc2 && file_exists($inc2)) $inc = $inc2;  
113          }          }
114            $inc .= ".php";
115          if ($section_name) array_push($PATH, MyUpper($section_name));          if ($section_name) array_push($PATH, MyUpper($section_name));
116          if ($section_menu_name) array_push($PATH, MyUpper($section_menu_name));          if ($section_menu_name) array_push($PATH, MyUpper($section_menu_name));
117          if ($inc && file_exists($inc)) include_once($inc);          if ($section_menu2_name) array_push($PATH, MyUpper($section_menu2_name));
118            if ($inc && file_exists("inc/$inc")) include_once("inc/$inc");
119          $tpl->assign("isedit", $isEdit);          $tpl->assign("isedit", $isEdit);
120          $tpl->assign("ismed", $isMed);          $tpl->assign("ismed", $isMed);
121            $tpl->assign("isreg", $isReg);
122          $tpl->assign("PATH", $PATH);          $tpl->assign("PATH", $PATH);
123          $tpl->assign("newspicdir", "$picdir/");          $tpl->assign("newspicdir", "$picdir/");
124          $tpl->assign("aupicdir", "$aupicdir/");          $tpl->assign("aupicdir", "$aupicdir/");
125            $tpl->assign("vadpicdir", "$vadpicdir/");
126          $tpl->assign("section", $section);          $tpl->assign("section", $section);
127          $tpl->assign("section_menu", $section_menu);          $tpl->assign("section_menu", $section_menu);
128            $tpl->assign("section_menu2", $section_menu2);
129          $tpl->assign("spec", $spec);          $tpl->assign("spec", $spec);
130          $main = $fname ? $tpl->fetch($fname) : "";          if ($fname) $main = $tpl->fetch($fname);
131          $tpl->assign("MAIN", $main);          $tpl->assign("MAIN", $main);
132          $tpl->assign("FOOTER", $tpl->fetch("footer.tpl"));          $tpl->assign("FOOTER", $tpl->fetch("footer.tpl"));
133            if ($isMed) {
134                    $tpl->assign("mainmenu", array(
135                            array("sec" => "home", "alt" => "home", "w" => 56, "h" => 23),
136                            array("sec" => "linkovi", "alt" => "linkovi", "w" => 60, "h" => 23),
137                            array("sec" => "knjiznica", "alt" => "knjižnica", "w" => 74, "h" => 23),
138                            array("sec" => "pretrazivanje", "alt" => "pretraživanje", "w" => 101, "h" => 23)
139                    ));
140            } else {
141                    $tpl->assign("mainmenu", array(
142                            array("sec" => "home", "alt" => "home", "w" => 54, "h" => 23),
143                            array("sec" => "bolesti", "alt" => "bolesti", "w" => 60, "h" => 23),
144                            array("sec" => "simptomi", "alt" => "simptomi", "w" => 78, "h" => 23),
145                            array("sec" => "stanja", "alt" => "stanja", "w" => 57, "h" => 23),
146                            array("sec" => "lifestyle", "alt" => "lifestyle", "w" => 68, "h" => 23),
147                            array("sec" => "knjiznica", "alt" => "knjižnica", "w" => 78, "h" => 23)
148                    ));
149            }
150            $tpl->assign("banner", "plivitc.gif");
151          $tpl->assign("onload", $onload);          $tpl->assign("onload", $onload);
152            $tpl->assign("refresh", $refresh);
153            $tpl->assign("query", $query);
154          $tpl->display($main_template);          $tpl->display($main_template);
155          include_once("inc/tracker.php");          include_once("inc/tracker.php");
156  ?>  ?>

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.26