16 |
$section="domov"; |
$section="domov"; |
17 |
} else { |
} else { |
18 |
// fetch current page |
// fetch current page |
19 |
$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"; |
20 |
$sth = $dbh->prepare("$sql"); |
$sth = $dbh->prepare("$sql"); |
21 |
$sth->execute(); |
$sth->execute(); |
22 |
$row=$sth->fetchrow_hash(); |
if (! $row=$sth->fetchrow_hash()) { |
23 |
|
$sth = $dbh->prepare("select min(num) as menu_num from menu"); |
24 |
|
$sth->execute(); |
25 |
|
$row2=$sth->fetchrow_hash(); |
26 |
|
$row = array(id=>0,menu_num=>$row2[menu_num],name=>"Can't find page",html=>'',path=>'',type=>''); |
27 |
|
} |
28 |
|
|
29 |
$title.=" : $row[name]"; |
$title.=" : $row[name]"; |
30 |
if ($row[type]=="h" && file_exists(find_html_file("multi",$row[html]))) { |
if ($row[type]=="h" && find_html_file("multi",$row[html])) { |
31 |
$main=join('',file(find_html_file("multi",$row[html]))); |
$main=join('',file(find_html_file("multi",$row[html]))); |
32 |
} elseif ($row[type]=="p") { |
} elseif ($row[type]=="p") { |
33 |
if (file_exists(find_html_file("/",$row[path]))) { |
if (find_html_file("",$row[path])) { |
34 |
$main=join('',file(find_html_file("/",$row[path]))); |
$main=join('',file(find_html_file("",$row[path]))); |
35 |
// fix entities from MS programs |
// fix entities from MS programs |
36 |
include("fix_msshit.inc"); |
include("fix_msshit.inc"); |
37 |
$main=fix_msshit($main); |
$main=fix_msshit($main); |
60 |
$title=str_replace("\\n"," ",$title); // nuke nl chars |
$title=str_replace("\\n"," ",$title); // nuke nl chars |
61 |
|
|
62 |
// fetch all pages in this multi-page |
// fetch all pages in this multi-page |
63 |
$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"; |
64 |
$sth = $dbh->prepare("$sql"); |
$sth = $dbh->prepare("$sql"); |
65 |
$sth->execute(); |
$sth->execute(); |
66 |
|
|