Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "includes/require.php"; //get the output from the buffer $body = $content_from_db.ob_get_contents(); ob_end_clean(); //clean the buffer //set a default template if (strlen($_SESSION['domain']['template']['name']) == 0) { $_SESSION['domain']['template']['name'] = 'default'; } //set a default template if (strlen($_SESSION["template_content"])==0) { //build template if session template has no length $v_template_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes'; if (strlen($template_rss_sub_category) > 0) { //this template was assigned by the content manager //get the contents of the template and save it to the template variable $template_full_path = $v_template_path.'/'.$template_rss_sub_category.'/template.php'; if (!file_exists($template_full_path)) { $_SESSION['domain']['template']['name'] = 'default'; $template_full_path = $v_template_path.'/default/template.php'; } $template = file_get_contents($template_full_path); $_SESSION["template_content"] = $template; } else { //get the contents of the template and save it to the template variable $template_full_path = $v_template_path.'/'.$_SESSION['domain']['template']['name'].'/template.php'; if (!file_exists($template_full_path)) { $_SESSION['domain']['template']['name'] = 'default'; $template_full_path = $v_template_path.'/default/template.php'; } $template = file_get_contents($template_full_path); $_SESSION["template_content"] = $template; } } //start the output buffer ob_start(); $template = $_SESSION["template_content"]; eval('?>' . $template . '", $custom_title, $template); // defined in each individual page $output = str_replace ("", $custom_head, $output); // defined in each individual page if (strlen($v_menu) > 0) { $output = str_replace ("", $v_menu, $output); //defined in /includes/menu.php } else { $output = str_replace ("", $_SESSION["menu"], $output); //defined in /includes/menu.php } $output = str_replace ("", PROJECT_PATH, $output); //defined in /includes/menu.php $pos = strrpos($output, ""); if ($pos === false) { $output = $body; //if tag not found just show the body } else { //replace the body $output = str_replace ("", $body, $output); } //send the output to the browser echo $output; unset($output); //$statsauth = "a3az349x2bf3fdfa8dbt7x34fas5X"; //require_once "stats/stat_sadd.php"; ?>