getByDirname(CMS_DIR_NAME); //if(is_object($module)) { // $config_handler =& xoops_gethandler('config'); // $module_config =& $config_handler->getConfigsByCat(0, $module->getVar('mid')); //} $config_handler =& xoops_gethandler('config'); $module_config =& $config_handler->getConfigsByDirname(CMS_DIR_NAME); return $module_config['grid_name']; } function execute() { require_once(CMS_MODULE_PATH.'/include/xoopensim.func.php'); $root =& Xcube_Root::getSingleton(); $root->mLanguageManager->loadBlockMessageCatalog(CMS_DIR_NAME); // read language/*/blocks.php //$activate_events = $root->mContext->mModuleConfig['activate_events']; $activate_events = get_xoops_config('activate_events', 'XoopenSim'); $isGuest = $root->mContext->mUser->isInRole('Site.GuestUser'); $render =& $this->getRenderTarget(); $render->setTemplateName($this->_mBlock->get('template')); // read template/blocks/xoopensim_block_linkstatus.html $db_state = opensim_check_db(); // $isAvatarMax = false; /*if (!$isGuest) { $isAdmin = isXoopensimAdmin($root); $uid = $root->mContext->mXoopsUser->get('uid'); //$avatars_num = xoopensim_get_avatars_num($uid); //$usersdbHandler = & xoops_getmodulehandler('userdb', 'xoopensim'); //$criteria = & new CriteriaCompo(); //$criteria->add(new Criteria('uid', $uid)); //$avatars_num = $usersdbHandler->getCount($criteria); $max_avatars = $root->mContext->mModuleConfig['max_own_avatars']; if (!$isAdmin and $max_avatars>=0 and $avatars_num>=$max_avatars) $isAvatarMax = true; }*/ // $render->setAttribute('isGuest', $isGuest); $render->setAttribute('isAvatarMax', $isAvatarMax); $render->setAttribute('grid_status', $db_state['grid_status']); $render->setAttribute('now_online', $db_state['now_online']); $render->setAttribute('lastmonth_online', $db_state['lastmonth_online']); $render->setAttribute('user_count', $db_state['user_count']); $render->setAttribute('region_count', $db_state['region_count']); $render->setAttribute('activate_events', $activate_events); $renderSystem =& $root->getRenderSystem($this->getRenderSystemName()); $renderSystem->renderBlock($render); } } ?>