function getProfileInfoExtra()
 {
     $oPrivacy = new BxDolPrivacy('sys_page_compose_privacy', 'id', 'user_id');
     $aRet = array();
     $r = db_res("SELECT `pc`.`Caption`, `pc`.`Content`, `pc`.`Func`, `pc`.`ID` AS `BlockID`\n            FROM `sys_profile_fields` AS `pf` \n            INNER JOIN `sys_page_compose` AS `pc` \n            ON ((`pc`.`Func` = 'PFBlock' AND `pc`.`Content` = `pf`.`ID`) OR (`pc`.`Func` = 'GeneralInfo' AND " . BX_BLOCK_GENERALINFO . " = `pf`.`ID`) OR (`pc`.`Func` = 'AdditionalInfo' AND " . BX_BLOCK_ADDITIONALINFO . " = `pf`.`ID`))\n            WHERE `pc`.`Page` = 'profile_info' AND `pf`.`Type` = 'block' AND `pc`.`Column` != 0 \n            ORDER BY `pc`.`Column`, `pc`.`Order`");
     while ($a = $r->fetch()) {
         $iPrivacyId = (int) $GLOBALS['MySQL']->getOne("SELECT `id` FROM `sys_page_compose_privacy` WHERE `user_id`='" . $this->_iProfileID . "' AND `block_id`='" . $a['BlockID'] . "' LIMIT 1");
         if ($iPrivacyId != 0 && !$oPrivacy->check('view_block', $iPrivacyId, $this->_iViewerId)) {
             continue;
         }
         switch ($a['Func']) {
             case 'GeneralInfo':
                 $i = BX_BLOCK_GENERALINFO;
                 break;
             case 'AdditionalInfo':
                 $i = BX_BLOCK_ADDITIONALINFO;
                 break;
             default:
                 $i = $a['Content'];
         }
         $aBlock = $this->getProfileInfoBlock($a['Caption'], $i);
         if (false === $aBlock) {
             continue;
         }
         $aRet[] = $aBlock;
     }
     if ($this->_iViewerId == $this->_iProfileID) {
         $aOwnInfo[] = new xmlrpcval(array('Caption' => new xmlrpcval(_t('_E-mail')), 'Type' => new xmlrpcval('text'), 'Value1' => new xmlrpcval($this->_aProfile['Email'])), "struct");
         $aOwnInfo[] = new xmlrpcval(array('Caption' => new xmlrpcval(_t('_Membership2')), 'Type' => new xmlrpcval('text'), 'Value1' => new xmlrpcval(strip_tags(GetMembershipStatus($this->_iProfileID, false, false)))), "struct");
         $aOwnInfo[] = new xmlrpcval(array('Caption' => new xmlrpcval(_t('_Status')), 'Type' => new xmlrpcval('text'), 'Value1' => new xmlrpcval(_t('__' . $this->_aProfile['Status']))), "struct");
         $aRet[] = new xmlrpcval(array('Info' => new xmlrpcval($aOwnInfo, "array"), 'Title' => new xmlrpcval(_t('_Account Info'))), "struct");
     }
     return new xmlrpcval($aRet, "array");
 }
Пример #2
0
 function getProfileInfoExtra()
 {
     $aRet = array();
     $r = db_res("SELECT `pc`.`Caption`, `pc`.`Content` FROM `sys_profile_fields` AS `pf` INNER JOIN `sys_page_compose` AS `pc` ON (`pc`.`Func` = 'PFBlock' AND `pc`.`Content` = `pf`.`ID`) WHERE `pc`.`Page` = 'profile' AND `pf`.`Type` = 'block' AND `pc`.`Column` != 0 ORDER BY `pc`.`Column`, `pc`.`Order`");
     while ($a = mysql_fetch_array($r)) {
         $aBlock = $this->getProfileInfoBlock($a['Caption'], $a['Content']);
         if (false === $aBlock) {
             continue;
         }
         $aRet[] = $aBlock;
     }
     if ($this->_iViewerId == $this->_iProfileID) {
         $aOwnInfo[] = new xmlrpcval(array('Caption' => new xmlrpcval(_t('_E-mail')), 'Type' => new xmlrpcval('text'), 'Value1' => new xmlrpcval($this->_aProfile['Email'])), "struct");
         $aOwnInfo[] = new xmlrpcval(array('Caption' => new xmlrpcval(_t('_Membership2')), 'Type' => new xmlrpcval('text'), 'Value1' => new xmlrpcval(strip_tags(GetMembershipStatus($this->_iProfileID, false, false)))), "struct");
         $aOwnInfo[] = new xmlrpcval(array('Caption' => new xmlrpcval(_t('_Status')), 'Type' => new xmlrpcval('text'), 'Value1' => new xmlrpcval(_t('__' . $this->_aProfile['Status']))), "struct");
         $aRet[] = new xmlrpcval(array('Info' => new xmlrpcval($aOwnInfo, "array"), 'Title' => new xmlrpcval(_t('_Account Info'))), "struct");
     }
     return new xmlrpcval($aRet, "array");
 }
