Example #1
0
 /**
  * Run frontend application
  */
 protected function _runFrontend()
 {
     Blockmanager::useHardCacheTime($this->_config->get('blockmanager_use_hardcache_time'));
     if ($this->_config->get('maintenance')) {
         $tpl = new Template();
         $tpl->set('msg', Lang::lang()->get('MAINTENANCE'));
         echo $tpl->render($this->_config->get('templates') . 'public/error.php');
         self::close();
     }
     /*
      * Update "Users Online" statistics
      */
     if ($this->_config->get('usersOnline')) {
         $user = User::getInstance();
         if ($user->isAuthorized()) {
             Model::factory('Online')->addOnline(session_id(), $user->id);
         }
     }
     self::$_templates = $this->_config->get('templates') . 'public/';
     $page = Page::getInstance();
     $page->setTemplatesPath(self::$_templates);
     /*
      * Start routing
      */
     $router = new Frontend_Router();
     $router->route();
 }