Example #1
0
register_shutdown_function(array("CAT_ExceptionHandler", "shutdownHandler"));
global $wb, $admin;
// -----------------------------------------------------------------------------
// Create new frontend object; this is for backward compatibility only!
include CAT_PATH . '/framework/class.frontend.php';
$wb = new frontend();
// keep SM2 quiet
$wb->extra_where_sql = "visibility != 'none' AND visibility != 'hidden' AND visibility != 'deleted'";
// some modules may use $wb->page_id
if (isset($page_id)) {
    $wb->page_id = $page_id;
}
include CAT_PATH . '/framework/frontend.functions.php';
// -----------------------------------------------------------------------------
// get page to show
$page_id = CAT_Helper_Page::selectPage() or die;
// this will show the Intro- or Default-Page if no PAGE_ID is available
$page = CAT_Page::getInstance($page_id);
// -----------------------------------------------------------------------------
// keep SM2 happy
$wb->page = CAT_Helper_Page::properties($page_id);
$wb->default_link = CAT_Helper_Page::properties($page_id, 'link');
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// needed at least for droplets
$admin =& $wb;
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// clean up log files (older than 24 hours and size 0)
$files = CAT_Helper_Directory::findFiles('log_\\d{4}-\\d{2}-\\d{2}\\.txt', CAT_PATH . '/temp');
if (count($files)) {