Пример #1
0
 /**
  * singleton
  *
  * @return	BangMemcache
  */
 public static function instance()
 {
     if (self::$instance === NULL) {
         self::$instance = new BangMemcache();
     }
     return self::$instance;
 }
Пример #2
0
 public static function getUserLastActivityInRoom($user, $room)
 {
     $memcacheInstance = BangMemcache::instance();
     if ($memcacheInstance->getMemcache()) {
         $key = 'last_activity_user_' . $user . '_room_' . $room;
         return $memcacheInstance->get($key);
     } else {
         $query = 'SELECT last_activity FROM ' . DB_PREFIX . self::$roomUserTable . ' WHERE user = '******' AND room = ' . intval($room);
         $user = DB::fetchFirst($query);
         return $user['last_activity'];
     }
 }
Пример #3
0
        $url = PageActionMap::createUrl($page['alias']);
        Utils::redirect($url);
    }
    $actionClass = new $actionClassName();
    MySmarty::assign('content', $actionClass->getContent());
} catch (Exception $e) {
    // TODO vsetky exceptions lokalizovat a hadzat uz lokalizovane aby sa tu mohli vypisat
    $pageNotFoundBox = new PageNotFoundBox();
    $pageNotFoundBox->setMessage($e->getMessage());
    $content = $pageNotFoundBox->render();
    MySmarty::assign('content', $content);
}
$upperPartBox = new UpperPartBox();
MySmarty::assign('upperPart', $upperPartBox->render());
// nacachujeme si menu
$memcache = BangMemcache::instance();
$key = 'main_menu_' . $language . '_' . $actionAlias;
$menu = $memcache->get($key);
if (!$menu) {
    $menuBox = new MenuBox();
    $menuBox->setActualAction($action);
    $menu = $menuBox->render();
    $memcache->set($key, $menu, NULL, '+2 hours');
}
MySmarty::assign('menu', $menu);
MySmarty::assign('title', BangSeo::getTitle());
MySmarty::assign('description', BangSeo::getDescription());
MySmarty::assign('keywords', BangSeo::getKeywords());
MySmarty::assign('actualYear', date('Y'));
MySmarty::assign('baseUrl', BASE_URL);
echo MySmarty::fetch('index.tpl');