'; print_r ($site_structure); echo ''; */ do { $ok=1; unset($first_page); if ($fileNotFound) { $current_page=$site_structure['']['404file']; $url='404file'; } else { $parent_page=array(); $page_parts=explode('/',$url); $current_page=$site_structure['']; foreach($page_parts as $page_part) if ($page_part) { array_unshift($parent_page,$current_page); $current_page=$current_page[$page_part]; if (!$first_page) $first_page=$current_page; } if (!$current_page['_type']) { $current_page=$site_structure['']['404']; } } if (substr($pagefile_path,-1)!='/') $url.='/'; $page_parts=explode('/',$url); if ($current_page['_type']=='alias') { $ok=0; $url=$current_page['_real_url']; } } while (!$ok); $pagefile_path=str_replace('/','.',$url); while (substr($pagefile_path,-1)=='.') $pagefile_path=substr($pagefile_path,0,-1); if (!$pagefile_path) $pagefile_path='index'; if ($current_page["_navigation"]=='flat' || $current_page["_navigation"]=='tabless') $pagefile_path.='.' . $current_page[$current_page["_firstchild"]]["_url"]; if (!$first_page) $first_page=$current_page; /* print $pagefile_path . "
"; print "Page: " . $url . "
"; print "First: " . $first_page['_title']; print "Current: " . $current_page['_title'] . "
"; print "Parent: " . $parent_page[0]['_title']; */ include "templates/regular-header.php"; $filename="pages/" . $pagefile_path . "..php"; if (file_exists($filename)) include $filename; else include "pages/workinprogress..php"; include "templates/regular-footer.php"; ?>