--- index.php 2001/06/28 12:09:16 1.1
+++ index.php 2001/11/08 08:55:38 1.16
@@ -4,7 +4,7 @@
$smarty = new Smarty;
-$smarty->assign( array ( Title=>"Pliva d.d." ) );
+$smarty->assign( array ( Title=>"PLIVA Ljubljana" ) );
$section=str_replace(".php","",basename($PHP_SELF));
$smarty->assign("section",$section);
@@ -12,17 +12,56 @@
$main_file=$section;
require("inc/section.php");
-
-$smarty->assign(array(section=>$section, lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title));
-
-$smarty->assign("r1link", "#");
-$smarty->assign("r1pic", "bisolex.jpg");
-$smarty->assign("r2link", "#");
-$smarty->assign("r2pic", "andol1.jpg");
-
include("common.inc");
+include("find_html_file.inc");
+include("fix_msshit.inc");
-$smarty->assign("MAIN",$smarty->fetch("$main_file.tpl"));
+if ($menu_item) {
+ $title.=" : $menu_item";
+ $smarty->assign("mtext",$menu_item);
+} else {
+ $smarty->assign("mtext",$title);
+}
+
+if (isset($h) && file_exists(find_html_file("h/$section",$h))) {
+ $main=join('',file(find_html_file("h/$section",$h)));
+ $main=fix_msshit($main);
+} elseif (isset($p) && file_exists("sections/$p.inc")) {
+ include("sections/$p.inc");
+} elseif (file_exists("template/$main_file.tpl")) {
+ $main=$smarty->fetch("$main_file.tpl");
+} elseif (isset($static)) {
+ if (strstr($static,",")) {
+ $d=explode(",",$static); // dir,file
+ } else {
+ $d=array($static,$static);
+ }
+ if (find_html_file("static/$d[0]",$d[1])) {
+ $main=join('',file(find_html_file("static/$d[0]",$d[1])));
+ // fix entities from MS programs
+ $main=fix_msshit($main);
+ } else {
+ $main="Can't find static/$d[0]/$d[1]";
+ }
+ if (file_exists("sections/$section.inc")) include("sections/$section.inc");
+} elseif (find_html_file("h",$section)) {
+ $main=join('',file(find_html_file("h",$section)));
+ $main=fix_msshit($main);
+ if (file_exists("sections/$section.inc")) {
+ include("sections/$section.inc");
+ }
+} elseif (file_exists("sections/$section.inc")) {
+ include("sections/$section.inc");
+} else {
+ $main="can't find template or html file for section $section";
+}
+
+$smarty->assign(array(section=>$section,
+ mpic=>$mpic,
+ Section_title=>$title,
+ rnd=>$rnd,
+ MAIN=>$main,
+ ));
$smarty->display("index.tpl");
?>