Пример #3
0
 function getBlockCode_AccountControl()
 {
     global $oTemplConfig, $aPreValues;
     //Labels
     $sProfileStatusC = _t('_Profile status');
     $sPresenceC = _t('_Presence');
     $sMembershipC = _t('_Membership2');
     $sLastLoginC = _t('_Last login');
     $sRegistrationC = _t('_Registration');
     $sEmailC = _t('_Email');
     $sMembersC = ' ' . _t('_Members');
     $sProfileC = _t('_Profile');
     $sContentC = _t('_Content');
     //--- General Info block ---//
     $sProfileStatus = _t("__{$this->aMemberInfo['Status']}");
     $sProfileStatusMess = '';
     switch ($this->aMemberInfo['Status']) {
         case 'Unconfirmed':
             $sProfileStatusMess = _t("_ATT_UNCONFIRMED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
             break;
         case 'Approval':
             $sProfileStatusMess = _t("_ATT_APPROVAL", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
             break;
         case 'Active':
             $sProfileStatusMess = _t("_ATT_ACTIVE", $this->aMemberInfo['ID'], $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
             break;
         case 'Rejected':
             $sProfileStatusMess = _t("_ATT_REJECTED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
             break;
         case 'Suspended':
             $sProfileStatusMess = _t("_ATT_SUSPENDED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
             break;
     }
     $oForm = bx_instance('BxDolFormCheckerHelper');
     $sMembStatus = GetMembershipStatus($this->aMemberInfo['ID']);
     $sLastLogin = '******';
     if (!empty($this->aMemberInfo['DateLastLogin']) && $this->aMemberInfo['DateLastLogin'] != "0000-00-00 00:00:00") {
         $sLastLoginTS = $oForm->_passDateTime($this->aMemberInfo['DateLastLogin']);
         $sLastLogin = getLocaleDate($sLastLoginTS, BX_DOL_LOCALE_DATE);
     }
     $sRegistration = 'never';
     if (!empty($this->aMemberInfo['DateReg']) && $this->aMemberInfo['DateReg'] != "0000-00-00 00:00:00") {
         $sRegistrationTS = $oForm->_passDateTime($this->aMemberInfo['DateReg']);
         $sRegistration = getLocaleDate($sRegistrationTS, BX_DOL_LOCALE_DATE);
     }
     //--- Presence block ---//
     require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolUserStatusView.php';
     $oStatusView = new BxDolUserStatusView();
     $sUserStatus = $oStatusView->getMemberMenuStatuses();
     //--- Content block ---//
     $aAccountCustomStatElements = $GLOBALS['MySQL']->fromCache('sys_account_custom_stat_elements', 'getAllWithKey', 'SELECT * FROM `sys_account_custom_stat_elements`', 'ID');
     $aPQStatisticsElements = $GLOBALS['MySQL']->fromCache('sys_stat_member', 'getAllWithKey', 'SELECT * FROM `sys_stat_member`', 'Type');
     $aCustomElements = array();
     foreach ($aAccountCustomStatElements as $iID => $aMemberStats) {
         $sUnparsedLabel = $aMemberStats['Label'];
         $sUnparsedValue = $aMemberStats['Value'];
         $sLabel = _t($sUnparsedLabel);
         $sUnparsedValue = str_replace('__site_url__', BX_DOL_URL_ROOT, $sUnparsedValue);
         //step 1 - replacements of keys
         $sLblTmpl = '__l_';
         $sTmpl = '__';
         while (($iStartPos = strpos($sUnparsedValue, $sLblTmpl)) !== false) {
             $iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
             if ($iEndPos <= $iStartPos) {
                 break;
             }
             $sSubstr = substr($sUnparsedValue, $iStartPos + strlen($sLblTmpl), $iEndPos - $iStartPos - strlen($sLblTmpl));
             $sKeyValue = mb_strtolower(_t('_' . $sSubstr));
             $sUnparsedValue = str_replace($sLblTmpl . $sSubstr . $sTmpl, $sKeyValue, $sUnparsedValue);
         }
         //step 2 - replacements of Stat keys
         while (($iStartPos = strpos($sUnparsedValue, $sTmpl, 0)) !== false) {
             $iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
             if ($iEndPos <= $iStartPos) {
                 break;
             }
             $iCustomCnt = 0;
             $sSubstr = process_db_input(substr($sUnparsedValue, $iStartPos + strlen($sTmpl), $iEndPos - $iStartPos - strlen($sTmpl)), BX_TAGS_STRIP);
             if ($sSubstr) {
                 $sCustomSQL = $aPQStatisticsElements[$sSubstr]['SQL'];
                 $sCustomSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sCustomSQL);
                 $sCustomSQL = str_replace('__profile_media_define_photo__', _t('_ProfilePhotos'), $sCustomSQL);
                 $sCustomSQL = str_replace('__profile_media_define_music__', _t('_ProfileMusic'), $sCustomSQL);
                 $sCustomSQL = str_replace('__profile_media_define_video__', _t('_ProfileVideos'), $sCustomSQL);
                 $sCustomSQL = str_replace('__member_nick__', process_db_input($this->aMemberInfo['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), $sCustomSQL);
                 $iCustomCnt = $sCustomSQL != '' ? (int) db_value($sCustomSQL) : '';
             }
             $sUnparsedValue = str_replace($sTmpl . $sSubstr . $sTmpl, $iCustomCnt, $sUnparsedValue);
         }
         $sTrimmedLabel = trim($sUnparsedLabel, '_');
         $aCustomElements[$sTrimmedLabel] = array('type' => 'custom', 'name' => $sTrimmedLabel, 'content' => '<b>' . $sLabel . ':</b> ' . $sUnparsedValue, 'colspan' => true);
     }
     $aForm = array('form_attrs' => array('action' => '', 'method' => 'post'), 'params' => array('remove_form' => true), 'inputs' => array('header1' => array('type' => 'block_header', 'caption' => $sProfileC, 'collapsable' => true), 'Info' => array('type' => 'custom', 'name' => 'Info', 'content' => get_member_thumbnail($this->aMemberInfo['ID'], 'none', true), 'colspan' => true), 'Status' => array('type' => 'custom', 'name' => 'Status', 'content' => '<b>' . $sProfileStatusC . ':</b> ' . $sProfileStatus . '<br />' . $sProfileStatusMess, 'colspan' => true), 'Email' => array('type' => 'custom', 'name' => 'Email', 'content' => '<b>' . $sEmailC . ':</b> ' . $this->aMemberInfo['Email'] . '<br />' . _t('_sys_txt_ac_manage_subscriptions'), 'colspan' => true), 'Membership' => array('type' => 'custom', 'name' => 'Membership', 'content' => '<b>' . $sMembershipC . ':</b> ' . $sMembStatus, 'colspan' => true), 'LastLogin' => array('type' => 'custom', 'name' => 'LastLogin', 'content' => '<b>' . $sLastLoginC . ':</b> ' . $sLastLogin, 'colspan' => true), 'Registration' => array('type' => 'custom', 'name' => 'Registration', 'content' => '<b>' . $sRegistrationC . ':</b> ' . $sRegistration, 'colspan' => true), 'header1_end' => array('type' => 'block_end'), 'header2' => array('type' => 'block_header', 'caption' => $sPresenceC, 'collapsable' => true, 'collapsed' => true, 'attrs' => array('id' => 'user_status_ac')), 'UserStatus' => array('type' => 'custom', 'name' => 'Info', 'content' => $sUserStatus, 'colspan' => true), 'header2_end' => array('type' => 'block_end')));
     //custom
     if (!empty($aCustomElements)) {
         $aForm['inputs'] = array_merge($aForm['inputs'], array('header5' => array('type' => 'block_header', 'caption' => $sContentC, 'collapsable' => true, 'collapsed' => true)), $aCustomElements, array('header5_end' => array('type' => 'block_end')));
     }
     $oForm = new BxTemplFormView($aForm);
     $sContent = $GLOBALS['oSysTemplate']->parseHtmlByName('member_account_control.html', array('content' => $oForm->getCode()));
     return array($sContent, array(), array(), false);
 }
/**
 * membership status
 */
function PageCompStatus($memberID)
{
    global $site;
    global $en_credits;
    global $oTemplConfig;
    $ret = '';
    if (isset($_REQUEST['result'])) {
        $resultMessage = '';
        switch ($_REQUEST['result']) {
            case '1000':
                $resultMessage = _t('_RESULT1000');
                break;
            case '0':
                $resultMessage = _t('_RESULT0');
                break;
            case '-1':
                $resultMessage = _t('_RESULT-1');
                break;
            case '1':
                $resultMessage = _t('_RESULT1_THANK', $site['title']);
                break;
        }
        if (strlen($resultMessage)) {
            $ret .= "<div class=\"result_message\">{$resultMessage}</div>\n";
        }
    }
    $ret .= GetMembershipStatus($memberID, false, $en_credits);
    $ret = "<div class=\"status_box\">\n{$ret}\n</div>\n";
    return DesignBoxContent(_t("_Membership Status"), $ret, $oTemplConfig->PageCompStatus_db_num);
}
Пример #5
0
    function getBlockCode_AccountControl()
    {
        global $oTemplConfig, $site, $aPreValues;
        //--- Load cache of sys_account_custom_stat_elements ---//
        $aAccountCustomStatElements = $GLOBALS['MySQL']->fromCache('sys_account_custom_stat_elements', 'getAllWithKey', 'SELECT * FROM `sys_account_custom_stat_elements`', 'ID');
        //--- Load cache of sys_stat_member ---//
        $aPQStatisticsElements = $GLOBALS['MySQL']->fromCache('sys_stat_member', 'getAllWithKey', 'SELECT * FROM `sys_stat_member`', 'Type');
        //--- end of loading caches ---//
        //Labels
        $sUsernameC = _t('_NickName');
        $sProfileStatusC = _t('_Profile status');
        $sPresenceC = _t('_Presence');
        $sMembershipC = _t('_Membership2');
        $sLastLoginC = _t('_Last login');
        $sRegistrationC = _t('_Registration');
        $sEmailC = _t('_Email');
        $sGreetedC = _t('_greeted');
        $sGreetedMeC = _t('_Greeted me');
        $sBlockedC = _t('_blocked');
        $sViewedMeC = _t('_Viewed me');
        $sMembersC = ' ' . _t('_Members');
        $sEditProfileInfoC = _t('_Edit profile info');
        $sProfileC = _t('_Profile');
        $sAccountInfoC = _t('_Account Info');
        $sActivityC = _t('_Tracker');
        $sCustomC = _t('_Custom');
        $sMaleIcon = getTemplateIcon('male.png');
        $sFemaleIcon = getTemplateIcon('female.png');
        // Values
        $sUsername = $this->aMemberInfo['NickName'];
        $sUserLink = getProfileLink($this->aMemberInfo['ID']);
        $sOwnerThumb = get_member_thumbnail($this->aMemberInfo['ID'], 'none', true);
        $iYears = age($this->aMemberInfo['DateOfBirth']);
        $sYearsOld = _t('_y/o', $iYears);
        $sProfileIcon = $this->aMemberInfo['Sex'] == 'male' ? $sMaleIcon : $sFemaleIcon;
        $sCustomElements = '';
        $sCountryName = empty($this->aMemberInfo['Country']) ? '' : _t($aPreValues['Country'][$this->aMemberInfo['Country']]['LKey']);
        $sCityName = $this->aMemberInfo['City'];
        $sCountryPic = $this->aMemberInfo['Country'] == '' ? '' : ' <img alt="' . $this->aMemberInfo['Country'] . '" src="' . ($site['flags'] . strtolower($this->aMemberInfo['Country'])) . '.gif"/>';
        $sProfileStatus = _t("__{$this->aMemberInfo['Status']}");
        $sProfileStatusMess = '';
        switch ($this->aMemberInfo['Status']) {
            case 'Unconfirmed':
                $sProfileStatusMess = _t("_ATT_UNCONFIRMED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Approval':
                $sProfileStatusMess = _t("_ATT_APPROVAL", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Active':
                $sProfileStatusMess = _t("_ATT_ACTIVE", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Rejected':
                $sProfileStatusMess = _t("_ATT_REJECTED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Suspended':
                $sProfileStatusMess = _t("_ATT_SUSPENDED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
        }
        $sMembership = '';
        $sMembStatus = GetMembershipStatus($this->aMemberInfo['ID']);
        $sMembership = <<<EOF
\t<tr class="account_control_tr">
\t\t<td valign=top class="account_control_left">{$sMembershipC}:</td>
\t\t<td valign=top class="account_control_right">
\t\t\t{$sMembStatus}
\t\t</td>
\t</tr>
EOF;
        $oForm = bx_instance('BxDolFormCheckerHelper');
        if (!$this->aMemberInfo['DateLastLogin'] || $this->aMemberInfo['DateLastLogin'] == "0000-00-00 00:00:00") {
            $sLastLogin = '******';
        } else {
            $sLastLoginTS = $oForm->_passDateTime($this->aMemberInfo['DateLastLogin']);
            $sLastLogin = getLocaleDate($sLastLoginTS, BX_DOL_LOCALE_DATE);
        }
        if (!$this->aMemberInfo['DateReg'] || $this->aMemberInfo['DateReg'] == "0000-00-00 00:00:00") {
            $sRegistration = 'never';
        } else {
            $sRegistrationTS = $oForm->_passDateTime($this->aMemberInfo['DateReg']);
            $sRegistration = getLocaleDate($sRegistrationTS, BX_DOL_LOCALE_DATE);
        }
        $sEmail = $this->aMemberInfo['Email'];
        $this->aMemberInfo = getProfileInfo($this->aMemberInfo['ID']);
        //my greeted contacts
        $sMGCSQL = $aPQStatisticsElements['mgc']['SQL'];
        $sMGCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMGCSQL);
        $iGreetedContactsCnt = (int) db_value($sMGCSQL);
        //my greeted me contacts
        $sMGMCSQL = $aPQStatisticsElements['mgmc']['SQL'];
        $sMGMCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMGMCSQL);
        $iGreetedMeContactsCnt = (int) db_value($sMGMCSQL);
        //my blocked contacts
        $sMBCSQL = $aPQStatisticsElements['mbc']['SQL'];
        $sMBCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMBCSQL);
        $iBlockedContactsCnt = (int) db_value($sMBCSQL);
        $iViewedMeContactsCnt = (int) $this->aMemberInfo['Views'];
        $bModuleExists = false;
        $aCustomElements = array();
        $aCustomElements['header5'] = array('type' => 'block_header', 'caption' => $sCustomC, 'collapsable' => true);
        foreach ($aAccountCustomStatElements as $iID => $aMemberStats) {
            $sUnparsedLabel = $aMemberStats['Label'];
            $sUnparsedValue = $aMemberStats['Value'];
            $sLabel = _t($sUnparsedLabel);
            $sUnparsedValue = str_replace('__site_url__', $site['url'], $sUnparsedValue);
            //step 1 - replacements of keys
            $sLblTmpl = '__l_';
            $sTmpl = '__';
            while ($iStartPos = strpos($sUnparsedValue, $sLblTmpl)) {
                $iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
                if ($iEndPos > $iStartPos) {
                    $sSubstr = substr($sUnparsedValue, $iStartPos + strlen($sLblTmpl), $iEndPos - $iStartPos - strlen($sLblTmpl));
                    $sKeyValue = strtolower(_t('_' . $sSubstr));
                    $sUnparsedValue = str_replace($sLblTmpl . $sSubstr . $sTmpl, $sKeyValue, $sUnparsedValue);
                } else {
                    break;
                }
            }
            //step 2 - replacements of Stat keys
            while (($iStartPos = strpos($sUnparsedValue, $sTmpl, 0)) >= 0) {
                $iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
                if ($iEndPos > $iStartPos) {
                    $iCustomCnt = 0;
                    $sSubstr = process_db_input(substr($sUnparsedValue, $iStartPos + strlen($sTmpl), $iEndPos - $iStartPos - strlen($sTmpl)), BX_TAGS_STRIP);
                    if ($sSubstr) {
                        $sCustomSQL = $aPQStatisticsElements[$sSubstr]['SQL'];
                        $sCustomSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sCustomSQL);
                        $sCustomSQL = str_replace('__profile_media_define_photo__', _t('_ProfilePhotos'), $sCustomSQL);
                        $sCustomSQL = str_replace('__profile_media_define_music__', _t('_ProfileMusic'), $sCustomSQL);
                        $sCustomSQL = str_replace('__profile_media_define_video__', _t('_ProfileVideos'), $sCustomSQL);
                        $sCustomSQL = str_replace('__member_nick__', process_db_input($this->aMemberInfo['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), $sCustomSQL);
                        $iCustomCnt = $sCustomSQL != '' ? (int) db_value($sCustomSQL) : '';
                    }
                    $sUnparsedValue = str_replace($sTmpl . $sSubstr . $sTmpl, $iCustomCnt, $sUnparsedValue);
                } else {
                    break;
                }
            }
            $sCustomElements .= <<<EOF
\t<tr class="account_control_tr">
\t    <td class="account_control_left">{$sLabel}: </td>
\t    <td class="account_control_right">
\t\t\t{$sUnparsedValue}
\t\t</td>
\t</tr>
EOF;
            $sTrimmedLabel = trim($sUnparsedLabel, '_');
            $aCustomElements[$sTrimmedLabel] = array('type' => 'custom', 'name' => $sTrimmedLabel, 'content' => '<b>' . $sLabel . ':</b> ' . $sUnparsedValue, 'colspan' => true);
            if (!$bModuleExists) {
                $bModuleExists = true;
            }
        }
        $aCustomElements['header5_end'] = array('type' => 'block_end');
        $sProfileInfoCont = <<<EOF
<div class="infoMain">
\t<div class="memberPic" style="margin-left:0px;padding:0px;text-align:center;width:70px;">
\t\t{$sOwnerThumb}
\t</div>
\t<div class="infoText">
\t\t<div class="infoUnit">
\t\t\t<img src="{$sProfileIcon}" />
\t\t\t{$sYearsOld}
\t\t</div>
\t\t<div class="infoUnit">
\t\t\t{$sCountryPic} {$sCountryName}, {$sCityName}
\t\t</div>
\t\t<div class="infoUnit">
\t\t\t<a href="{$site['url']}pedit.php?ID={$this->aMemberInfo['ID']}">{$sEditProfileInfoC}</a>
\t\t</div>
\t</div>
</div>
<div class="clear_both"></div>
EOF;
        require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolUserStatusView.php';
        $oStatusView = new BxDolUserStatusView();
        $sUserStatus = '';
        if ($oStatusView->aStatuses) {
            foreach ($oStatusView->aStatuses as $sKey => $aItems) {
                $sTitle = _t($aItems['title']);
                $sOnclick = strtolower($this->aMemberInfo['UserStatus']) == strtolower($sKey) ? "" : "onclick=\"if (typeof oBxUserStatus != 'undefined' ) { oBxUserStatus.setUserStatus('{$sKey}', \$(this).parents('ul:first')); \$('#user_status_ac .block_collapse_btn').attr('src', aDolImages['collapse_closed']); \$('#user_status_ac').parent().toggleClass('collapsed').next('tbody').fadeOut(400); location.reload(); }return false\"";
                $aTemplateKeys = array('bx_if:item_img' => array('condition' => true, 'content' => array('item_img_src' => $GLOBALS['oFunctions']->getTemplateIcon($aItems['icon']), 'item_img_alt' => $sTitle, 'item_img_width' => 16, 'item_img_height' => 16)), 'item_link' => 'javascript:void(0)', 'item_onclick' => $sOnclick, 'item_title' => $sTitle, 'extra_info' => null);
                $sUserStatus .= $GLOBALS['oSysTemplate']->parseHtmlByName('account_control_member_status.html', $aTemplateKeys);
            }
        }
        $aForm = array('form_attrs' => array('action' => '', 'method' => 'post'), 'params' => array('remove_form' => true), 'inputs' => array('header1' => array('type' => 'block_header', 'caption' => $sProfileC, 'collapsable' => true), 'Info' => array('type' => 'custom', 'name' => 'Info', 'content' => $sProfileInfoCont, 'colspan' => true), 'header1_end' => array('type' => 'block_end'), 'header2' => array('type' => 'block_header', 'caption' => $sPresenceC, 'collapsable' => true, 'collapsed' => true, 'attrs' => array('id' => 'user_status_ac')), 'UserStatus' => array('type' => 'custom', 'name' => 'Info', 'content' => $sUserStatus, 'colspan' => true), 'header2_end' => array('type' => 'block_end'), 'header3' => array('type' => 'block_header', 'caption' => $sAccountInfoC, 'collapsable' => true), 'Username' => array('type' => 'custom', 'name' => 'Username', 'content' => '<b>' . $sUsernameC . ':</b> <a href="' . $sUserLink . '" >' . $sUsername . '</a>', 'colspan' => true), 'Email' => array('type' => 'custom', 'name' => 'Email', 'content' => '<b>' . $sEmailC . ':</b> ' . $sEmail, 'colspan' => true), 'Status' => array('type' => 'custom', 'name' => 'Status', 'content' => '<b>' . $sProfileStatusC . ':</b> ' . $sProfileStatus . ' ' . $sProfileStatusMess, 'colspan' => true), 'Membership' => array('type' => 'custom', 'name' => 'Membership', 'content' => '<b>' . $sMembershipC . ':</b> ' . $sMembStatus, 'colspan' => true), 'LastLogin' => array('type' => 'custom', 'name' => 'LastLogin', 'content' => '<b>' . $sLastLoginC . ':</b> ' . $sLastLogin, 'colspan' => true), 'Registration' => array('type' => 'custom', 'name' => 'Registration', 'content' => '<b>' . $sRegistrationC . ':</b> ' . $sRegistration, 'colspan' => true), 'header3_end' => array('type' => 'block_end'), 'header4' => array('type' => 'block_header', 'caption' => $sActivityC, 'collapsable' => true), 'ViewedMe' => array('type' => 'custom', 'name' => 'ViewedMe', 'content' => '<b>' . $sViewedMeC . ':</b> ' . _t('_N times', $iViewedMeContactsCnt), 'colspan' => true), 'Blocked' => array('type' => 'custom', 'name' => 'Blocked', 'content' => '<b>' . $sBlockedC . ':</b> ' . $iBlockedContactsCnt . $sMembersC, 'colspan' => true), 'Greeted' => array('type' => 'custom', 'name' => 'Greeted', 'content' => '<b>' . $sGreetedC . ':</b> ' . _t('_N times', $iGreetedContactsCnt), 'colspan' => true), 'GreetedMe' => array('type' => 'custom', 'name' => 'GreetedMe', 'content' => '<b>' . $sGreetedMeC . ':</b> ' . $iGreetedMeContactsCnt . $sMembersC, 'colspan' => true), 'header4_end' => array('type' => 'block_end')));
        //custom
        if ($bModuleExists) {
            $aForm['inputs'] = array_merge($aForm['inputs'], $aCustomElements);
        }
        $oForm = new BxTemplFormView($aForm);
        return '<div class="dbContent">' . $oForm->getCode() . '</div>';
    }
Пример #6
0
/**
 * contr panel "member info"
 */
function contr_panel_member_info_g4()
{
    global $site;
    global $p_arr;
    global $en_sdating;
    $free_mode = getParam("free_mode") == "on" ? 1 : 0;
    // new messages attention
    $new_mess_arr = db_arr("SELECT ID FROM `Messages` WHERE Recipient = {$p_arr['ID']} AND New = '1' ORDER BY Date DESC LIMIT 1");
    if ($new_mess_arr) {
        $mess = $new_mess_arr[ID];
    }
    // new kisses attention
    $new_kiss_arr = db_arr("SELECT ID FROM `VKisses` WHERE Member = {$p_arr['ID']} AND New = '1' LIMIT 1");
    if ($new_kiss_arr) {
        $vkiss = 1;
    }
    // new friends attention
    $new_friend_arr = db_arr("SELECT `ID` FROM `FriendList` WHERE `Profile` = {$p_arr['ID']} AND  `Check` = '0' LIMIT 1");
    if ($new_friend_arr) {
        $frd = 1;
    }
    ob_start();
    ?>
    <table width="100%" cellspacing="0" cellpadding="3" border="0" class="cp_table">

<!-- Profile status -->
    <tr>
	<td valign="middle" class="cp_td" align="left"><img src="<?php 
    echo $site['images'];
    ?>
cp_status.gif"></td>
    <td valign="middle" class="cp_td" align="left"><?php 
    echo _t("_Profile status");
    ?>
: </td>
    <td valign="middle" class="cp_td_r" align="left">
    	<b><font class=prof_stat_<?php 
    echo $p_arr['Status'];
    ?>
>&nbsp;<?php 
    echo _t("__{$p_arr['Status']}");
    ?>
&nbsp;</font></b>
<?php 
    switch ($p_arr['Status']) {
        case 'Unconfirmed':
            echo _t("_ATT_UNCONFIRMED");
            break;
        case 'Approval':
            echo _t("_ATT_APPROVAL");
            break;
        case 'Active':
            echo _t("_ATT_ACTIVE");
            break;
        case 'Rejected':
            echo _t("_ATT_REJECTED");
            break;
        case 'Suspended':
            echo _t("_ATT_SUSPENDED");
            break;
    }
    ?>
    </td>
    </tr>
<!-- Membership -->

<?php 
    if (!$free_mode) {
        ?>
<tr>
	<td valign="top" class="cp_td" width="22" align="left"><img src="<?php 
        echo $site['images'];
        ?>
cp_membership.gif"></td>
	<td valign="top" class="cp_td" align="left" style="padding-top:7px;"><?php 
        echo _t("_Membership2");
        ?>
:</td>
    <td valign="top" class="cp_td_r" align="left">
<?php 
        echo GetMembershipStatus($p_arr['ID']);
        ?>
	</td>
</tr>
<?php 
    }
    ?>
<!-- Last login -->
    <tr>
	<td valign="middle" class="cp_td" align="left"><img src="<?php 
    echo $site['images'];
    ?>
cp_llogin.gif"></td>
    <td valign="middle" class="cp_td" align="left"><?php 
    echo _t("_Last login");
    ?>
: </td>
    <td valign="middle" class="cp_td_r" align="left">
<?php 
    if (!$p_arr['LastLoggedIn'] || $p_arr['LastLoggedIn'] == "0000-00-00 00:00:00") {
        $p_arr['LastLoggedIn'] = _t("_never");
    }
    echo $p_arr['LastLoggedIn'];
    ?>
    </td>
    </tr>

<!-- SpeedDating info -->

<?php 
    if ($en_sdating) {
        ?>
	<tr class="table">
		<td valign="middle" class="cp_td" align="left"><img src="<?php 
        echo $site['images'];
        ?>
cp_lchanges.gif"></td>
		<td valign="middle" class="cp_td" align="left"><?php 
        echo _t('_SpeedDating tickets');
        ?>
: </td>
		<td valign="middle" class="cp_td_r" align="left">
<?php 
        $membership_arr = getMemberMembershipInfo($p_arr['ID']);
        $events_query = "SELECT `SDatingEvents`.`ID`, `Title`, (NOW() > `EventEnd` AND NOW() < DATE_ADD(`EventEnd`, INTERVAL `ChoosePeriod` DAY)) AS `ChooseActive`\r\n\t\t\t\t\tFROM `SDatingEvents`\r\n\t\t\t\t\tLEFT JOIN `SDatingParticipants` ON `SDatingParticipants`.`IDEvent` = `SDatingEvents`.`ID` AND `SDatingParticipants`.`IDMember` = {$p_arr['ID']}\r\n\t\t\t\t\tWHERE `SDatingEvents`.`Status` = 'Active'\r\n\t\t\t\t\tAND `SDatingParticipants`.`ID` IS NOT NULL\r\n\t\t\t\t\tAND NOW() < DATE_ADD(`SDatingEvents`.`EventEnd`, INTERVAL `SDatingEvents`.`ChoosePeriod` DAY)\r\n\t\t\t\t\tAND FIND_IN_SET('{$p_arr['Sex']}', `SDatingEvents`.`EventSexFilter`)\r\n\t\t\t\t\tAND ( TO_DAYS('{$p_arr['DateOfBirth']}')\r\n\t\t\t\t\t\tBETWEEN TO_DAYS(DATE_SUB(NOW(), INTERVAL `SDatingEvents`.`EventAgeUpperFilter` YEAR))\r\n\t\t\t\t\t\tAND TO_DAYS(DATE_SUB(NOW(), INTERVAL `SDatingEvents`.`EventAgeLowerFilter` YEAR)) )\r\n\t\t\t\t\tAND ( INSTR(`SDatingEvents`.`EventMembershipFilter`, '\\'all\\'') OR INSTR(`SDatingEvents`.`EventMembershipFilter`, '\\'{$membership_arr['ID']}\\'') )\r\n\t\t\t\t\tORDER BY `SDatingEvents`.`EventStart` DESC";
        $events_res = db_res($events_query);
        if (mysql_num_rows($events_res) == 0) {
            echo _t('_none');
        } else {
            $events_links = '';
            while ($event_arr = mysql_fetch_assoc($events_res)) {
                $events_links .= strlen($events_links) ? ', ' : '';
                $events_links .= "<a href=\"{$site['url']}events.php?action=show_info&amp;event_id={$event_arr['ID']}\">" . process_line_output($event_arr['Title']) . "</a>";
            }
            echo $events_links;
        }
        ?>
		</td>
	</tr>
<?php 
    }
    ?>
    <tr>
	<td valign="middle" class="cp_td" align="left"><img src="<?php 
    echo $site['images'];
    ?>
cp_messages.gif"></td>
    <td valign="middle" class="cp_td" align="left"><?php 
    echo _t("_Messages");
    ?>
:</td>
    <td valign="middle" class="cp_td_r" align="left"><?php 
    if ($mess) {
        echo _t("_ATT_MESSAGE", $mess, $site['url']);
    } else {
        echo _t("_ATT_MESSAGE_NONE", $site['url']);
    }
    ?>
    </td>
    </tr>
    <tr>
	<td valign="middle" class="cp_td" align="left"><img src="<?php 
    echo $site['images'];
    ?>
cp_kisses.gif"></td>
    <td valign="middle" class="cp_td" align="left"><?php 
    echo _t("_Kisses");
    ?>
:</td>
    <td valign="middle" class="cp_td_r" align="left"><?php 
    if ($vkiss) {
        echo _t("_ATT_VKISS", $site['url']);
    } else {
        echo _t("_ATT_VKISS_NONE", $site['url']);
    }
    ?>
    </td>
    </tr>
    <tr>
	<td valign="middle" class="cp_td" align="left"><img src="<?php 
    echo $site['images'];
    ?>
cp_friends.gif"></td>
    <td valign="middle" class="cp_td" align="left"><?php 
    echo _t("_Friends");
    ?>
:</td>
    <td valign="middle" class="cp_td_r" align="left"><?php 
    if ($frd) {
        echo _t("_ATT_FRIEND", $site['url']);
    } else {
        echo _t("_ATT_FRIEND_NONE", $site['url']);
    }
    ?>
    </td>
    </tr>
	</table>

<?php 
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
}
Пример #7
0
    function getBlockCode_MemberInfo()
    {
        global $oTemplConfig;
        $free_mode = getParam("free_mode") == "on" ? 1 : 0;
        $en_aff = getParam("enable_aff") == 'on' ? 1 : 0;
        ob_start();
        ?>
	    <table class="control_panel_table" width="100%" cellspacing="0" cellpadding="1">
	
		<tr class=table>
	
	<!-- Profile Status -->
	
	    <td valign="top" align="left" class="control_panel_td_1_first"><?php 
        echo _t("_Profile status");
        ?>
: </td>
	    <td valign="top" align="left" class="control_panel_td_2_first">
			<b><font class="prof_stat_<?php 
        echo $this->aMemberInfo['Status'];
        ?>
">&nbsp;<?php 
        echo _t("__{$this->aMemberInfo['Status']}");
        ?>
&nbsp;</font></b>
	<?php 
        switch ($this->aMemberInfo['Status']) {
            case 'Unconfirmed':
                echo _t("_ATT_UNCONFIRMED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Approval':
                echo _t("_ATT_APPROVAL", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Active':
                echo _t("_ATT_ACTIVE", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Rejected':
                echo _t("_ATT_REJECTED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
            case 'Suspended':
                echo _t("_ATT_SUSPENDED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
                break;
        }
        ?>
		</td>
		</tr>
	
	<!-- Membership -->
	
	<?php 
        if (!$free_mode) {
            ?>
	
	<tr class=table>
		<td valign=top align="left" class=control_panel_td_1><?php 
            echo _t("_Membership2");
            ?>
:</td>
		<td valign=top align="left" class=control_panel_td_2>
	<?php 
            echo GetMembershipStatus($this->aMemberInfo['ID']);
            ?>
		</td>
	</tr>
	
	<?php 
        }
        ?>
	
	<!-- Last login -->
	
		<tr class=table>
			<td valign=top align="left" class=control_panel_td_1><?php 
        echo _t("_Last login");
        ?>
: </td>
			<td valign=top align="left" class=control_panel_td_2>
	<?php 
        if (!$this->aMemberInfo['DateLastLogin'] || $this->aMemberInfo['DateLastLogin'] == "0000-00-00 00:00:00") {
            $this->aMemberInfo['DateLastLogin'] = '******';
        }
        echo $this->aMemberInfo['DateLastLogin'];
        ?>
			</td>
		</tr>
	
	<!--  Affiliate Program starts here -->
	<?php 
        if (0 == $free_mode && 1 == $en_aff) {
            echo "<tr class=table>\r\n\t\t\t\t<td valign=top align=\"left\" class=control_panel_td_1>" . _t("_Affiliate Program") . ": </td>\r\n\t\t\t\t<td valign=top align=\"left\" class=control_panel_td_2>";
            $ar = db_arr("SELECT aff_num FROM Profiles WHERE ID='{$this->aMemberInfo['ID']}' LIMIT 1");
            $res = db_res("SELECT * FROM members_as_aff WHERE num_of_mem <= '{$ar['0']}'");
            $txt = _t("_Got_members_part_1") . $ar[0] . _t("_Got_members_part_2");
            if (mysql_num_rows($res) > 0) {
                $txt = _t("_Congratulation") . $txt;
                $txt .= _t('_Click here to change your membership status');
            } else {
                $txt .= _t("_Need_more_members");
            }
            echo $txt;
            echo "</td>\r\n\t\t\t\t</tr>";
        }
        //<!--  Affiliate Program ends here -->
        echo "</table>";
        $ret = ob_get_contents();
        ob_end_clean();
        return $ret;
    }