/** * @description : function will generate profile block (used the profile template ); * @return : Html presentation data ; */ function PrintSearhResult($aProfileInfo, $aCoupleInfo = '', $aExtendedKey = null, $sTemplateName = '', $oCustomTemplate = null) { global $site; global $aPreValues; $iVisitorID = getLoggedId(); $bExtMode = !empty($_GET['mode']) && $_GET['mode'] == 'extended' || !empty($_GET['search_result_mode']) && $_GET['search_result_mode'] == 'ext'; $isShowMatchPercent = $bExtMode && $iVisitorID && $iVisitorID != $aProfileInfo['ID'] && getParam('view_match_percent') && getParam('enable_match'); $bPublic = $bExtMode ? bx_check_profile_visibility($aProfileInfo['ID'], $iVisitorID, true) : true; $sProfileThumb = get_member_thumbnail($aProfileInfo['ID'], 'none', !$bExtMode, 'visitor'); $sProfileMatch = $isShowMatchPercent ? $GLOBALS['oFunctions']->getProfileMatch($iVisitorID, $aProfileInfo['ID']) : ''; $sProfileNickname = '<a href="' . getProfileLink($aProfileInfo['ID']) . '">' . getNickName($aProfileInfo['ID']) . '</a>'; $sProfileInfo = $GLOBALS['oFunctions']->getUserInfo($aProfileInfo['ID']); $sProfileDesc = $bPublic ? strmaxtextlen($aProfileInfo['DescriptionMe'], 130) : _t('_sys_profile_private_text_title'); $sProfileZodiac = $bPublic && $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aProfileInfo['DateOfBirth']) : ''; $sProfile2ASc1 = $sProfile2ASc2 = $sProfile2Nick = $sProfile2Desc = $sProfile2Info = $sProfile2Zodiac = ''; if ($aCoupleInfo) { $sProfile2Nick = '<a href="' . getProfileLink($aCoupleInfo['ID']) . '">' . getNickName($aCoupleInfo['ID']) . '</a>'; $sProfile2Info = $GLOBALS['oFunctions']->getUserInfo($aCoupleInfo['ID']); $sProfile2Desc = $bPublic ? strmaxtextlen($aCoupleInfo['DescriptionMe'], 130) : _t('_sys_profile_private_text_title'); $sProfile2Zodiac = $bPublic && $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aCoupleInfo['DateOfBirth']) : ''; $sProfile2ASc1 = 'float:left;width:31%;margin-right:10px;'; $sProfile2ASc2 = 'float:left;width:31%;display:block;'; } else { $sProfile2ASc2 = 'display:none;'; } $aKeys = array('thumbnail' => $sProfileThumb, 'match' => $sProfileMatch, 'nick' => $sProfileNickname, 'info' => $sProfileInfo, 'i_am_desc' => $sProfileDesc, 'zodiac_sign' => $sProfileZodiac, 'nick2' => $sProfile2Nick, 'info2' => $sProfile2Info, 'i_am_desc2' => $sProfile2Desc, 'zodiac_sign2' => $sProfile2Zodiac, 'add_style_c1' => $sProfile2ASc1, 'add_style_c2' => $sProfile2ASc2); if ($aExtendedKey and is_array($aExtendedKey) and !empty($aExtendedKey)) { foreach ($aExtendedKey as $sKey => $sValue) { $aKeys[$sKey] = $sValue; } } else { $aKeys['ext_css_class'] = ''; } return $oCustomTemplate ? $oCustomTemplate->parseHtmlByName($sTemplateName, $aKeys) : $GLOBALS['oSysTemplate']->parseHtmlByName($sTemplateName, $aKeys); }
require_once 'inc/header.inc.php'; require_once BX_DIRECTORY_PATH_INC . 'design.inc.php'; require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolPageView.php'; bx_import('BxTemplProfileView'); $sPageCaption = _t('_Profile info'); $_page['name_index'] = 7; $_page['header'] = $sPageCaption; $_page['header_text'] = $sPageCaption; $_page['css_name'] = 'profile_view.css'; //-- init some needed variables --//; $iViewedID = false != bx_get('ID') ? (int) bx_get('ID') : 0; if (!$iViewedID) { $iViewedID = getLoggedId(); } // check profile membership, status, privacy and if it is exists bx_check_profile_visibility($iViewedID, getLoggedId()); $GLOBALS['oTopMenu']->setCurrentProfileID($iViewedID); // fill array with all profile informaion $aMemberInfo = getProfileInfo($iViewedID); // build page; $_ni = $_page['name_index']; // prepare all needed keys ; $aMemberInfo['anonym_mode'] = $oTemplConfig->bAnonymousMode; $aMemberInfo['member_pass'] = $aMemberInfo['Password']; $aMemberInfo['member_id'] = $aMemberInfo['ID']; $aMemberInfo['url'] = BX_DOL_URL_ROOT; bx_import('BxDolProfileInfoPageView'); $oProfileInfo = new BxDolProfileInfoPageView('profile_info', $aMemberInfo); $sOutputHtml = $oProfileInfo->getCode(); $_page_cont[$_ni]['page_main_code'] = $sOutputHtml; PageCode();
protected function _getProfileInfoWithAccessChecking($iProfileId) { if (!($aProfileInfo = getProfileInfo($iProfileId))) { $this->errorOutput('404', 'not_found', 'Profile was not found'); return false; } if (!bx_check_profile_visibility($iProfileId, $aToken['user_id'], true)) { $this->errorOutput(403, 'access_denied', 'You have no rights to view this user info'); return false; } return $aProfileInfo; }
bx_import('BxDolInstallerUtils'); $profileID = getID($_GET['ID']); $memberID = getLoggedId(); $sCodeLang = 'lang'; $sCodeTempl = $GLOBALS['oSysTemplate']->getCodeKey(); if (isset($_GET[$sCodeLang]) || isset($_GET[$sCodeTempl])) { $sCurrentUrl = $_SERVER['PHP_SELF'] . '?' . bx_encode_url_params($_GET, array($sCodeLang, $sCodeTempl)); $aMatch = array(); if (preg_match('/profile.php\\?ID=([a-zA-Z0-9_-]+)(.*)/', $sCurrentUrl, $aMatch)) { header("HTTP/1.1 301 Moved Permanently"); header('Location:' . getProfileLink($profileID)); send_headers_page_changed(); } } // check profile membership, status, privacy and if it is exists bx_check_profile_visibility($profileID, $memberID); // make profile view alert and record profile view event if ($profileID != $memberID) { require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'; $oAlert = new BxDolAlerts('profile', 'view', $profileID, $memberID); $oAlert->alert(); bx_import('BxDolViews'); new BxDolViews('profiles', $profileID); } $oProfile = new BxBaseProfileGenerator($profileID); $oProfile->oCmtsView->getExtraCss(); $oProfile->oCmtsView->getExtraJs(); $oProfile->oVotingView->getExtraJs(); $oSysTemplate->addJs('view_edit.js'); $_ni = 5; $_page['name_index'] = $_ni;
/** * Get location array * @param $sPart module/part name * @param $iEntryId entry's id which location is edited * @param $iViewer viewer profile id * @return false - location undefined, -1 - access denied, array - all good */ function serviceGetLocation($sPart, $iEntryId, $iViewer = false) { if (false === $iViewer) { $iViewer = getLoggedId(); } if ('profiles' == $sPart) { if (!bx_check_profile_visibility($iEntryId, $iViewer, true)) { return -1; } } else { bx_import('BxDolPrivacy'); $oPrivacy = new BxDolPrivacy($this->_aParts[$sPart]['join_table'], $this->_aParts[$sPart]['join_field_id'], $this->_aParts[$sPart]['join_field_author']); if (!$oPrivacy->check('view', $iEntryId, $iViewer)) { return -1; } } $aLocation = $this->_oDb->getDirectLocation($iEntryId, $this->_aParts[$sPart]); if (!$aLocation || !$aLocation['lat'] && $aLocation['lng']) { return false; } if (false === $aLocation['zoom'] || -1 == $aLocation['zoom']) { $aLocation['zoom'] = getParam("bx_wmap_edit_{$sPart}_zoom"); } if (!$aLocation['type']) { $aLocation['type'] = getParam("bx_wmap_edit_{$sPart}_map_type"); } return $aLocation; }
$_page['js_name'] = 'browse_members.js'; $iProfileId = isset($_GET['iUser']) ? (int) $_GET['iUser'] : getLoggedId(); if (!$iProfileId) { $_page['header'] = _t('_View friends'); $_page['header_text'] = _t('_View friends'); $_page['name_index'] = 0; $_page_cont[0]['page_main_code'] = MsgBox(_t('_Profile NA')); PageCode(); exit; } $sPageCaption = _t('_Friends of', getNickName($iProfileId)); $_page['header'] = $sPageCaption; $_page['header_text'] = $sPageCaption; $_ni = $_page['name_index']; // check profile membership, status, privacy and if it is exists bx_check_profile_visibility($iProfileId, getLoggedId()); // generate page if (isset($_GET['per_page'])) { $iPerPage = (int) $_GET['per_page']; } else { if (isset($_GET['mode']) && $_GET['mode'] == 'extended') { $iPerPage = 5; } else { $iPerPage = 32; } } if ($iPerPage <= 0) { $iPerPage = 32; } if ($iPerPage > 100) { $iPerPage = 100;