} $n = $f->getFilename(); if (preg_match('/\\.html$/', $n)) { $d[] = preg_replace('/\\.html$/', '', $n); } } asort($d); $template = $d[0]; } } if ($template == '') { die('no template created. please create a template first'); } // } // { set up smarty $smarty = smarty_setup(USERBASE . '/ww.cache/pages'); $smarty->template_dir = THEME_DIR . '/' . THEME . '/h/'; $smarty->assign('PAGECONTENT', '<div id="ww-pagecontent">' . $pagecontent . '</div>'); $smarty->assign('PAGEDATA', $PAGEDATA); $smarty->assign('THEMEDIR', '/ww.skins/' . THEME); // } // { build metadata // { page title $title = $PAGEDATA->title != '' ? $PAGEDATA->title : str_replace('www.', '', $_SERVER['HTTP_HOST']) . ' > ' . $PAGEDATA->name; $c = '<title>' . htmlspecialchars($title) . '</title>'; // } // { show stylesheet and javascript links $c .= 'WW_CSS_GOES_HERE'; if (isset($DBVARS['theme_variant']) && $DBVARS['theme_variant']) { WW_addCSS('/ww.skins/' . $DBVARS['theme'] . '/cs/' . $DBVARS['theme_variant'] . '.css'); }
function render() { $smarty = smarty_setup(USERBASE . '/ww.cache/pages'); if (!file_exists(USERBASE . '/ww.cache/pages/template_' . $this->id)) { file_put_contents(USERBASE . '/ww.cache/pages/template_' . $this->id, $this->body); } return $smarty->fetch(USERBASE . '/ww.cache/pages/template_' . $this->id); }