function _checkProfileMatch($iProfileId, $sAction) { $aProfile = getProfileInfo($iProfileId); if ($aProfile['Status'] == 'Active' && ($aProfile['UpdateMatch'] || $sAction == 'join')) { $oDb = new BxDolDb(); // clear field "UpdateMatch" $oDb->query("UPDATE `Profiles` SET `UpdateMatch` = 0 WHERE `ID`= {$iProfileId}"); // clear cache $oDb->query("DELETE FROM `sys_profiles_match`"); // get send mails $aSendMails = $oDb->getRow("SELECT `profiles_match` FROM `sys_profiles_match_mails` WHERE `profile_id` = {$iProfileId}"); $aSend = !empty($aSendMails) ? unserialize($aSendMails['profiles_match']) : array(); $aProfiles = getMatchProfiles($iProfileId); foreach ($aProfiles as $iProfId) { if (!isset($aSend[(int) $iProfId])) { $oEmailTemplate = new BxDolEmailTemplates(); $aMessage = $oEmailTemplate->parseTemplate('t_CupidMail', array('StrID' => $iProfId, 'MatchProfileLink' => getProfileLink($iProfileId)), $iProfId); $aProfile = getProfileInfo($iProfId); if (!empty($aProfile) && $aProfile['Status'] == 'Active') { $oDb->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aProfile['Email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "', '" . process_db_input($aMessage['body'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "')"); } $aSend[(int) $iProfId] = 0; } } if (empty($aSendMails)) { $oDb->query("INSERT INTO `sys_profiles_match_mails`(`profile_id`, `profiles_match`) VALUES({$iProfileId}, '" . serialize($aSend) . "')"); } else { $oDb->query("UPDATE `sys_profiles_match_mails` SET `profiles_match` = '" . serialize($aSend) . "' WHERE `profile_id` = {$iProfileId}"); } } }
function getBlockCode_Search() { global $logged; $aProfile = $logged['member'] ? getProfileInfo((int) $_COOKIE['memberID']) : array(); // default params for search form $sCountry = ''; $mixedCountry = bx_get('Country'); if ($mixedCountry && is_array($mixedCountry)) { $sCountry = process_pass_data($mixedCountry[0], 1); } elseif ($mixedCountry && is_string($mixedCountry)) { $sCountry = process_pass_data($mixedCountry, 1); } $sSex = ''; $mixedSex = bx_get('Sex'); if ($mixedSex && is_array($mixedSex)) { $sSex = array(); foreach ($mixedSex as $v) { $sSex[] = process_pass_data($v, 1); } } elseif ($mixedSex && is_string($mixedSex)) { $sSex = process_pass_data($mixedSex, 1); } $aDefaultParams = array('LookingFor' => bx_get('LookingFor') ? process_pass_data(bx_get('LookingFor'), 1) : ($aProfile['Sex'] ? $aProfile['Sex'] : 'male'), 'Sex' => $sSex ? $sSex : ($aProfile['LookingFor'] ? $aProfile['LookingFor'] : 'female'), 'Country' => $sCountry ? $sCountry : ($aProfile['Country'] ? $aProfile['Country'] : getParam('default_country')), 'DateOfBirth' => bx_get('DateOfBirth') ? process_pass_data(bx_get('DateOfBirth'), 1) : getParam('search_start_age') . '-' . getParam('search_end_age'), 'Tags' => bx_get('Tags') ? process_pass_data(bx_get('Tags'), 1) : '', 'online_only' => bx_get('online_only') ? process_pass_data(bx_get('online_only'), 1) : '', 'photos_only' => bx_get('photos_only') ? process_pass_data(bx_get('photos_only'), 1) : ''); bx_import('BxDolProfileFields'); $oPF = new BxDolProfileFields(9); $a = array('default_params' => $aDefaultParams, 'form_attrs' => array('action' => $this->oConfig->getBaseUri()), 'inputs' => array(array('type' => 'hidden', 'name' => 'r', 'value' => $this->oMain->_aModule['uri']))); $aVars = array('content' => $oPF->getFormCode($a)); return $this->oTemplate->parseHtmlByName('search_form_wrapper', $aVars); }
/** * Class constructor; * * @param : $sPageName (string) - builder's page name; * @param : $oPollModule (object) - created poll's module object; * @param : $iPollId (integer) - poll's Id; */ function BxPollView($sPageName, &$aModule, &$oPollModule, $iPollId) { parent::BxDolPageView($sPageName); // define member's Id; $aProfileInfo = getProfileInfo(); $this->iMemberId = isset($aProfileInfo['ID']) ? $aProfileInfo['ID'] : 0; $this->oModule = $oPollModule; $this->iPollId = $iPollId; if ($this->iPollId) { $this->aPollInfo = $this->oModule->_oDb->getPollInfo($this->iPollId); if (!$this->oModule->oPrivacy->check('view', $this->aPollInfo[0]['id_poll'], $this->iMemberId)) { echo $this->oModule->_oTemplate->defaultPage(_t('_bx_poll'), MsgBox(_t('_bx_poll_access_denied')), 2); exit; } } if ($this->aPollInfo) { $this->aPollInfo = array_shift($this->aPollInfo); } $this->oVotingView = new BxTemplVotingView('bx_poll', $this->iPollId); $this->oCmtsView = new BxPollCmts('bx_poll', $this->iPollId); $this->aModule = $aModule; if ($sPageName == 'show_poll_info') { $GLOBALS['oTopMenu']->setCustomSubHeaderUrl(BX_DOL_URL_ROOT . $this->oModule->_oConfig->getBaseUri() . '&action=show_poll_info&id=' . $this->iPollId); } $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(_t('_bx_poll') => BX_DOL_URL_ROOT . $this->oModule->_oConfig->getBaseUri() . '&action=poll_home', $this->aPollInfo['poll_question'] => '')); }
/** * Get processed message * * @param $aMessages array * @param $bDeleteAllowed boolean * @param $bBlockAllowed boolean * @return text */ function getProcessedMessages($aMessages = array(), $bDeleteAllowed = false, $bBlockAllowed = false) { global $oFunctions; if (!$aMessages) { return; } $sOutputCode = ''; $aLanguageKeys = array('by' => _t('_bx_shoutbox_by'), 'visitor' => _t('_Visitor'), 'delete' => _t('_bx_shoutbox_delete_message'), 'sure' => _t('_Are_you_sure'), 'block' => _t('_bx_shoutbox_block_ip')); foreach ($aMessages as $iKey => $aItems) { $sMemberIcon = ''; $aProfileInfo = $aItems['OwnerID'] > 0 ? getProfileInfo($aItems['OwnerID']) : array(); // define some profile's data; if ($aProfileInfo) { $sNickName = getNickName($aProfileInfo['ID']); $sLink = getProfileLink($aItems['OwnerID']); $sMemberIcon = $oFunctions->getMemberIcon($aItems['OwnerID']); } else { $sLink = 'javascript:void(0)'; $sNickName = $aLanguageKeys['visitor']; } $aKeys = array('owner_icon' => $sMemberIcon, 'message' => WordWrapStr($aItems['Message']), 'by' => $aLanguageKeys['by'], 'owner_nick' => $sNickName, 'date' => defineTimeInterval($aItems['DateTS'], true, true), 'owner_link' => $sLink, 'bx_if:delete_allowed' => array('condition' => $bDeleteAllowed, 'content' => array('delete_cpt' => bx_html_attribute($aLanguageKeys['delete']), 'sure_cpt' => bx_js_string($aLanguageKeys['sure']), 'message_id' => $aItems['ID'])), 'bx_if:block_allowed' => array('condition' => $bBlockAllowed, 'content' => array('block_cpt' => bx_html_attribute($aLanguageKeys['block']), 'sure_cpt' => bx_js_string($aLanguageKeys['sure']), 'message_id' => $aItems['ID']))); $sTemplateName = $aProfileInfo ? 'message.html' : 'visitor_message.html'; $sOutputCode .= $this->parseHtmlByName($sTemplateName, $aKeys); } return $sOutputCode; }
function genSiteServiceMenu() { $bLogged = isLogged(); $aMenuItem = array(); $sMenuPopupId = ''; $sMenuPopupContent = ''; $bShowVisitor = false; bx_import('BxTemplMenuService'); $oMenu = new BxTemplMenuService(); if ($bLogged) { $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']); $sThumbSetting = getParam('sys_member_info_thumb_icon'); bx_import('BxDolMemberInfo'); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting); $sThumbUrl = $o ? $o->get($aProfile) : ''; $bThumb = !empty($sThumbUrl); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x'); $sThumbTwiceUrl = $o ? $o->get($aProfile) : ''; if (!$sThumbTwiceUrl) { $sThumbTwiceUrl = $sThumbUrl; } $aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'title' => getNickName($oMenu->aMenuInfo['memberID'])); $sMenuPopupId = 'sys-service-menu-' . time(); $sMenuPopupContent = $this->transBox($oMenu->getCode()); } else { $aItems = $oMenu->getItemsArray(); if (!empty($aItems)) { $bShowVisitor = true; $bLoginOnly = $aItems[0]['name'] == 'LoginOnly'; $aMenuItem = array('caption' => $bLoginOnly ? $aItems[0]['caption'] : _t('_sys_sm_join_or_login'), 'icon' => $bLoginOnly ? $aItems[0]['icon'] : 'user', 'script' => $aItems[0]['script'], 'bx_if:show_fu_thumb_image' => array('condition' => false, 'content' => array()), 'bx_if:show_fu_thumb_icon' => array('condition' => false, 'content' => array()), 'title' => ''); } } return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged && $bShowVisitor, 'content' => $aMenuItem), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent)); }
function getProfilesMatch($iPID1 = 0, $iPID2 = 0) { $iPID1 = (int) $iPID1; $iPID2 = (int) $iPID2; if (!$iPID1 or !$iPID2) { return 0; } if ($iPID1 == $iPID2) { return 0; } $aProf1 = getProfileInfo($iPID1); $aProf2 = getProfileInfo($iPID2); if (empty($aProf1) || empty($aProf2)) { return 0; } $iMatch = 0; $aMathFields = getMatchFields(); foreach ($aMathFields as $sKey => $aFields) { $bRes = false; if ($aProf1[$aFields['Name']]) { if ($aMathFields[$aFields['MatchField']]['Name'] == 'DateOfBirth') { $bRes = age($aProf1['DateOfBirth']) == age($aProf2['DateOfBirth']); } else { $bRes = $aProf1[$aFields['Name']] == $aProf2[$aMathFields[$aFields['MatchField']]['Name']]; } } if ($bRes) { $iMatch += (int) $aFields['MatchPercent']; } } return $iMatch; }
function genSiteServiceMenu() { $bLogged = isLogged(); $aMenuItem = array(); $sMenuPopupId = ''; $sMenuPopupContent = ''; if ($bLogged) { bx_import('BxTemplMenuService'); $oMenu = new BxTemplMenuService(); if ($oMenu->aMenuInfo['memberID'] != 0) { $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']); } $sThumbSetting = getParam('sys_member_info_thumb_icon'); bx_import('BxDolMemberInfo'); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting); $sThumbUrl = $o ? $o->get($aProfile) : ''; $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x'); $sThumbTwiceUrl = $o ? $o->get($aProfile) : ''; if (!$sThumbTwiceUrl) { $sThumbTwiceUrl = $sThumbUrl; } $bThumb = !empty($sThumbUrl); $aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'thumbnail' => get_member_icon($oMenu->aMenuInfo['memberID']), 'title' => getNickName($oMenu->aMenuInfo['memberID'])); $sMenuPopupId = 'sys-service-menu-' . time(); $sMenuPopupContent = $this->transBox($oMenu->getCode()); } return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged, 'content' => array()), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent)); }
function getProfilesMatch($iPID1 = 0, $iPID2 = 0) { $iPID1 = (int) $iPID1; $iPID2 = (int) $iPID2; if (!$iPID1 or !$iPID2) { return 0; } if ($iPID1 == $iPID2) { return 0; } //maybe need to return 100?? :) // try to find in cache $sQuery = "SELECT `Percent` FROM `ProfilesMatch` WHERE `PID1` = {$iPID1} AND `PID2` = {$iPID2}"; $aPercent = db_assoc_arr($sQuery); if ($aPercent) { return (int) $aPercent['Percent']; } //not found in cache $aProf1 = getProfileInfo($iPID1); $aProf2 = getProfileInfo($iPID2); if (!$aProf1 or !$aProf2) { return 0; } $oPF = new BxDolProfileFields(101); //matching area $iMatch = $oPF->getProfilesMatch($aProf1, $aProf2); //write to cache $sQuery = "INSERT INTO `ProfilesMatch` ( `PID1`, `PID2`, `Percent` ) VALUES ( {$iPID1}, {$iPID2}, {$iMatch} )"; db_res($sQuery); return $iMatch; }
function onPostReply($aTopic, $sPostText, $sUser) { $oProfile = new BxDolProfile($sUser); $iProfileId = $oProfile->getID(); if (BX_ORCA_INTEGRATION == 'dolphin' && !isAdmin($iProfileId)) { defineForumActions(); $iActionId = BX_FORUM_PUBLIC_POST; if (isset($aTopic['forum_type']) && 'private' == $aTopic['forum_type']) { $iActionId = BX_FORUM_PRIVATE_POST; } checkAction($iProfileId, $iActionId, true); // perform action } $aPlusOriginal = array('PosterUrl' => $iProfileId ? getProfileLink($iProfileId) : 'javascript:void(0);', 'PosterNickName' => $iProfileId ? getNickName($iProfileId) : $sUser, 'TopicTitle' => $aTopic['topic_title'], 'ReplyText' => $sPostText); $oEmailTemplate = new BxDolEmailTemplates(); $aTemplate = $oEmailTemplate->getTemplate('bx_forum_notifier'); $fdb = new DbForum(); $a = $fdb->getSubscribersToTopic($aTopic['topic_id']); foreach ($a as $r) { if ($r['user'] == $sUser) { continue; } $oRecipient = new BxDolProfile($r['user']); $aRecipient = getProfileInfo($oRecipient->_iProfileID); $aPlus = array_merge(array('Recipient' => ' ' . getNickName($aRecipient['ID'])), $aPlusOriginal); sendMail(trim($aRecipient['Email']), $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus); } forumAlert('reply', $aTopic['topic_id'], $iProfileId); }
/** * page code function */ function PageCompPageMainCode($iID, $sConfCode) { global $site; $ID = (int) $iID; $ConfCode = clear_xss($sConfCode); $p_arr = getProfileInfo($ID); if (!$p_arr) { $_page['header'] = _t("_Error"); $_page['header_text'] = _t("_Profile Not found"); return MsgBox(_t('_Profile Not found Ex')); } $aCode = array('message_status' => '', 'message_info' => '', 'bx_if:form' => array('condition' => false, 'content' => array('form' => '')), 'bx_if:next' => array('condtion' => false, 'content' => array('next_url' => ''))); if ($p_arr['Status'] == 'Unconfirmed') { $ConfCodeReal = base64_encode(base64_encode(crypt($p_arr[Email], CRYPT_EXT_DES ? "secret_co" : "se"))); if (strcmp($ConfCode, $ConfCodeReal) != 0) { $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'profile_activate.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('conf_id' => array('type' => 'hidden', 'name' => 'ConfID', 'value' => $ID), 'conf_code' => array('type' => 'text', 'name' => 'ConfCode', 'value' => '', 'caption' => _t("_Confirmation code")), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Submit")))); $oForm = new BxTemplFormView($aForm); $aCode['message_status'] = _t("_Profile activation failed"); $aCode['message_info'] = _t("_EMAIL_CONF_FAILED_EX"); $aCode['bx_if:form']['condition'] = true; $aCode['bx_if:form']['content']['form'] = $oForm->getCode(); } else { $aCode['bx_if:next']['condition'] = true; $aCode['bx_if:next']['content']['next_url'] = BX_DOL_URL_ROOT . 'member.php'; $send_act_mail = false; if (getParam('autoApproval_ifJoin') == 'on' && !(getParam('sys_dnsbl_enable') && 'approval' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join'))) { $status = 'Active'; $send_act_mail = true; $aCode['message_info'] = _t("_PROFILE_CONFIRM"); } else { $status = 'Approval'; $aCode['message_info'] = _t("_EMAIL_CONF_SUCCEEDED", $site['title']); } $update = bx_admin_profile_change_status($ID, $status, $send_act_mail); // Promotional membership if (getParam('enable_promotion_membership') == 'on') { $memership_days = getParam('promotion_membership_days'); setMembership($p_arr['ID'], MEMBERSHIP_ID_PROMOTION, $memership_days, true); } // check couple profile; if ($p_arr['Couple']) { $update = bx_admin_profile_change_status($p_arr['Couple'], $status); //Promotional membership if (getParam('enable_promotion_membership') == 'on') { $memership_days = getParam('promotion_membership_days'); setMembership($p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true); } } if (getParam('newusernotify')) { $oEmailTemplates = new BxDolEmailTemplates(); $aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed', $p_arr['ID']); sendMail($site['email_notify'], $aTemplate['Subject'], $aTemplate['Body'], $p_arr['ID']); } } } else { $aCode['message_info'] = _t('_ALREADY_ACTIVATED'); } return $GLOBALS['oSysTemplate']->parseHtmlByName('profile_activate.html', $aCode); }
function getBaseUrl() { $aEntry = getProfileInfo($this->getId()); if (empty($aEntry) || !is_array($aEntry)) { return ''; } return getProfileLink($aEntry['ID']); }
function getBlockCode_QuickSearch() { $aProfile = isLogged() ? getProfileInfo() : array(); // default params for search form $aDefaultParams = array('LookingFor' => !empty($aProfile['Sex']) ? $aProfile['Sex'] : 'male', 'Sex' => !empty($aProfile['LookingFor']) ? $aProfile['LookingFor'] : 'female', 'Country' => !empty($aProfile['Country']) ? $aProfile['Country'] : getParam('default_country'), 'DateOfBirth' => getParam('search_start_age') . '-' . getParam('search_end_age')); $oPF = new BxDolProfileFields(10); return array($oPF->getFormCode(array('default_params' => $aDefaultParams)), array(), array(), false); }
function BxBaseAccountView($iMember, &$aSite, &$aDir) { $this->iMember = (int) $iMember; $this->aMemberInfo = getProfileInfo($this->iMember); $this->aConfSite = $aSite; $this->aConfDir = $aDir; parent::BxDolPageView('member'); }
function __construct($iMember, &$aSite, &$aDir) { $this->iMember = (int) $iMember; $this->aMemberInfo = getProfileInfo($this->iMember); $this->aConfSite = $aSite; $this->aConfDir = $aDir; parent::__construct('member'); }
function getMySubscriptions() { $aUserInfo = getProfileInfo(); $aSubscriptions = $this->_oDb->getSubscriptionsByUser((int) $aUserInfo['ID']); if (empty($aSubscriptions)) { return MsgBox(_t('_Empty')); } $aForm = array('form_attrs' => array('id' => 'sbs-subscriptions-form', 'name' => 'sbs-subscriptions-form', 'action' => bx_html_attribute($_SERVER['PHP_SELF']), 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array(), 'inputs' => array()); $sUnit = ''; $bCollapsed = true; foreach ($aSubscriptions as $aSubscription) { if ($sUnit != $aSubscription['unit']) { if (!empty($sUnit)) { $aForm['inputs'][$sUnit . '_end'] = array('type' => 'block_end'); } $aForm['inputs'][$aSubscription['unit'] . '_begin'] = array('type' => 'block_header', 'caption' => _t('_sbs_txt_title_' . $aSubscription['unit']), 'collapsable' => true, 'collapsed' => $bCollapsed); $sUnit = $aSubscription['unit']; $bCollapsed = true; } $oFunction = create_function('$arg1, $arg2, $arg3', $aSubscription['params']); $aParams = $oFunction($aSubscription['unit'], $aSubscription['action'], $aSubscription['object_id']); $sName = 'sbs-subscription_' . $aSubscription['entry_id']; $aForm['inputs'][$sName] = array('type' => 'custom', 'name' => $sName, 'content' => '<a href="' . $aParams['template']['ViewLink'] . '">' . $aParams['template']['Subscription'] . '</a> <a href="javascript:void(0)" onclick="return unsubscribeConfirm(\'' . $this->_getUnsubscribeLink((int) $aSubscription['entry_id']) . '\');">' . _t('_sys_btn_sbs_unsubscribe') . '</a>', 'colspan' => true); } //'' . . '' $aForm['inputs'][$sUnit . '_end'] = array('type' => 'block_end'); $oForm = new BxTemplFormView($aForm); $sContent = $oForm->getCode(); $GLOBALS['oSysTemplate']->addJsTranslation('_sbs_wrn_unsubscribe'); ob_start(); ?> <script language="javascript" type="text/javascript"> <!-- function unsubscribeConfirm(sUrl){ if(confirm(_t('_sbs_wrn_unsubscribe'))) { $.get( sUrl + '&js=1', {}, function(oData){ alert(oData.message); if(oData.code == 0) window.location.href = window.location.href; }, 'json' ); return true; } else return false; } --> </script> <?php $sContent .= ob_get_clean(); return $sContent; }
function blockInfo(&$aEvent) { if (null == $this->_oMain) { $this->_oMain = BxDolModule::getInstance('BxEventsModule'); } $aAuthor = getProfileInfo($aEvent['ResponsibleID']); $aVars = array('author_unit' => $GLOBALS['oFunctions']->getMemberThumbnail($aAuthor['ID'], 'none', true), 'date' => getLocaleDate($aEvent['Date'], BX_DOL_LOCALE_DATE_SHORT), 'date_ago' => defineTimeInterval($aEvent['Date'], false), 'cats' => $this->parseCategories($aEvent['Categories']), 'tags' => $this->parseTags($aEvent['Tags']), 'location' => $this->_oMain->_formatLocation($aEvent, true, true), 'fields' => $this->blockFields($aEvent), 'author_username' => $aAuthor ? $aAuthor['NickName'] : _t('_bx_events_admin'), 'author_url' => $aAuthor ? getProfileLink($aAuthor['ID']) : 'javascript:void(0)'); return $this->parseHtmlByName('block_info', $aVars); }
function getBlockCode_People() { global $logged; $aProfile = $logged['member'] ? getProfileInfo((int) $_COOKIE['memberID']) : array(); // default params for search form $aDefaultParams = array('LookingFor' => $aProfile['Sex'] ? $aProfile['Sex'] : 'male', 'Sex' => $aProfile['LookingFor'] ? $aProfile['LookingFor'] : 'female', 'Country' => $aProfile['Country'] ? $aProfile['Country'] : getParam('default_country'), 'DateOfBirth' => getParam('search_start_age') . '-' . getParam('search_end_age')); bx_import('BxDolProfileFields'); $oPF = new BxDolProfileFields(9); $a = array('default_params' => $aDefaultParams); return $oPF->getFormCode($a); }
/** * page code function */ function PageCompPageMainCode() { $memberID = getLoggedId(); $p_arr = getProfileInfo($memberID); //db_assoc_arr( "SELECT `Status` FROM `Profiles` WHERE `ID` = '$memberID'" ); if ($p_arr['Status'] != 'Unconfirmed') { return _t("_NO_NEED_TO_CONFIRM_EMAIL"); } else { return activation_mail($memberID); } }
function getBlockCode_People() { $iMemberId = getLoggedId(); $aProfile = $iMemberId ? getProfileInfo($iMemberId) : array(); // default params for search form $aDefaultParams = array('LookingFor' => $aProfile['Sex'] ? $aProfile['Sex'] : 'male', 'Sex' => $aProfile['LookingFor'] ? $aProfile['LookingFor'] : 'female', 'Country' => $aProfile['Country'] ? $aProfile['Country'] : getParam('default_country'), 'DateOfBirth' => getParam('search_start_age') . '-' . getParam('search_end_age')); bx_import('BxDolProfileFields'); $oPF = new BxDolProfileFields(9); $a = array('default_params' => $aDefaultParams); return array($oPF->getFormCode($a), array(), array(), false); }
function login4($sUser, $sPwdClear) { $iId = 0; $aProfileInfo = getProfileInfo(getID($sUser)); if ($aProfileInfo && ((32 == strlen($sPwdClear) || 40 == strlen($sPwdClear)) && BxDolXMLRPCUtil::checkLogin($sUser, $sPwdClear))) { $iId = $aProfileInfo['ID']; } elseif ($aProfileInfo && getParam('enable_dolphin_footer') != 'on' && check_password($aProfileInfo['ID'], $sPwdClear, BX_DOL_ROLE_MEMBER, false)) { $iId = $aProfileInfo['ID']; } return new xmlrpcresp(new xmlrpcval(array('member_id' => new xmlrpcval($iId, "int"), 'member_pwd_hash' => new xmlrpcval($iId ? $aProfileInfo['Password'] : ""), 'member_username' => new xmlrpcval($iId ? getUsername($iId) : ""), 'protocol_ver' => new xmlrpcval(BX_XMLRPC_PROTOCOL_VER, "int")), "struct")); }
function parseContent($sContent, $aKeys, $iMemberId = 0) { $aResultKeys = $this->getDefaultKeys(); if ($iMemberId != 0) { $aProfile = getProfileInfo($iMemberId); $aResultKeys = array_merge($aResultKeys, array('recipientID' => $aProfile['ID'], 'RealName' => getNickName($aProfile['ID']), 'NickName' => getNickName($aProfile['ID']), 'RecipientUrl' => getProfileLink($aProfile['ID']), 'Email' => $aProfile['Email'], 'Password' => $aProfile['Password'], 'SiteName' => getParam('site_title'))); } if (is_array($aKeys)) { $aResultKeys = array_merge($aResultKeys, $aKeys); } return $GLOBALS['oSysTemplate']->parseHtmlByContent($sContent, $aResultKeys, array('<', '>')); }
/** * Constructor */ public function __construct($iProfileID = 0) { $sKey = getParam('sys_akismet_api_key'); if ($sKey) { require_once BX_DIRECTORY_PATH_PLUGINS . 'akismet/Akismet.class.php'; $this->oAkismet = new Akismet(BX_DOL_URL_ROOT, $sKey); $aProfile = getProfileInfo($iProfileID); if ($aProfile) { $this->oAkismet->setCommentAuthor($aProfile['NickName']); $this->oAkismet->setCommentAuthorEmail($aProfile['Email']); $this->oAkismet->setCommentAuthorURL(getProfileLink($aProfile['ID'])); } } }
function getBlockCode_UpcomingPhoto() { $aEvent = $this->oDb->getUpcomingEvent(getParam('bx_events_main_upcoming_event_from_featured_only') ? true : false); if (!$aEvent) { return MsgBox(_t('_Empty')); } $aAuthor = getProfileInfo($aEvent['ResponsibleID']); $a = array('ID' => $aEvent['ResponsibleID'], 'Avatar' => $aEvent['PrimPhoto']); $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search'); bx_events_import('Voting'); $oRating = new BxEventsVoting('bx_events', (int) $aEvent['ID']); $aVars = array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : $this->oTemplate->getIconUrl('no-photo-110.png'), 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'event_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aEvent['EntryUri'], 'event_title' => $aEvent['Title'], 'event_start' => getLocaleDate($aEvent['EventStart']), 'event_start_in' => defineTimeInterval($aEvent['EventStart']), 'author_title' => _t('_From'), 'author_username' => $aAuthor['NickName'], 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aEvent['ID']) : '', 'participants' => $aEvent['FansCount'], 'country_city' => '<a href="' . $this->oConfig->getBaseUri() . 'browse/country/' . strtolower($aEvent['Country']) . '">' . _t($GLOBALS['aPreValues']['Country'][$aEvent['Country']]['LKey']) . '</a>' . (trim($aEvent['City']) ? ', ' . $aEvent['City'] : ''), 'place' => $aEvent['Place'], 'flag_image' => genFlag($aEvent['Country'])); return $this->oTemplate->parseHtmlByName('main_event', $aVars); }
public static function getMainMenuLink($sUrl) { if (substr($sUrl, 0, 11) == 'javascript:') { $sLink = 'javascript:void(0);'; $sOnClick = 'onclick="' . $sUrl . '"'; } else { $sLink = $sUrl; $sOnClick = ''; } $aAdminProfile = getProfileInfo(); $aVariables = array('adminLogin' => $aAdminProfile['NickName'], 'adminPass' => $aAdminProfile['Password']); $sLink = $GLOBALS['oAdmTemplate']->parseHtmlByContent($sLink, $aVariables, array('{', '}')); $sOnClick = $GLOBALS['oAdmTemplate']->parseHtmlByContent($sOnClick, $aVariables, array('{', '}')); return array($sLink, $sOnClick); }
function displaySearchUnit($aData, $aExtendedCss = array()) { $sCode = ''; $sOutputMode = isset($_GET['search_result_mode']) && $_GET['search_result_mode'] == 'ext' ? 'ext' : 'sim'; $sTemplateName = $sOutputMode == 'ext' ? 'search_profiles_ext.html' : 'search_profiles_sim.html'; if ($sTemplateName) { if ($aData['Couple'] > 0) { $aProfileInfoC = getProfileInfo($aData['Couple']); $sCode .= $this->PrintSearhResult($aData, $aProfileInfoC, $aExtendedCss, $sTemplateName); } else { $sCode .= $this->PrintSearhResult($aData, array(), $aExtendedCss, $sTemplateName); } } return $sCode; }
function getBlockCode_UpcomingPhoto() { $aEvent = $this->oDb->getUpcomingEvent(getParam('bx_events_main_upcoming_event_from_featured_only') ? true : false); if (!$aEvent) { return false; } $aAuthor = getProfileInfo($aEvent['ResponsibleID']); $a = array('ID' => $aEvent['ResponsibleID'], 'Avatar' => $aEvent['PrimPhoto']); $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search'); bx_events_import('Voting'); $oRating = new BxEventsVoting('bx_events', (int) $aEvent['ID']); $sEventUrl = BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aEvent['EntryUri']; $aVars = array('bx_if:image' => array('condition' => !$aImage['no_image'] && $aImage['file'], 'content' => array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : '', 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'event_url' => $sEventUrl)), 'event_url' => $sEventUrl, 'event_title' => $aEvent['Title'], 'event_start_in' => $this->oMain->_formatDateInBrowse($aEvent), 'author_title' => _t('_From'), 'author_username' => getNickName($aAuthor['ID']), 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aEvent['ID']) : '', 'participants' => $aEvent['FansCount'], 'country_city' => $this->oMain->_formatLocation($aEvent, true, true), 'place' => $aEvent['Place']); return $this->oTemplate->parseHtmlByName('main_event', $aVars); }
function getBlockCode_LatestFeaturedGroup() { $aDataEntry = $this->oDb->getLatestFeaturedItem(); if (!$aDataEntry) { return MsgBox(_t('_Empty')); } $aAuthor = getProfileInfo($aDataEntry['author_id']); $sImageUrl = ''; $sImageTitle = ''; $a = array('ID' => $aDataEntry['author_id'], 'Avatar' => $aDataEntry['thumb']); $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search'); bx_groups_import('Voting'); $oRating = new BxGroupsVoting('bx_groups', $aDataEntry['id']); $aVars = array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : $this->oTemplate->getIconUrl('no-photo-110.png'), 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'], 'group_title' => $aDataEntry['title'], 'author_title' => _t('_From'), 'author_username' => $aAuthor['NickName'], 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aDataEntry['id']) : ''); return $this->oTemplate->parseHtmlByName('latest_featured_group', $aVars); }
function getBlockCode_LatestFeaturedProduct() { $aDataEntry = $this->oDb->getLatestFeaturedItem(); if (!$aDataEntry) { return false; } $aAuthor = getProfileInfo($aDataEntry['author_id']); $sImageUrl = ''; $sImageTitle = ''; $a = array('ID' => $aDataEntry['author_id'], 'Avatar' => $aDataEntry['thumb']); $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search'); bx_store_import('Voting'); $oRating = new BxStoreVoting('bx_store', $aDataEntry['id']); $aVars = array('bx_if:image' => array('condition' => !$aImage['no_image'] && $aImage['file'], 'content' => array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : '', 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'product_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'])), 'product_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'], 'product_title' => $aDataEntry['title'], 'author_title' => _t('_From'), 'author_username' => getNickName($aAuthor['ID']), 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aDataEntry['id']) : '', 'created' => defineTimeInterval($aDataEntry['created']), 'price_range' => $this->oMain->_formatPriceRange($aDataEntry)); return $this->oTemplate->parseHtmlByName('latest_featured_product', $aVars); }
function getBlockCode_LatestFeaturedGroup() { $aDataEntry = $this->oDb->getLatestFeaturedItem(); if (!$aDataEntry) { return false; } $aAuthor = getProfileInfo($aDataEntry['author_id']); $sImageUrl = ''; $sImageTitle = ''; $a = array('ID' => $aDataEntry['author_id'], 'Avatar' => $aDataEntry['thumb']); $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search'); ml_clonetwo_import('Voting'); $oRating = new MlClonetwoVoting('ml_clonetwo', $aDataEntry['id']); $aVars = array('bx_if:image' => array('condition' => !$aImage['no_image'] && $aImage['file'], 'content' => array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : '', 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'])), 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'], 'group_title' => $aDataEntry['title'], 'author_title' => _t('_From'), 'author_username' => getNickName($aAuthor['ID']), 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aDataEntry['id']) : '', 'fans_count' => $aDataEntry['fans_count'], 'country_city' => $this->oMain->_formatLocation($aDataEntry, false, true)); return $this->oTemplate->parseHtmlByName('latest_featured_group', $aVars); }
/** * page code function */ function PageCompPageMainCode($iLoggedID) { $member['ID'] = (int) $iLoggedID; $p_arr = getProfileInfo($member['ID']); if ($_POST['CHANGE_STATUS']) { $sStatus = ""; switch ($_POST['CHANGE_STATUS']) { case 'SUSPEND': if ($p_arr['Status'] == 'Active') { $sStatus = "Suspended"; } break; case 'ACTIVATE': if ($p_arr['Status'] == 'Suspended') { $sStatus = "Active"; } break; } if (!empty($sStatus)) { bx_admin_profile_change_status($member['ID'], $sStatus); } $p_arr = getProfileInfo($member['ID']); } $aData = array('profile_status_caption' => _t("_Profile status"), 'status' => $p_arr['Status'], 'status_lang_key' => _t('__' . $p_arr['Status'])); $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'change_status.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('status' => array('type' => 'hidden', 'name' => 'CHANGE_STATUS', 'value' => ''), 'subscribe' => array('type' => 'submit', 'name' => 'subscribe', 'value' => ''))); switch ($p_arr['Status']) { case 'Active': $aForm['inputs']['status']['value'] = 'SUSPEND'; $aForm['inputs']['subscribe']['value'] = _t('_Suspend account'); $oForm = new BxTemplFormView($aForm); $aData['form'] = $oForm->getCode(); $aData['message'] = _t("_PROFILE_CAN_SUSPEND"); break; case 'Suspended': $aForm['inputs']['status']['value'] = 'ACTIVATE'; $aForm['inputs']['subscribe']['value'] = _t('_Activate account'); $oForm = new BxTemplFormView($aForm); $aData['form'] = $oForm->getCode(); $aData['message'] = _t("_PROFILE_CAN_ACTIVATE"); break; default: $aData['message'] = _t("_PROFILE_CANT_ACTIVATE/SUSPEND"); $aData['form'] = ''; break; } return $GLOBALS['oSysTemplate']->parseHtmlByName('change_status.html', $aData); }