/** * Rendering function * @param string $body Generated HTML for the primary page. * Passed byref so we don't need to copy an entire string */ function theme_render(&$body) { global $ssc_site_path, $ssc_site_url; $theme = ssc_var_get('theme_default', SSC_DEFAULT_THEME); $info = theme_get_info(); for ($i = 0; $i < $info['mini_count']; $i++) { $side[$i] = theme_side($i); } $site_name = ssc_var_get('site_name', false); $meta = _theme_get_meta() . '<title>' . ssc_set_title() . ($site_name ? " | " . $site_name : '') . "</title>\n"; $m = module_hook('meta'); foreach ($m as $src) { $meta .= $src; } $lang = ssc_var_get('language', 'en'); $logo = ssc_var_get('theme_show_logo', false) ? ssc_var_get('theme_logo', '') : false; $title = ssc_var_get('theme_show_title', false) ? "{$site_name}" : false; $quip = ssc_var_get('theme_show_quip', false) ? ssc_var_get('theme_quip', '') : false; $breadcrumb = ssc_var_get('theme_breadcrumb', false); $messages = theme_messages(); $foot = ssc_var_get('theme_show_foot', false) ? ssc_var_get('theme_foot', '') : ''; if (empty($foot)) { $foot = 'XHTML and CSS valid<br />Powered by <a href="http://www.smoothsailingcms.org">SSC</a>'; } else { $foot .= 'XHTML and CSS valid<br />Powered by <a href="http://www.smoothsailingcms.org">SSC</a>'; } //$side = array(); $body = '<h2>' . ssc_set_title() . '</h2>' . $body; // Show the page include "{$ssc_site_path}/themes/{$theme}/site.tpl.php"; }
/** * Start the display of the page by booting up the theme */ function ssc_frontend_init() { global $SSC_SETTINGS, $ssc_site_path, $ssc_database; // Include the language file $file = "{$ssc_site_path}/lang/" . $SSC_SETTINGS['lang']['tag'] . ".inc.php"; if (file_exists($file)) { require_once $file; } else { ssc_die(array('title' => 'Bad language', 'body' => "Language '" . $SSC_SETTINGS['lang']['tag'] . "' is currently not installed")); } // Set up the theme require_once "{$ssc_site_path}/includes/core.theme.inc.php"; $theme = ssc_var_get('theme_default', SSC_DEFAULT_THEME); $file = "{$ssc_site_path}/themes/{$theme}/{$theme}."; if (!file_exists($file . 'theme.php') && !file_exists($file . 'info')) { ssc_die(array('title' => 'Bad theme', 'body' => 'Specified theme ' . $theme . ' is not installed')); } theme_get_info($theme); ssc_add_js("/includes/core.js"); }