+
+ # otherwise, it's a normal basename, display that content
+ $basename = $dest;
+
+ } else { # no dest arg
+ $basename = $_SERVER['REDIRECT_URL'];
+ $basename = ereg_replace('.*/', '', $basename);
+ $basename = ereg_replace('\.html$', '', $basename);
+ if($basename == '') {
+ $basename = 'index';
+ }
+ }
+
+ $GLOBALS['wfpl_basename'] = $basename;
+
+ $html_file = "$basename.html";
+ $php_file = "$basename.php";
+
+ $html_exists = file_exists($html_file);
+ $php_exists = file_exists($php_file);
+
+ if(file_exists('template.html')) {
+ $GLOBALS['wfpl_main_template'] = new tem();
+ $GLOBALS['wfpl_main_template']->load("template.html");
+ $GLOBALS['wfpl_main_template']->set('wfpl_basename', $basename);