template_dir = ''; $smarty->compile_dir = 'includes/templates'; $smarty->cache_dir = 'includes/cache'; $smarty->config_dir = 'includes/configs'; $smarty->caching = true; #$smarty->force_compile=true; // determine action and params // determine page to load if(!empty($_GET['p'])) { if(is_file($_GET['p'].'.htm') && is_readable($_GET['p'] . '.htm')) { $p = $_GET['p'].'.htm'; $active_page = ereg_replace('.tpl','.htm', $p); $page = $p; } elseif(is_file($_GET['p'] . '.html') && is_readable($_GET['p'] . '.html')) { $p = $_GET['p'] . '.html'; $active_page = ereg_replace('.tpl','.htm', $p); $page = $p; } elseif(is_file($_GET['p'] . '/index.htm') && is_readable($_GET['p'] . 'index.htm')) { $p = $_GET['p'] . '/index.htm'; $active_page = ereg_replace('.tpl','.htm', $p); $page = $p; } elseif(is_file($_GET['p'] . '/index.html') && is_readable($_GET['p'] . '/index.html')) { $p = $_GET['p'] . '/index.html'; $active_page = ereg_replace('.tpl','.htm', $p); $page = $p; } else { $active_page = 'index.htm'; $page = 'index.htm'; } } else { $active_page = 'index.html'; $page = 'index.html'; } if(!is_file($page)) { header("HTTP/1.0 404 Not Found"); $page = 'error.html'; } // display the page requested $smarty->assign('active', $active_page); $smarty->assign('params', $_GET); $smarty->display($page); ?>