This follows on from the near the bottom of the source code that you pasted.
info('Serving URL:' . $_SERVER['REQUEST_URI']);
$log->debug('Starting index.php');
/**
* Entry point for all non-admin pages
*
* @package CMS
*/
$starttime = microtime();
@ob_start();
clearstatcache();
if (!file_exists(CONFIG_FILE_LOCATION) || filesize(CONFIG_FILE_LOCATION) MaintenanceSite down for maintenance.";
exit;
}
if (!is_writable(TMP_TEMPLATES_C_LOCATION) || !is_writable(TMP_CACHE_LOCATION))
{
echo 'Error';
echo 'The following directories must be writable by the web server:
';
echo 'tmp/cache
';
echo 'tmp/templates_c
';
echo 'Please correct by executing:
chmod 777 tmp/cache
chmod 777 tmp/templates_c
or the equivilent for your platform before continuing.';
echo '';
exit;
}
require_once(dirname(__FILE__)."/include.php"); #Makes gCms object
$params = array_merge($_GET, $_POST);
global $gCms;
$smarty = &$gCms->smarty;
$smarty->params = $params;
$page = '';
$smarty->id = (isset($params['id'])?$params['id']:'');
if (isset($params['id']) && isset($params[$params['id'] . 'returnid']))
{
$page = $params[$params['id'] . 'returnid'];
}
if (isset($config["query_var"]) && $config["query_var"] != "" && isset($_GET[$config["query_var"]]))
{
$page = $_GET[$config["query_var"]];
}
#else if (isset($_SERVER["PATH_INFO"]) && (isset($_SERVER["SCRIPT_URL"]) && ($_SERVER["PATH_INFO"] != $_SERVER["SCRIPT_URL"])))
#{
# $page = $_SERVER["PATH_INFO"];
#}
#else if (isset($_SERVER["QUERY_STRING"]) && strpos($_SERVER["QUERY_STRING"], 'deleteinstall') === false)
#{
# $page = $_SERVER["QUERY_STRING"];
#}
if ($page == '')
{
$page = ContentManager::GetDefaultContent();
}
else
{
$page = preg_replace('/\variables['pageinfo'] =& $pageinfo;
$gCms->variables['content_id'] = $pageinfo->content_id;
$gCms->variables['page'] = $page;
$gCms->variables['page_id'] = $page;
$gCms->variables['page_name'] = $pageinfo->content_alias;
$gCms->variables['position'] = $pageinfo->content_hierarchy;
}
$html = "";
if (isset($_GET["print"]))
{
($smarty->is_cached('print:'.$page, '', $pageinfo->template_id)?$cached="":$cached="not ");
$log->debug('Fetching: print:' . $pageinfo->template_id);
$html = $smarty->fetch('print:'.$page, '', $pageinfo->template_id) . "\n";
}
else
{
($smarty->is_cached('template:'.$pageinfo->template_id)?$cached="":$cached="not ");
#If this is a case where a module doesn't want a template to be shown, just disable caching
if (isset($_GET['id']) && isset($_GET[$_GET['id'].'showtemplate']) && $_GET[$_GET['id'].'showtemplate'] == 'false')
{
$log->debug('Fetching: template:notemplate');
$html = $smarty->fetch('template:notemplate') . "\n";
}
else
{
$log->debug('Fetching: template:' . $pageinfo->template_id);
$html = $smarty->fetch('template:'.$pageinfo->template_id) . "\n";
}
}
if (get_site_preference('enablecustom404') == "0" && (!$config['debug']))
{
set_error_handler($old_error_handler);
}
if (!$cached)
{
#Perform the content postrendernoncached callback
foreach($gCms->modules as $key=>$value)
{
if ($gCms->modules[$key]['installed'] == true &&
$gCms->modules[$key]['active'] == true)
{
$gCms->modules[$key]['object']->ContentPostRenderNonCached($html);
}
}
}
#Perform the content postrender callback
foreach($gCms->modules as $key=>$value)
{
if ($gCms->modules[$key]['installed'] == true &&
$gCms->modules[$key]['active'] == true)
{
$gCms->modules[$key]['object']->ContentPostRender($html);
}
}
header("Content-Type: " . $gCms->variables['content-type'] . "; charset=" . (isset($pageinfo->template_encoding) && $pageinfo->template_encoding != ''?$pageinfo->template_encoding:get_encoding()));
echo $html;
@ob_flush();
$endtime = microtime();
if ($config["debug"] == true)
{
echo "Generated in ".microtime_diff($starttime,$endtime)." seconds by CMS Made Simple $CMS_VERSION (".$cached."cached) using $sql_execs SQL queries and ".(function_exists('memory_get_usage')?memory_get_usage():'n/a')." bytes of memory";
}
echo "\n";
#echo "Generated in ".microtime_diff($starttime,$endtime)." seconds by CMS Made Simple $CMS_VERSION (".$cached."cached) using $sql_execs SQL queries and ".(function_exists('memory_get_usage')?memory_get_usage():'n/a')." bytes of memory";
echo "\n";
if (get_site_preference('enablesitedownmessage') == "1")
{
$smarty->clear_compiled_tpl();
$smarty->clear_all_cache();
}
$log->debug('Leaving index.php');
if ($config["debug"] == true)
{
echo $sql_queries;
foreach ($gCms->errors as $error)
{
echo $error;
}
}
# vim:ts=4 sw=4 noet
?>
RIVAPETZ PET CARE
Dr Jenni Trewren
8 Gilbert Street, Berri SA 5343
Ph: 08 8582 1344
Email:
info@rivapetz.com.au
Website design by That's Graphic