10 |
$smarty->assign( array ( Title=>"PLIVA Ljubljana" ) ); |
$smarty->assign( array ( Title=>"PLIVA Ljubljana" ) ); |
11 |
|
|
12 |
include("find_html_file.inc"); |
include("find_html_file.inc"); |
13 |
|
include("fix_msshit.inc"); |
14 |
|
|
15 |
if (! isset($p)) { |
if (! isset($p)) { |
16 |
$p=0; |
$p=0; |
17 |
$section="domov"; |
$section="domov"; |
18 |
} else { |
} else { |
19 |
// fetch current page |
// fetch current page |
20 |
$sql="select id,menu_num,name,html,path,type from multi where visible and id=$p"; |
$sql="select id,menu_num,name,html,path,type from multi where $visible_is_true and id=$p"; |
21 |
$sth = $dbh->prepare("$sql"); |
$sth = $dbh->prepare("$sql"); |
22 |
$sth->execute(); |
$sth->execute(); |
23 |
$row=$sth->fetchrow_hash(); |
if (! $row=$sth->fetchrow_hash()) { |
24 |
|
$sth = $dbh->prepare("select min(num) as menu_num from menu"); |
25 |
|
$sth->execute(); |
26 |
|
$row2=$sth->fetchrow_hash(); |
27 |
|
$row = array(id=>0,menu_num=>$row2[menu_num],name=>"Can't find page",html=>'',path=>'',type=>''); |
28 |
|
} |
29 |
|
|
30 |
$title.=" : $row[name]"; |
$title.=" : $row[name]"; |
31 |
if ($row[type]=="h" && file_exists(find_html_file("multi",$row[html]))) { |
$smarty->assign("mtext",$row[name]); |
32 |
|
if ($row[type]=="h" && find_html_file("multi",$row[html])) { |
33 |
$main=join('',file(find_html_file("multi",$row[html]))); |
$main=join('',file(find_html_file("multi",$row[html]))); |
34 |
|
$main=fix_msshit($main); |
35 |
} elseif ($row[type]=="p") { |
} elseif ($row[type]=="p") { |
36 |
if (file_exists(find_html_file("",$row[path]))) { |
if (find_html_file("",$row[path])) { |
37 |
$main=join('',file(find_html_file("",$row[path]))); |
$main=join('',file(find_html_file("",$row[path]))); |
38 |
|
// fix entities from MS programs |
39 |
|
$main=fix_msshit($main); |
40 |
} else { |
} else { |
41 |
$main="<b>can't find $row[path] for id $p</b>"; |
$main="<b>can't find $row[path] for id $p</b>"; |
42 |
} |
} |
62 |
$title=str_replace("\\n"," ",$title); // nuke nl chars |
$title=str_replace("\\n"," ",$title); // nuke nl chars |
63 |
|
|
64 |
// fetch all pages in this multi-page |
// fetch all pages in this multi-page |
65 |
$sql="select id,name from multi where visible and menu_num=$row[menu_num] order by menu_num,num"; |
$sql="select id,name from multi where $visible_is_true and menu_num=$row[menu_num] order by menu_num,num"; |
66 |
$sth = $dbh->prepare("$sql"); |
$sth = $dbh->prepare("$sql"); |
67 |
$sth->execute(); |
$sth->execute(); |
68 |
|
|