function actionHome() { if (!$this->_iProfileId) { $this->_oTemplate->displayAccessDenied(); return; } $this->_oTemplate->pageStart(); if ($_GET['make_avatar_from_shared_photo'] > 0) { if (!$this->isAllowedAdd()) { $aVars = array('msg' => _t('_bx_ava_msg_access_denied')); echo $this->_oTemplate->parseHtmlByName('error_plank', $aVars); } else { $this->_makeAvatarFromSharedPhoto((int) $_GET['make_avatar_from_shared_photo']); } } if (isset($_GET['join_text']) && $_GET['join_text']) { echo MsgBox(_t(strip_tags($_GET['join_text']))); } if (isset($_POST['set_avatar'])) { if (!$this->isAllowedAdd()) { $aVars = array('msg' => _t('_bx_ava_msg_access_denied')); } elseif (!$this->_cropAvatar()) { $aVars = array('msg' => _t('_bx_ava_set_avatar_error')); } if (!empty($aVars)) { echo $this->_oTemplate->parseHtmlByName('error_plank', $aVars); } } if (isset($_POST['remove_avatar'])) { $sImagePath = BX_AVA_DIR_TMP . $this->_iProfileId . BX_AVA_EXT; if (@unlink($sImagePath)) { $aVars = array('msg' => _t('_bx_ava_msg_avatar_was_deleted')); echo $this->_oTemplate->parseHtmlByName('error_plank', $aVars); } } bx_avatar_import('PageMain'); $oPage = new BxAvaPageMain($this); echo $oPage->getCode(); $this->_oTemplate->addCss(array('main.css', 'colors.css')); $this->_oTemplate->addJs('jquery.imgareaselect.min.js'); $this->_oTemplate->pageCode(_t('_bx_ava_page_title_home'), false, false); }
function actionHome() { if (!$this->_iProfileId) { $this->_oTemplate->displayAccessDenied(); return; } if ('bx_photos_thumb' == getParam('sys_member_info_thumb') && 'bx_photos_icon' == getParam('sys_member_info_thumb_icon')) { $sProfilePhotosUrl = BxDolService::call('photos', 'get_manage_profile_photo_url', array($this->_iProfileId, 'profile_album_name')); header('Location: ' . $sProfilePhotosUrl); exit; } $this->_oTemplate->pageStart(); if ($_GET['make_avatar_from_shared_photo'] > 0) { if (!$this->isAllowedAdd()) { $aVars = array('msg' => _t('_bx_ava_msg_access_denied')); echo $this->_oTemplate->parseHtmlByName('error_plank', $aVars); } else { $this->_makeAvatarFromSharedPhoto((int) $_GET['make_avatar_from_shared_photo']); } } if (isset($_GET['join_text']) && $_GET['join_text']) { echo MsgBox(_t(strip_tags($_GET['join_text']))); } if (isset($_POST['set_avatar'])) { if (!$this->isAllowedAdd()) { $aVars = array('msg' => _t('_bx_ava_msg_access_denied')); } elseif (!$this->_cropAvatar()) { $aVars = array('msg' => _t('_bx_ava_set_avatar_error')); } if (!empty($aVars)) { echo $this->_oTemplate->parseHtmlByName('error_plank', $aVars); } } if (isset($_POST['remove_avatar'])) { $sImagePath = BX_AVA_DIR_TMP . $this->_iProfileId . BX_AVA_EXT; if (@unlink($sImagePath)) { $aVars = array('msg' => _t('_bx_ava_msg_avatar_was_deleted')); echo $this->_oTemplate->parseHtmlByName('error_plank', $aVars); } } bx_avatar_import('PageMain'); $oPage = new BxAvaPageMain($this); echo $oPage->getCode(); $this->_oTemplate->addCss(array('main.css', 'colors.css', 'imgareaselect-default.css')); $this->_oTemplate->addJs('jquery.imgareaselect.min.js'); $this->_oTemplate->pageCode(_t('_bx_ava_page_title_home'), false, false); }