% if ($_SERVER['SERVER_NAME'] == "www.dur.ac.uk") { header("Location: http://www.camhsmapping.org.uk/".substr($_SERVER['REQUEST_URI'],15)); die(); } # A generalised index page # if the file home.php exists in this directory then use it and stop # if the file info.php exists in this directory then use it and continue # if a menu exists for this page the list the options sequentially, with help # NB info.php should not have a page top and bottom on it include_once "mhfunctions.php"; $thisFilename=$_SERVER['SCRIPT_FILENAME']; $thisDir=dirname($thisFilename); $thisFile=basename($thisFilename); if(is_readable($thisDir."/home.php")){ include ($thisDir."/home.php"); exit; } $page=new pageInfo(__FILE__,$PHP_SELF,$menuName); $page->top(); if(is_readable($thisDir."/info.php")){ include ($thisDir."/info.php"); $somestuff=1; } $menuDescriptionFile=$thisDir."/menu.xml"; if(!is_readable($menuDescriptionFile)){ if(!$somestuff){ warning ("No menu items available"); } $page->end(); exit; } # some gubbins for the Menu XML parser: the other functions are # defined in pageInfo function menuListEndElement($parser,$name){ global $menuItemURL, $menuItemDisplay; if($name=="ITEM"){ print "
| Menu |
|