--- multi.php 2001/09/20 09:50:24 1.7 +++ multi.php 2001/11/07 14:24:02 1.10 @@ -10,6 +10,7 @@ $smarty->assign( array ( Title=>"PLIVA Ljubljana" ) ); include("find_html_file.inc"); +include("fix_msshit.inc"); if (! isset($p)) { $p=0; @@ -19,16 +20,22 @@ $sql="select id,menu_num,name,html,path,type from multi where $visible_is_true and id=$p"; $sth = $dbh->prepare("$sql"); $sth->execute(); - $row=$sth->fetchrow_hash(); + if (! $row=$sth->fetchrow_hash()) { + $sth = $dbh->prepare("select min(num) as menu_num from menu"); + $sth->execute(); + $row2=$sth->fetchrow_hash(); + $row = array(id=>0,menu_num=>$row2[menu_num],name=>"Can't find page",html=>'',path=>'',type=>''); + } $title.=" : $row[name]"; + $smarty->assign("mtext",$row[name]); if ($row[type]=="h" && find_html_file("multi",$row[html])) { $main=join('',file(find_html_file("multi",$row[html]))); + $main=fix_msshit($main); } elseif ($row[type]=="p") { if (find_html_file("",$row[path])) { $main=join('',file(find_html_file("",$row[path]))); // fix entities from MS programs - include("fix_msshit.inc"); $main=fix_msshit($main); } else { $main="can't find $row[path] for id $p";