define( array( 'layout1' => "layout1.tpl", 'layout2' => "layout2.tpl", 'layout2-inline' => "layout2-inline.tpl", 'history' => "history.htm" ) ); // getimages $images = scan_dir($FrontImageDir, ".jpg"); //count $imagestotal = count ($images); $imagestotal = $imagestotal - 1; //random $random = rand(0,$imagestotal); $IMAGE2 = $images[$random]; // getimages $images = scan_dir($LeftImageDir, ".jpg"); //count $imagestotal = count ($images); $imagestotal = $imagestotal - 1; //random $random = rand(0,$imagestotal); $IMAGE1 = $images[$random]; //assign vars $tpl->assign( array( 'TITLE' => $pageTitle, 'COPYRIGHTS' => $copyRights, 'CONTACTEMAIL' => "info@putles.nl", 'IMAGE1' => $IMAGE1, 'IMAGE2' => $IMAGE2, ) ); //get action switch ($_GET['show']) { case "history" : $tpl->assign( array( 'IFRAME' => "showpage.php?id=5", 'FIELD1' => getMainContent($dataBase, "local", 6), 'FIELD2' => getMainContent($dataBase, "local", 7), ) ); $tpl->parse('main', array("history")); break; case "services" : $tpl->assign( array( 'IFRAME' => "showpage.php?id=9", 'FIELD1' => getMainContent($dataBase, "local", 6), 'FIELD2' => getMainContent($dataBase, "local", 7), ) ); $tpl->parse('main', array("history")); break; case "gallery" : $tpl->assign( array( 'IFRAME' => "showpage.php?id=8", 'FIELD1' => getMainContent($dataBase, "local", 6), 'FIELD2' => getMainContent($dataBase, "local", 7), ) ); $tpl->parse('main', array("layout2-inline")); break; case "aboutus" : $tpl->assign( array( 'IFRAME' => "showpage.php?id=10", 'FIELD1' => getMainContent($dataBase, "local", 6), 'FIELD2' => getMainContent($dataBase, "local", 7), ) ); $tpl->parse('main', array("layout2-inline")); break; case "member" : $tpl->assign( array( 'IFRAME' => "showpage.php?id=11", 'FIELD1' => getMainContent($dataBase, "local", 6), 'FIELD2' => getMainContent($dataBase, "local", 7), ) ); $tpl->parse('main', array("history")); break; default : $tpl->assign( array( 'FIELD1' => getMainContent($dataBase, "local", 6), 'FIELD2' => getMainContent($dataBase, "local", 7), 'FIELD3' => getMainContent($dataBase, "local", 1), 'FIELD4' => getMainContent($dataBase, "local", 2), 'FIELD5' => getMainContent($dataBase, "local", 3), ) ); $tpl->parse('main', array("layout1")); break; } //Output template $tpl->parse('MAIN', array("main")); $tpl->FastPrint(); exit; ?>