*/ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . " GMT"); // always modified header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header('Pragma: no-cache'); // HTTP/1.0 header('Content-Type: text/html; charset=utf-8'); require_once 'inc/header.inc.php'; require_once BX_DIRECTORY_PATH_INC . 'design.inc.php'; require_once BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php'; bx_import('BxTemplMemberMenu'); bx_import('BxDolPageView'); $oMemberMenu = new BxTemplMemberMenu(); // return member's extra menu sub block ; if (isset($_GET['action'])) { // read data from cache file ; $oCache = $GLOBALS['MySQL']->getDbCacheObject(); $aMenuStructure = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey($oMemberMenu->sMenuCacheFile)); // if cache file defined; if ($aMenuStructure) { $iMemberId = getLoggedId(); $iMenuId = isset($_GET['menu_id']) ? (int) $_GET['menu_id'] : 0; $sOutputHtml = null; switch ($_GET['action']) { case 'get_menu_content': if ($iMemberId && $iMenuId) { // define the menu's sub menu code ; $sSubMenuCode = null;
/** * Parse system keys. * * @param string $sKey key * @return string value associated with the key. */ function parseSystemKey($sKey, $mixedKeyWrapperHtml = null) { global $site; global $_page; global $oFunctions; global $oTemplConfig; global $logged; $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml); $sRet = ''; switch ($sKey) { case 'page_charset': $sRet = 'UTF-8'; break; case 'page_keywords': if (!empty($GLOBALS[$this->_sPrefix . 'PageKeywords']) && is_array($GLOBALS[$this->_sPrefix . 'PageKeywords'])) { $sRet = '<meta name="keywords" content="' . bx_html_attribute(implode(',', $GLOBALS[$this->_sPrefix . 'PageKeywords'])) . '" />'; } break; case 'page_description': if (!empty($GLOBALS[$this->_sPrefix . 'PageDescription']) && is_string($GLOBALS[$this->_sPrefix . 'PageDescription'])) { $sRet = '<meta name="description" content="' . bx_html_attribute($GLOBALS[$this->_sPrefix . 'PageDescription']) . '" />'; } break; case 'page_header': if (!empty($GLOBALS[$this->_sPrefix . 'PageTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle']; } else { if (isset($_page['header'])) { $sRet = $_page['header']; } } //$sRet = process_line_output($sRet); break; case 'page_header_text': if (!empty($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageMainBoxTitle']; } else { if (isset($_page['header_text'])) { $sRet = $_page['header_text']; } } //$sRet = process_line_output($sRet); break; case 'main_div_width': if (!empty($GLOBALS[$this->_sPrefix . 'PageWidth'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageWidth']); } break; case 'main_logo': $sRet = $GLOBALS['oFunctions']->genSiteLogo(); break; case 'main_splash': $sRet = $GLOBALS['oFunctions']->genSiteSplash(); break; case 'top_menu': $sRet = $GLOBALS['oTopMenu']->getCode(); break; case 'top_menu_breadcrumb': $sRet = !empty($GLOBALS['oTopMenu']->sBreadCrumb) ? $GLOBALS['oTopMenu']->sBreadCrumb : $GLOBALS['oTopMenu']->genBreadcrumb(); break; case 'extra_top_menu': $iProfileId = getLoggedId(); if ($iProfileId && getParam('ext_nav_menu_enabled')) { bx_import('BxTemplMemberMenu'); $oMemberMenu = new BxTemplMemberMenu(); $sRet = $oMemberMenu->genMemberMenu($iProfileId); } break; case 'bottom_links': $sRet = $oFunctions->genSiteBottomMenu(); break; case 'switch_skin_block': $sRet = getParam("enable_template") ? templates_select_txt() : ''; break; case 'dol_images': $sRet = $this->_processJsImages(); break; case 'dol_lang': $sRet = $this->_processJsTranslations(); break; case 'dol_options': $sRet = $this->_processJsOptions(); break; case 'bottom_text': $sRet = _t('_bottom_text', date('Y')); break; case 'copyright': $sRet = _t('_copyright', date('Y')) . getVersionComment(); break; case 'flush_header': //TODO: add some variable to disable it if needed //flush(); break; case 'extra_js': $sRet = empty($_page['extra_js']) ? '' : $_page['extra_js']; break; case 'is_profile_page': $sRet = defined('BX_PROFILE_PAGE') ? 'true' : 'false'; break; default: $sRet = ($sTemplAdd = $oFunctions->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : $aKeyWrappers['left'] . $sKey . $aKeyWrappers['right']; } $sRet = BxDolTemplate::processInjection($_page['name_index'], $sKey, $sRet); return $sRet; }
/** * Change profile status * * @param $iProfileId integer * @param $sStatus text * @return text */ function ActionChangeStatus($iProfileId, $sStatus = '') { $iProfileId = (int) $iProfileId; $sOutputCode = ''; $oUserStatus = new BxDolUserStatusView(); if ($oUserStatus->getRegisteredStatus($sStatus)) { //process status $sStatus = process_db_input($sStatus, BX_TAGS_STRIP, BX_SLASHES_AUTO); $sQuery = "UPDATE `Profiles` SET `UserStatus`='{$sStatus}', `DateLastNav` = NOW()\n WHERE `ID` = '{$iProfileId}'"; if (db_res($sQuery, 0)) { // send system event bx_import('BxDolAlerts'); $oZ = new BxDolAlerts('profile', 'edit_status', $iProfileId, $iProfileId); $oZ->alert(); bx_import('BxTemplMemberMenu'); $oMemberMenu = new BxTemplMemberMenu(); $oMemberMenu->deleteMemberMenuKeyFile($iProfileId); createUserDataFile($iProfileId); $sOutputCode = $oUserStatus->getStatusIcon($iProfileId); } } return $sOutputCode; }