compile_check = true; $smarty->debugging = false; $smarty->template_dir = 'templates/plastic'; //hardcoded $smarty->assign('template_dir', $smarty->template_dir); //todo automatically include all css-es from current template $smarty->compile_dir = 'cache'; $smarty->plugins_dir = array( 'plugins', // the default under SMARTY_DIR '../../plugins' ); $smarty->autoload_filters = array('pre' => array('translate')); //addresses to smarty $this_address = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //$root_address = substr($this_address, 0, strrpos($this_address, '/')) . '/'; $smarty->assign('this_address', $this_address); $smarty->assign('root_address', $root_address); //mod_rewrite test if (!isset($session['mod_rewrite'])) { if (@$_GET['rewriteparam'] === 'rewrite_test') { echo 'rewrite_is_cool'; exit; } $mod_rewrite = 'disabled'; $filename = $root_address . 'rewrite_test'; $handle = @fopen($filename, 'r'); if ($handle) { $contents = fread($handle, 100); fclose($handle); if ($contents === 'rewrite_is_cool') { $mod_rewrite = 'enabled'; } } $session['mod_rewrite'] = $mod_rewrite; } ?>