redirect to external page if($Menu==$external) { header ("Location: http://graphics.ethz.ch"); 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/main.tpl', TOP => 'tpl/top.tpl', RIGHT => 'tpl/right.tpl', MENU => 'tpl/menu.tpl', SUBMENU => 'tpl/submenu.tpl', BOTTOM => 'tpl/bottom.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( TITLE => $title . " - " . getTitle4($Menu, $Submenu, $Hornav, $Course), 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); $tpl->embed(TOP, MAIN); $tpl->embed(RIGHT, MAIN); $tpl->embed(BOTTOM, MAIN); $tpl->embed(HOR_NAV, MAIN); // print the page to the output $tpl->printit(); ?>