getTpl($required_page); $GLOBALS['__body'] = $body->publish(); } if(!$GLOBALS['__body']) error_404(); $template = new Template(); $logo = false; if($company = get_user_info('company')){ $sql = "SELECT config FROM {$GLOBALS['__db']}__company WHERE id='$company'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $config = unserialize(stripslashes($row['config'])); $logo = $config['logo']; } $template->register('title', strlen($GLOBALS['__title'])?$GLOBALS['__title']:$GLOBALS['_page_title_default']); $template->register('body',$GLOBALS['__body']); $template->register('logo',$logo); $template->register('favicon',$GLOBALS['__favicon']); $template->getTpl('main'); echo $template->publish(); function error_404(){ Header("Status: 404 Not Found"); $template = new Template(); $template->getTpl('404'); echo $template->publish(); exit; } function error_login(){ $template = new Template(); $template->register('target',$_SERVER['SCRIPT_URL']); $template->getTpl('sign-in'); $template->setTitle($GLOBALS['_page_title_default'].' » '.__('Sign in')); return $template->publish(); } function error_show($str){ $template = new Template(); $template->register('tekst',$str); $template->getTpl('error'); echo $template->publish(); exit; } ?>