/** * Function will generate received rows ; * * @return : Html presentation data ; */ function getProcessingRows($bShowEmpty = true) { global $oSysTemplate, $site, $oFunctions; // ** init some needed variables ; $sPageContent = $sActionsList = $sSettings = ''; $bShowSettings = false; $aRows = array(); $sEmptyMessage = '_Empty'; $sRowsTemplName = $this->aUsedTemplates['communicator_page']; $sJsObject = $this->_getJsObject(); // define the member's nickname; $sMemberNickName = getNickName($this->aCommunicatorSettings['member_id']); // all primary language's keys ; $aLanguageKeys = array('author' => _t('_Author'), 'type' => _t('_Type'), 'date' => _t('_Date'), 'click_sort' => _t('_Click to sort'), 'from_me' => _t('_From') . ' ' . $sMemberNickName, 'to_me' => _t('_To') . ' ' . $sMemberNickName, 'accept' => _t('_sys_cnts_btn_fr_accept'), 'reject' => _t('_sys_cnts_btn_fr_reject'), 'delete' => _t('_Delete'), 'back_invite' => _t('_Back Invite'), 'fave' => _t('_sys_cnts_btn_fave'), 'visitor' => _t('_Visitor'), 'unblock' => _t('_Unblock'), 'block' => _t('_Block'), 'select' => _t('_Select'), 'all' => _t('_All'), 'none' => _t('_None'), 'read' => _t('_Read'), 'unread' => _t('_Unread')); // get all requests from DB ; switch ($this->aCommunicatorSettings['communicator_mode']) { case 'friends_requests': $sEmptyMessage = '_sys_cnts_msg_fr_empty'; $sRowsTemplName = $this->aUsedTemplates['communicator_page_fr']; $aTypes = array('from' => _t('_MEMBERS_INVITE_YOU_FRIENDLIST'), 'to' => _t('_MEMBERS_YOU_INVITED_FRIENDLIST')); $aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 0 '); break; case 'hotlist_requests': $aTypes = array('from' => _t('_MEMBERS_YOU_HOTLISTED'), 'to' => _t('_MEMBERS_YOU_HOTLISTED_BY')); $aRows = $this->getRequests('sys_fave_list', $aTypes); break; case 'greeting_requests': $aTypes = array('from' => _t('_MEMBERS_YOU_KISSED'), 'to' => _t('_MEMBERS_YOU_KISSED_BY'), 'specific_key' => '_N times'); $aRows = $this->getRequests('sys_greetings', $aTypes, null, 'Number'); break; case 'blocks_requests': $aTypes = array('from' => _t('_MEMBERS_YOU_BLOCKLISTED'), 'to' => _t('_MEMBERS_YOU_BLOCKLISTED_BY')); $aRows = $this->getRequests('sys_block_list', $aTypes); break; case 'friends_list': $aTypes = array('from' => _t('_Friend list'), 'to' => _t('_Friend list')); $aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 1 OR ( `sys_friend_list`.`ID` = ' . $this->aCommunicatorSettings['member_id'] . ' AND `sys_friend_list`.`Check` = 1 )'); break; default: $aTypes = array('from' => _t('_MEMBERS_INVITE_YOU_FRIENDLIST'), 'to' => _t('_MEMBERS_YOU_INVITED_FRIENDLIST')); $aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 0 '); } if (empty($aRows) && !$bShowEmpty) { return ''; } // ** Generate the page's pagination ; // fill array with all necessary `get` parameters ; $aNeededParameters = array('communicator_mode', 'person_switcher', 'sorting'); // collect the page's URL ; $sRequest = BX_DOL_URL_ROOT . 'communicator.php?action=get_page'; // add additional parameters ; foreach ($aNeededParameters as $sKey) { $sRequest .= (array_key_exists($sKey, $this->aCommunicatorSettings) and $this->aCommunicatorSettings[$sKey]) ? '&' . $sKey . '=' . $this->aCommunicatorSettings[$sKey] : null; } $sCuttedUrl = $sRequest; $sRequest .= '&page={page}&per_page={per_page}'; // create the pagination object ; $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $this->iTotalRequestsCount, 'per_page' => $this->aCommunicatorSettings['per_page'], 'sorting' => $this->aCommunicatorSettings['sorting'], 'page' => $this->aCommunicatorSettings['page'], 'per_page_changer' => false, 'page_reloader' => true, 'on_change_page' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".getPaginatePage('{$sRequest}')", 'on_change_per_page' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".getPage(this.value, '{$sCuttedUrl}')")); $sPagination = $oPaginate->getPaginate(); // process received requests; if ($aRows) { $iIndex = 1; foreach ($aRows as $iKey => $aItems) { // if member not a visitor ; if ($aItems['member_id']) { // ** some member's information ; $aProfileInfo = getProfileInfo($aItems['member_id']); // member's Icon ; $sMemberIcon = get_member_thumbnail($aProfileInfo['ID'], 'left', $this->aCommunicatorSettings['communicator_mode'] != 'friends_requests'); // member's profile location ; $sMemberLocation = getProfileLink($aProfileInfo['ID']); // member's nickname ; $sMemberNickName = getNickName($aProfileInfo['ID']); // define the member's age ; $sMemberAge = $aProfileInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aProfileInfo['DateOfBirth'])) : null; // define the member's country, sex, etc ... ; $sMemberCountry = $aProfileInfo['Country']; $sMemberFlag = $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension; $sMemberSexImg = $oFunctions->genSexIcon($aProfileInfo['Sex']); if ($sMemberCountry) { $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />'; } $iMemberMutualFriends = getMutualFriendsCount($aItems['member_id'], getLoggedId()); } else { // ** if it's a visitor // member's Icon ; $sMemberIcon = $aLanguageKeys['visitor']; // member's profile location ; $sMemberLocation = null; $sMemberSexImg = null; $sMemberAge = null; $sMemberCountryFlag = null; $sMemberCountry = null; } $aProcessedRows[] = array('js_object' => $sJsObject, 'row_value' => $aItems['member_id'], 'member_icon' => $sMemberIcon, 'member_nick_name' => $sMemberNickName, 'member_location' => $sMemberLocation ? '<a href="' . $sMemberLocation . '">' . $sMemberNickName . '</a>' : '', 'member_sex_img' => $sMemberSexImg ? ' <img src="' . $sMemberSexImg . '" alt="' . $aProfileInfo['Sex'] . '" />' : '', 'member_age' => $sMemberAge, 'member_flag' => $sMemberCountryFlag, 'member_country' => $sMemberCountry, 'member_mutual_friends' => _t('_sys_cnts_txt_mutual_friends', $iMemberMutualFriends > 0 ? $iMemberMutualFriends : _t('_sys_cnts_txt_mf_no')), 'type' => $aItems['type'], 'message_date' => $aItems['date']); $iIndex++; } // init the sort toggle ellements ; switch ($this->aCommunicatorSettings['sorting']) { case 'date': $aSortToglleElements['date_sort_toggle'] = 'toggle_up'; break; case 'date_desc': $aSortToglleElements['date_sort_toggle'] = 'toggle_down'; break; case 'author': $aSortToglleElements['author_sort_toggle'] = 'toggle_up'; break; case 'author_desc': $aSortToglleElements['author_sort_toggle'] = 'toggle_down'; break; } // define the actions list for type of requests; switch ($this->aCommunicatorSettings['communicator_mode']) { case 'friends_requests': // define the person mode ; switch ($this->aCommunicatorSettings['person_switcher']) { case 'to': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['accept'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'accept_friends_request', 'getProcessingRows')")), 1 => array('type' => 'button', 'value' => $aLanguageKeys['reject'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'reject_friends_request', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'from': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['back_invite'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'delete_friends_request', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } break; case 'hotlist_requests': // define the person mode ; switch ($this->aCommunicatorSettings['person_switcher']) { case 'to': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['fave'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'add_hotlist', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'from': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'delete_hotlisted', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } break; case 'greeting_requests': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'delete_greetings', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'blocks_requests': // define the person mode ; switch ($this->aCommunicatorSettings['person_switcher']) { case 'to': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['block'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'block_unblocked', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'from': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['unblock'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'unblock_blocked', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } break; case 'friends_list': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => "if ( typeof " . $sJsObject . " != 'undefined' ) " . $sJsObject . ".sendAction('communicator_container', 'reject_friends_request', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } // processing the sort link ; $sSortLink = getClearedParam('sorting', $sCuttedUrl) . '&page=' . $this->aCommunicatorSettings['page'] . '&per_page=' . $this->aCommunicatorSettings['per_page']; // fill array with template keys ; $aTemplateKeys = array('js_object' => $sJsObject, 'from_me' => $aLanguageKeys['from_me'], 'to_me' => $aLanguageKeys['to_me'], 'selected_from' => $this->aCommunicatorSettings['person_switcher'] == 'from' ? 'checked="checked"' : null, 'selected_to' => $this->aCommunicatorSettings['person_switcher'] == 'to' ? 'checked="checked"' : null, 'page_sort_url' => $sSortLink, 'sort_date' => $this->aCommunicatorSettings['sorting'] == 'date' ? 'date_desc' : 'date', 'sort_author' => $this->aCommunicatorSettings['sorting'] == 'author' ? 'author_desc' : 'author', 'date_sort_toggle_ellement' => $aSortToglleElements['date_sort_toggle'], 'author_sort_toggle_ellement' => $aSortToglleElements['author_sort_toggle'], 'author' => $aLanguageKeys['author'], 'type' => $aLanguageKeys['type'], 'date' => $aLanguageKeys['date'], 'click_sort' => $aLanguageKeys['click_sort'], 'bx_repeat:rows' => $aProcessedRows, 'actions_list' => $sActionsList, 'current_page' => 'communicator.php', 'select' => $aLanguageKeys['select'], 'all_messages' => $aLanguageKeys['all'], 'none_messages' => $aLanguageKeys['none'], 'read_messages' => $aLanguageKeys['read'], 'unread_messages' => $aLanguageKeys['unread'], 'page_pagination' => $sPagination); $sPageContent = $oSysTemplate->parseHtmlByName($sRowsTemplName, $aTemplateKeys); } else { $sPageContent = $oSysTemplate->parseHtmlByName('default_margin.html', array('content' => MsgBox(_t($sEmptyMessage)))); } // ** Process the final template ; // generate the page settings ; if ($bShowSettings) { $aTemplateKeys = array('js_object' => $sJsObject, 'from_me' => $aLanguageKeys['from_me'], 'to_me' => $aLanguageKeys['to_me'], 'selected_from' => $this->aCommunicatorSettings['person_switcher'] == 'from' ? 'checked="checked"' : null, 'selected_to' => $this->aCommunicatorSettings['person_switcher'] == 'to' ? 'checked="checked"' : null); $sSettings = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['communicator_settings'], $aTemplateKeys); } // fill array with template keys ; $aTemplateKeys = array('js_object' => $sJsObject, 'current_page' => 'communicator.php', 'communicator_mode' => $this->aCommunicatorSettings['communicator_mode'], 'communicator_person_mode' => $this->aCommunicatorSettings['person_switcher'], 'error_message' => bx_js_string(_t('_Please, select at least one message')), 'sure_message' => bx_js_string(_t('_Are you sure?')), 'settings' => $sSettings, 'page_content' => $sPageContent); return $oSysTemplate->parseHtmlByName($this->aUsedTemplates['communicator_settings_page'], $aTemplateKeys); }
/** * Function will find all needed members by some criteria ; * * @return : Html presentation data ; */ function getBlockCode_SearchedMembersBlock() { // lang keys ; $sOutputHtml = ''; $sPhotoCaption = _t('_With photos only'); $sOnlineCaption = _t('_online only'); $sSimpleCaption = _t('_Simple'); $sExtendCaption = _t('_Extended'); $aUsedTemplates = array('browse_searched_block.html'); // collect the SQL parameters ; $aWhereParam = array(); $aWhereParam[] = $this->aParameters['sex'] ? '`Profiles`.`Sex` = "' . $this->aParameters['sex'] . '"' : null; if ($this->aParameters['age']) { $aAgeTemp = explode('-', $this->aParameters['age']); $iFrom = isset($aAgeTemp[0]) ? (int) $aAgeTemp[0] : 0; $iTo = isset($aAgeTemp[1]) ? (int) $aAgeTemp[1] : 0; unset($aAgeTemp); if ($iFrom) { $sSign = $iTo ? '>=' : '='; $aWhereParam[] = "\n ((YEAR(CURDATE())-YEAR(`Profiles`.`DateOfBirth`)) - (RIGHT(CURDATE(),5)<RIGHT(`Profiles`.`DateOfBirth`,5))) {$sSign} {$iFrom}\n "; } if ($iTo) { $sSign = $iFrom ? '<=' : '='; $aWhereParam[] = "\n ((YEAR(CURDATE())-YEAR(`Profiles`.`DateOfBirth`)) - (RIGHT(CURDATE(),5)<RIGHT(`Profiles`.`DateOfBirth`,5))) {$sSign} {$iTo}\n "; } } $aWhereParam[] = $this->aParameters['country'] ? '`Profiles`.`Country` = "' . $this->aParameters['country'] . '"' : null; if ($this->aAdditionalParameters['photos_only']) { $aWhereParam[] = '`Profiles`.`Avatar` <> 0'; } if ($this->aAdditionalParameters['online_only']) { $aWhereParam[] = "(`Profiles`.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $this->iMemberOnlineTime . " MINUTE)) "; } $sWhereParam = null; foreach ($aWhereParam as $sValue) { if ($sValue) { $sWhereParam .= ' AND ' . $sValue; } } // make search ; $sQuery = "SELECT COUNT(*) AS `Cnt` FROM `Profiles` WHERE {$this->_sSqlActive} {$sWhereParam}"; $iTotalNum = db_value($sQuery); if (!$iTotalNum) { $sOutputHtml = MsgBox(_t('_Empty')); } // init some pagination parameters ; $iPerPage = $this->aDisplaySettings['per_page']; $iCurPage = $this->aDisplaySettings['page']; if ($iCurPage < 1) { $iCurPage = 1; } $sLimitFrom = ($iCurPage - 1) * $iPerPage; $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; // switch template for `simle` and `advanced` mode ; $sTemplateName = $this->aDisplaySettings['mode'] == 'extended' ? 'search_profiles_ext.html' : 'search_profiles_sim.html'; // select sorting parameters ; $sSortParam = '`Profiles`.`DateLastNav` DESC'; if (isset($this->aDisplaySettings['sort'])) { switch ($this->aDisplaySettings['sort']) { case 'date_reg': $sSortParam = ' `Profiles`.`DateReg` DESC'; break; case 'rate': $sSortParam = ' `Profiles`.`Rate` DESC, `Profiles`.`RateCount` DESC'; break; default: $this->aDisplaySettings['sort'] = 'activity'; case 'activity': $sSortParam = ' `Profiles`.`DateLastNav` DESC'; break; } } else { $this->aDisplaySettings['sort'] = 'activity'; } // status uptimization $iOnlineTime = (int) getParam("member_online_time"); $sIsOnlineSQL = ", if(`DateLastNav` > SUBDATE(NOW(), INTERVAL {$iOnlineTime} MINUTE ), 1, 0) AS `is_online`"; $sQuery = "\n SELECT\n `Profiles`.* {$sIsOnlineSQL}\n FROM\n `Profiles`\n WHERE\n {$this->_sSqlActive}\n {$sWhereParam}\n ORDER BY\n {$sSortParam}\n {$sqlLimit}\n "; $rResult = db_res($sQuery); $iIndex = 0; // need for the block divider ; $aExtendedCss = array('ext_css_class' => $this->aDisplaySettings['mode'] == 'extended' ? 'search_filled_block' : ''); while (true == ($aRow = mysql_fetch_assoc($rResult))) { // generate the `couple` thumbnail ; if ($aRow['Couple']) { $aCoupleInfo = getProfileInfo($aRow['Couple']); $sOutputHtml .= $this->oSearchProfileTmpl->PrintSearhResult($aRow, $aCoupleInfo, $iIndex % 2 ? $aExtendedCss : array(), $sTemplateName); } else { $sOutputHtml .= $this->oSearchProfileTmpl->PrintSearhResult($aRow, array(), $iIndex % 2 ? $aExtendedCss : array(), $sTemplateName); } $iIndex++; } // # end of search generation ; // work with link pagination ; if ($this->bPermalinkMode) { preg_match("|([^\\?\\&]*)|", $_SERVER['REQUEST_URI'], $aMatches); if (isset($aMatches[1]) and $aMatches[1]) { $sRequest = $aMatches[1] . '?'; } // need for additional parameters ; $aGetParams = array('photos_only', 'online_only', 'sort', 'mode'); foreach ($aGetParams as $sValue) { if (isset($_GET[$sValue])) { $sRequest .= '&' . $sValue . '=' . rawurlencode($_GET[$sValue]); } } } else { $sRequest = BX_DOL_URL_ROOT . 'browse.php?'; // need for additional parameters ; $aGetParams = array('sex', 'age', 'country', 'photos_only', 'online_only', 'sort', 'mode'); foreach ($aGetParams as $sValue) { if (isset($_GET[$sValue])) { $sRequest .= '&' . $sValue . '=' . rawurlencode($_GET[$sValue]); } } } // cutted al aunecessary parameters ; $sRequest = getClearedParam('sort', $sRequest); $sRequest = $sRequest . '&page={page}&per_page={per_page}&sort={sorting}'; // gen pagination block ; $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'sorting' => $this->aDisplaySettings['sort'], 'page' => $iCurPage, 'per_page_changer' => false, 'page_reloader' => true, 'on_change_page' => null, 'on_change_per_page' => null)); $sPagination = $oPaginate->getPaginate(); // gen per page block ; $sPerPageBlock = $oPaginate->getPages($iPerPage); // prepare to output ; $sOutputHtml .= ' <div class="clear_both"></div> '; $sRequest = str_replace('{page}', '1', $sRequest); $sRequest = str_replace('{per_page}', $iPerPage, $sRequest); $sRequest = str_replace('{sorting}', $this->aDisplaySettings['sort'], $sRequest); // fill array with sorting params ; $aSortingParam = array('activity' => _t('_Latest activity'), 'date_reg' => _t('_FieldCaption_DateReg_View'), 'rate' => _t('_Rate')); // gen sorting block ( type of : drop down ) ; $sSortBlock = $oPaginate->getSorting($aSortingParam); // init some visible parameters ; $sPhotosChecked = $this->aAdditionalParameters['photos_only'] ? 'checked="checked"' : null; $sOnlineChecked = $this->aAdditionalParameters['online_only'] ? 'checked="checked"' : null; // ** cutting all unnecessary get parameters ; // link for photos section ; $sPhotoLocation = getClearedParam('photos_only', $sRequest); // link for online section ; $sOnlineLocation = getClearedParam('online_only', $sRequest); // link for `mode switcher` ; $sModeLocation = getClearedParam('mode', $sRequest); $sModeLocation = getClearedParam('per_page', $sModeLocation); // ** gen header part - with some display options ; // fill array with template's keys ; bx_import('BxDolMemberInfo'); $oMemberInfo = BxDolMemberInfo::getObjectInstance(getParam('sys_member_info_thumb')); $sTopControls = $GLOBALS['oSysTemplate']->parseHtmlByName('browse_sb_top_controls.html', array('sort_block' => $sSortBlock, 'bx_if:show_with_photos' => array('condition' => $oMemberInfo->isAvatarSearchAllowed(), 'content' => array('photo_checked' => $sPhotosChecked, 'photo_location' => $sPhotoLocation, 'photo_caption' => $sPhotoCaption)), 'online_checked' => $sOnlineChecked, 'online_location' => $sOnlineLocation, 'online_caption' => $sOnlineCaption, 'per_page_block' => $sPerPageBlock)); // build template ; $sOutputHtml = $GLOBALS['oSysTemplate']->parseHtmlByName($aUsedTemplates[0], array('top_controls' => $sTopControls, 'bx_if:show_sim_css' => array('condition' => $this->aDisplaySettings['mode'] != 'extended', 'content' => array()), 'bx_if:show_ext_css' => array('condition' => $this->aDisplaySettings['mode'] == 'extended', 'content' => array()), 'searched_data' => $sOutputHtml, 'pagination' => $sPagination)); // generate toggle ellements ; $aToggleItems = array('' => _t('_Simple'), 'extended' => _t('_Extended')); foreach ($aToggleItems as $sKey => $sValue) { $aToggleEllements[$sValue] = array('href' => $sModeLocation . '&mode=' . $sKey, 'dynamic' => true, 'active' => $this->aDisplaySettings['mode'] == $sKey); } return array($sOutputHtml, $aToggleEllements, array(), true); }