redirect to external page if($Menu==$external) { header ("Location:"); exit; } // determine browser $pos = strpos ($HTTP_USER_AGENT, "MSIE"); $pos1 = strpos ($HTTP_USER_AGENT, "Opera"); if (($pos === false) || ($pos1>0)) { // note: three equal signs $ie = false; } else { $ie = true; } // define template instance and set up templates $tpl = new atemplate( array ( MAIN => 'tpl/main2.tpl', MENU => 'tpl/menu2.tpl', SUBMENU => 'tpl/submenu2.tpl', ) ); // process the top template // -> display title and location $tpl->process(TOP, array( // LOC => BuildLocationNavigation($Menu, $Submenu, $Hornav, $Course, $Research) )); // process the bottom template // -> display copyright, the webmaster's email address and the last update $tpl->process(BOTTOM, array( COPYRIGHT => $copyright, EMAIL => $webmaster )); // right site, using right.tpl // there's no dynamic information. Process anyway!! $tpl->process(RIGHT, array()); // this function constructs the navigation on the left side and adds it to the main template $tpl = BuildLeftNavigation($tpl, $Menu, $Submenu, $Hornav, $Research); // the main layout is the construction of the whole page. The main.tpl expects beside the other // templates a logo and the content. This is loaded from a file with the extension .content. // This file contains nothing but pure html code and can be maintained by somewhere else than the // webmaster. // If the URL contains a $Picture Variable, the name of the image will be looked up in the $pictures array, // which will be displayed inside the usual borders like content $tempcontent = join ('', file (getContentFile($Menu, $Submenu, $Hornav, $Course, $Contentfile, $ie))); $tpl->process(MAIN, array( WINDOWTITLE => $title . " - " . getTitle4($Menu, $Submenu, $Hornav, $Course), TITLE => $title, HEAD => getHead($Menu, $Submenu, $Hornav, $ie), RESIZE => getResize($Menu, $Submenu, $Hornav, $ie), ONLOAD => onLoad($Menu, $Submenu, $Hornav, $ie), FILENAME => $filename, LOGO => $logo, ETHLOGO => $ethlogo, LASTUPDATE => getLastUpdate($Menu, $Submenu, $Hornav), // the content is defined above CONTENT => $tempcontent )); // you must have completed processing the individual templates before embedding them $tpl->embed(MENU, MAIN); // print the page to the output $tpl->printit(); ?>