Changeset 7850
- Timestamp:
- Dec 2, 2008, 3:30:26 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/all_members.php ¶
r7834 r7850 24 24 require_once( BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_' . $tmpl . '/scripts/BxTemplProfileView.php' ); 25 25 require_once( BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_' . $tmpl . '/scripts/BxTemplBrowse.php' ); 26 require_once(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$tmpl.'/scripts/BxTemplSearchProfile.php'); 26 27 27 28 check_logged(); … … 37 38 class BxDolAllMembersPageView extends BxDolPageView 38 39 { 39 40 // consit all necessary data for display members list ; 40 41 var $aDisplayParameters; 41 42 42 // con sist path to current page;43 // contains the path to the current page ; 43 44 var $sCurrentPage ; 45 46 // link on search profile ; 47 var $rSearchProfileTmpl; 44 48 45 49 /** 46 50 * @description : class constructor ; 47 51 * @param : $sPageName (string) - set page composer ; 48 * @param : $aDisplayParameters (array) - consit all necessary data for display members;52 * @param : $aDisplayParameters (array); 49 53 per_page (integer) - number of elements for per page ; 50 54 page (integer) - current page ; … … 59 63 $this -> aDisplayParameters = &$aDisplayParameters; 60 64 $this -> sCurrentPage = $_SERVER['PHP_SELF']; 65 $this -> rSearchProfileTmpl = new BxTemplSearchProfile(); 61 66 } 62 67 … … 68 73 function getBlockCode_FeaturedMembers() 69 74 { 70 global $tmpl;71 72 75 // init some variables ; 73 76 … … 79 82 80 83 if( !$iTotalNum ) 81 returnMsgBox( _t('_Sorry, nothing found') );84 $sOutputHtml = MsgBox( _t('_Sorry, nothing found') ); 82 85 83 86 $iPerPage = $this -> aDisplayParameters['per_page']; … … 87 90 $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; 88 91 89 // s elect the members template92 // switch member's template ; 90 93 91 94 if ( $this -> aDisplayParameters['mode'] == 'extended' ) … … 97 100 $rResult = db_res($sQuery); 98 101 99 // generate the search result ; 100 101 require_once(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$tmpl.'/scripts/BxTemplSearchProfile.php'); 102 $oBxTemplSearchProfile = new BxTemplSearchProfile(); 103 104 // need for the block devider ; 102 // need for block devider ; 105 103 106 104 $aExtendedCss = array( '__ext_css_class__' => 'search_filled_block'); … … 113 111 if ( !($iIndex % 2) ) 114 112 { 115 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo);113 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo); 116 114 } 117 115 else 118 116 { 119 // generate thefilled block ;120 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss);117 // generate filled block ; 118 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss); 121 119 } 122 120 } … … 125 123 if ( !($iIndex % 2) ) 126 124 { 127 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1);125 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1); 128 126 } 129 127 else 130 128 { 131 // generate the filled block ; 132 133 $sOutputHtml .= $oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss); 129 // generate filled block ; 130 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss); 134 131 } 135 132 } … … 155 152 $sRequest = $sRequest . '&featured_members_page={page}&per_page=' . $iPerPage; 156 153 $sPagination = genPagination( $iTotalNum, $iCurPage, $sRequest, null, 4, $iPerPage, 0 ); 157 154 158 155 return DesignBoxContent( _t( '_featured members' ) . $this -> genToggleBlock(), $sOutputHtml . $sPagination, 1 ); 159 156 } … … 165 162 function getBlockCode_AllMembers() 166 163 { 167 global $tmpl;168 169 164 // init some variables ; 170 165 … … 193 188 $sQuery = "SELECT * FROM `Profiles` {$sqlLimit}"; 194 189 $rResult = db_res($sQuery); 195 196 // generate the search result ;197 198 require_once(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$tmpl.'/scripts/BxTemplSearchProfile.php');199 $oBxTemplSearchProfile = new BxTemplSearchProfile();200 190 201 191 // need for the block devider ; … … 210 200 if ( !($iIndex % 2) ) 211 201 { 212 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo);202 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo); 213 203 } 214 204 else 215 205 { 216 // generate the filled block ; 217 $sOutputHtml .= $oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss); 218 $sOutputHtml .= '<div class="clear_both"></div>'; 206 // generate filled block ; 207 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss); 219 208 } 220 209 } … … 223 212 if ( !($iIndex % 2) ) 224 213 { 225 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1);214 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1); 226 215 } 227 216 else 228 217 { 229 // generate the filled block ; 230 231 $sOutputHtml .= $oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss); 232 $sOutputHtml .= '<div class="clear_both"></div>'; 218 // generate filled block ; 219 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss); 233 220 } 234 221 } … … 292 279 293 280 /** 294 * @description : function will generate mode tog le block ;281 * @description : function will generate mode toggle block ; 295 282 * @return Html presentation data ; 296 283 */ … … 345 332 } 346 333 347 // init some needed varibales 334 // init some needed varibales ; 348 335 349 336 if ( isset($_GET['per_page']) ) … … 378 365 $iPage2 = 1; 379 366 380 $aDisplayParameters = array( 367 $aDisplayParameters = array 368 ( 381 369 'per_page' => $iPerPage, 382 370 'page' => $iPage, … … 387 375 ); 388 376 389 // generate thepage377 // generate page 390 378 391 379 $_ni = $_page['name_index']; -
TabularUnified trunk/greet.php ¶
r7830 r7850 143 143 if ($bAjxMod) { 144 144 $sJQueryJS = genAjaxyPopupJS($recipientID); 145 echo MsgBox($action_result) . $sJQueryJS; exit;145 echo _t_action($action_result) . $sJQueryJS; exit; 146 146 } 147 147 return DesignBoxContent( _t("_Send virtual kiss"), $ret, $oTemplConfig -> PageVkiss_db_num ); -
TabularUnified trunk/inc/classes/BxDolBrowse.php ¶
r7769 r7850 4 4 5 5 // consist path to cache ; 6 7 6 var $sCacheFilePath; 8 7 9 8 // consit all member's information ; 10 11 9 var $aMembersInfo; 12 10 13 11 // consit all Date of birth range ; 14 15 12 var $aDateBirthRange; 16 13 17 14 // consit all Sex ranges ; 18 19 15 var $aSexRange; 20 16 21 17 // consit all Sex ranges ; 22 23 18 var $aCountryRange; 24 19 25 20 // consist true value if isset permalink mode ; 26 27 21 var $bPermalinkMode; 28 22 29 23 // need for array searching ; 30 31 24 var $sKeyName; 32 25 -
TabularUnified trunk/install/sql/v61.sql ¶
r7843 r7850 6870 6870 INSERT INTO `PageCompose` VALUES(133, 'all_members', '960px', '', '_featured members', 1, 0, 'FeaturedMembers', '', 0, 69, 'non,memb', 0); 6871 6871 INSERT INTO `PageCompose` VALUES(134, 'all_members', '960px', '', '_all members', 1, 1, 'AllMembers', '', 0, 69, 'non,memb', 0); 6872 INSERT INTO `PageCompose` VALUES(135, 'friends_page', '960px', '', '_Friends', 2, 0, 'Friends', '', 1, 69, 'non,memb', 0); 6873 INSERT INTO `PageCompose` VALUES(136, 'friends_page', '960px', '', '_Friends tracker', 1, 0, 'Tracker', '', 1, 31, 'non,memb', 0); 6872 6874 6873 6875 -- -------------------------------------------------------- -
TabularUnified trunk/profile_info.php ¶
r7659 r7850 35 35 class BxDolProfileInfoPageView extends BxDolPageView 36 36 { 37 38 // consist all informaion about the view profile 39 37 // consist all informaion about viewed profile ; 40 38 var $aMemberInfo = array(); 41 39 42 // if member loged - will true 40 // logged member ID ; 41 var $iMemberID; 43 42 44 var $iMemberID;45 46 43 /** 47 ** class constructor ;44 * class constructor ; 48 45 */ 49 46 50 47 function BxDolProfileInfoPageView( $sPageName, &$aMemberInfo ) 51 48 { 52 53 49 parent::BxDolPageView($sPageName); 54 50 $this->aMemberInfo = &$aMemberInfo; … … 57 53 ? (int) $_COOKIE['memberID'] 58 54 : 0; 59 60 55 } 61 56 62 57 /** 63 ** @description : function will draw block withprofile photos ;58 * @description : function will draw block with the profile photos ; 64 59 */ 65 60 … … 68 63 global $oFunctions; 69 64 70 $sPhotoContent = $oFunctions->GenPhotoSWBlock($this->aMemberInfo['ID']); 65 $aParams = array 66 ( 67 'PID' => $this->aMemberInfo['ID'] 68 ); 69 70 $sPhotoContent = $oFunctions -> GenPhotoSWBlock( $aParams ); 71 71 $sWraper = $this->GenFormWrap( $sPhotoContent, 'profile_info', 'ProfilePhotos', 1, 342); 72 72 … … 75 75 else 76 76 return ; 77 78 77 } 79 78 80 79 /** 81 ** @description : function will draw block withprofile actions ;80 * @description : function will draw block with the profile actions ; 82 81 */ 83 82 … … 90 89 else 91 90 return; 92 93 91 } 94 92 95 93 /** 96 ** @description : function will generate the profile general information ;94 * @description : function will generate profile general information ; 97 95 */ 98 96 … … 105 103 106 104 return $oProfilePV->oProfileGen->showBlockPFBlock ( null, 17, true ); 107 108 105 } 109 106 110 107 /** 111 ** @description : function will generate the profile personal information ;108 * @description : function will generate profile personal information ; 112 109 */ 113 110 … … 124 121 } 125 122 126 // init some needed variables 123 // init some needed variables ; 127 124 128 125 $iViewedID = ( isset($_GET['ID']) ) … … 140 137 $_ni = $_page['name_index']; 141 138 142 if ( is_array($aMemberInfo) and !empty($aMemberInfo) ) {143 144 // prepare all needed keys 139 if ( is_array($aMemberInfo) and !empty($aMemberInfo) ) 140 { 141 // prepare all needed keys ; 145 142 146 143 $aMemberInfo['window_width'] = $oTemplConfig->popUpWindowWidth; … … 156 153 $oProfileInfo = &new BxDolProfileInfoPageView( 'profile_info', $aMemberInfo ); 157 154 $sOutputHtml = $oProfileInfo->getCode(); 158 159 155 } 160 156 -
TabularUnified trunk/templates/base/css/browse.css ¶
r7834 r7850 1 div.dbContent 2 { 3 margin:0px; 4 } 5 1 6 div.top_settings_block { 2 7 background-color:#EDEDED; -
TabularUnified trunk/templates/base/scripts/BxBaseBrowse.php ¶
r7834 r7850 20 20 21 21 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolBrowse.php' ); 22 require_once(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$tmpl.'/scripts/BxTemplSearchProfile.php'); 22 23 23 24 class BxBaseBrowse extends BxDolBrowse … … 30 31 var $aAdditionalParameters; 31 32 33 // link on search profile ; 34 var $rSearchProfileTmpl; 35 32 36 /** 33 37 * @description : class constructor ; 38 * @param : aFilteredSettings ( array ) ; 34 39 */ 35 40 36 41 function BxBaseBrowse( &$aFilteredSettings ) 37 42 { 38 39 43 if ( isset($aFilteredSettings['sex']) and $aFilteredSettings['sex'] == 'all' ) 40 44 $aFilteredSettings['sex'] = null; … … 97 101 ); 98 102 103 $this -> rSearchProfileTmpl = new BxTemplSearchProfile(); 99 104 } 100 105 … … 691 696 $sExtendCaption = _t( '_Extended' ); 692 697 693 // collect the SQL param s ;698 // collect the SQL parameters ; 694 699 695 700 $aWhereParam = array(); … … 806 811 $iIndex = 0; 807 812 808 // generate the search result ;809 810 require_once(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$tmpl.'/scripts/BxTemplSearchProfile.php');811 $oBxTemplSearchProfile = new BxTemplSearchProfile();812 813 813 // need for the block devider ; 814 814 … … 822 822 if ( !($iIndex % 2) ) 823 823 { 824 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo);824 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo); 825 825 } 826 826 else 827 827 { 828 828 // generate the filled block ; 829 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss);829 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss); 830 830 } 831 831 } … … 834 834 if ( !($iIndex % 2) ) 835 835 { 836 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1);836 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1); 837 837 } 838 838 else … … 840 840 // generate the filled block ; 841 841 842 $sOutputHtml .= $ oBxTemplSearchProfile->PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss);842 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss); 843 843 } 844 844 } … … 910 910 ); 911 911 912 // gen sorting block ( drop down ) ;912 // gen sorting block ( type of : drop down ) ; 913 913 914 914 $sSortBlock = $oFunctions -> genSortingBlock( $aSortingParam, $sRequest); … … 934 934 $sOnlineLocation = $this -> getCutParam( 'online_only', $sRequest); 935 935 936 // link for `mode switcher` section;936 // link for `mode switcher` ; 937 937 938 938 $sModeLocation = $this -> getCutParam( 'mode', $sRequest); … … 1008 1008 '; 1009 1009 1010 $aToggleItems = array 1011 ( 1012 '' => _t( '_Simple' ), 1013 'extended' => _t( '_Extended' ), 1014 ); 1015 1016 foreach( $aToggleItems AS $sKey => $sValue ) 1017 { 1018 $aToggleEllements[$sValue] = array 1019 ( 1020 'href' => $sModeLocation . '&mode=' . $sKey, 1021 'dynamic' => true, 1022 'active' => ($this -> aDisplayParameters['mode'] == $sKey ), 1023 ); 1024 } 1025 1010 1026 return DesignBoxContent( _t( '_People' ) . $sParamsToggle, $sHeaderPart . $sOutputHtml . $sPagination, 1 ); 1011 1027 } -
TabularUnified trunk/templates/base/scripts/BxBaseFunctions.php ¶
r7848 r7850 1561 1561 return $oForm->getCode(); 1562 1562 } 1563 1563 1564 } 1564 1565 -
TabularUnified trunk/viewFriends.php ¶
r7569 r7850 1 1 <?php 2 2 3 /*************************************************************************** 4 * Dolphin Smart Community Builder 5 * ----------------- 6 * begin : Mon Mar 23 2006 7 * copyright : (C) 2006 BoonEx Group 8 * website : http://www.boonex.com/ 9 * This file is part of Dolphin - Smart Community Builder 10 * 11 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 12 * http://creativecommons.org/licenses/by/3.0/ 13 * 14 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 * See the Creative Commons Attribution 3.0 License for more details. 17 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * see license.txt file; if not, write to marketing@boonex.com 19 ***************************************************************************/ 20 21 require_once( 'inc/header.inc.php' ); 22 require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 23 require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); 24 25 $_page['name_index'] = 82; 26 $_page['css_name'] = 'browse.css'; 27 28 check_logged(); 29 30 $_page['header'] = _t("_Friends"); 31 $_page['header_text'] = _t("_Friends"); 32 $_ni = $_page['name_index']; 33 $_page_cont[$_ni]['page_main_code'] = MsgBox(_t('_Sorry, nothing found')); 34 35 $iProfileID = (int)$_GET['iUser']; 36 $aProfileInfo = getProfileInfo($iProfileID); 37 38 if ($aProfileInfo) { 39 $_page['header'] = getNickName( $iProfileID)."'s "._t("_Friends"); 40 $_page['header_text'] = getNickName( $iProfileID)."'s "._t("_Friends"); 3 /*************************************************************************** 4 * Dolphin Smart Community Builder 5 * ----------------- 6 * begin : Mon Mar 23 2006 7 * copyright : (C) 2006 BoonEx Group 8 * website : http://www.boonex.com/ 9 * This file is part of Dolphin - Smart Community Builder 10 * 11 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. 12 * http://creativecommons.org/licenses/by/3.0/ 13 * 14 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 * See the Creative Commons Attribution 3.0 License for more details. 17 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, 18 * see license.txt file; if not, write to marketing@boonex.com 19 ***************************************************************************/ 20 21 require_once( 'inc/header.inc.php' ); 22 require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 23 require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); 24 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolPageView.php' ); 25 require_once( BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_' . $tmpl . '/scripts/BxTemplProfileView.php' ); 26 require_once(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$tmpl.'/scripts/BxTemplSearchProfile.php'); 27 28 $_page['name_index'] = 7; 29 $_page['css_name'] = 'browse.css'; 30 $_page['js_name'] = 'browse.js'; 31 32 check_logged(); 33 34 $iProfileID = ( isset($_GET['iUser']) ) 35 ? (int) $_GET['iUser'] 36 : 0 ; 37 38 $aProfileInfo = getProfileInfo( $iProfileID ); 39 40 if ( $aProfileInfo ) 41 { 42 $sPageCaption = _t( '_Friends of' ) . ':' . getNickName( $iProfileID ); 43 44 $_page['header'] = $sPageCaption; 45 $_page['header_text'] = $sPageCaption; 46 47 $_ni = $_page['name_index']; 48 } 49 50 class BxDolFriendsPageView extends BxDolPageView 51 { 52 // consit all necessary data for display members list ; 53 var $aDisplayParameters; 54 55 var $iProfileID; 56 57 // link on search profile ; 58 var $rSearchProfileTmpl; 59 60 // contains the path to the current page ; 61 var $sCurrentPage ; 62 63 var $iMemberOnlineTime; 64 65 /** 66 * @description : class constructor ; 67 * @param : $sPageName (string) - name of build page ; 68 * @param : $aDisplayParameters (array) ; 69 per_page (integer) - number of elements for per page ; 70 page (integer) - current page ; 71 mode (string) - will swith member view mode ; 72 ext_tmpl (string) - path to extended member's template ; 73 sim_tmpl (string) - path to simple member's template ; 74 sort (string) - sorting parameters ; 75 * @param : $iProfileID (integer) - member ID ; 76 */ 77 78 function BxDolFriendsPageView($sPageName, &$aDisplayParameters, $iProfileID) 79 { 80 parent::BxDolPageView($sPageName); 81 $this -> aDisplayParameters = &$aDisplayParameters; 82 $this -> iProfileID = $iProfileID; 83 84 $this -> rSearchProfileTmpl = new BxTemplSearchProfile(); 85 $this -> sCurrentPage = $_SERVER['PHP_SELF']; 86 87 // check member on line time ; 88 89 $this -> iMemberOnlineTime = getParam( "member_online_time" ); 90 } 91 92 /** 93 * @description : function will generate member tracker list ; 94 * @return : Html presentation data; 95 */ 96 97 function getBlockCode_Tracker() 98 { 99 return 'hui'; 100 } 101 102 /** 103 * @description : function will generate friends list ; 104 * @return : array ; 105 */ 106 107 function getBlockCode_Friends() 108 { 109 global $oFunctions; 110 111 // init some variables ; 112 113 $sOutputHtml = null; 114 $iIndex = null; 115 116 // lang keys ; 117 118 $sPhotoCaption = _t( '_With photos only' ); 119 $sOnlineCaption = _t( '_online only' ); 120 121 // collect the SQL parameters ; 122 123 $aWhereParam = array(); 124 if ( $this -> aDisplayParameters['photos'] ) 125 $aWhereParam[] = '`Profiles`.`PrimPhoto` <> 0'; 126 127 if ( $this -> aDisplayParameters['online'] ) 128 $aWhereParam[] = "(`Profiles`.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $this -> iMemberOnlineTime . " MINUTE)) "; 129 130 $sWhereParam = null; 131 foreach( $aWhereParam AS $sValue ) 132 if ( $sValue ) 133 $sWhereParam .= ' AND ' . $sValue; 134 135 // # end collect of SQL ; 136 137 $sQuery = 138 " 139 SELECT 140 COUNT(`Profiles`.`ID`) 141 FROM 142 `FriendList` 143 INNER JOIN 144 `Profiles` 145 ON 146 `Profiles`.`ID` = `FriendList`.`Profile` AND `FriendList`.`ID` = {$this -> iProfileID} 147 OR 148 `Profiles`.`ID` = `FriendList`.`ID` AND `FriendList`.`Profile` = {$this -> iProfileID} 149 {$sWhereParam} 150 WHERE 151 `FriendList`.`Profile` = {$this -> iProfileID} 152 OR 153 `FriendList`.`ID` = {$this -> iProfileID} 154 AND 155 `FriendList`.`Check` = 1 156 "; 157 158 $iTotalNum = db_value($sQuery); 159 160 if( !$iTotalNum ) 161 $sOutputHtml = MsgBox( _t('_Sorry, nothing found') ); 162 163 $iPerPage = $this -> aDisplayParameters['per_page']; 164 $iCurPage = $this -> aDisplayParameters['page']; 165 166 $sLimitFrom = ( $iCurPage - 1 ) * $iPerPage; 167 $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; 168 169 // switch member's template ; 170 171 if ( $this -> aDisplayParameters['mode'] == 'extended' ) 172 $sTemplSearch = file_get_contents( $this -> aDisplayParameters['ext_tmpl'] ); 173 else 174 $sTemplSearch = file_get_contents( $this -> aDisplayParameters['sim_tmpl'] ); 175 176 // select the sorting parameters ; 177 178 $sSortParam = '`Profiles`.`DateLastLogin` DESC'; 179 180 if ( isset($this -> aDisplayParameters['sort']) ) 181 { 182 switch($this -> aDisplayParameters['sort']) { 183 case 'activity' : 184 $sSortParam = ' `Profiles`.`DateLastLogin` DESC'; 185 break; 186 case 'date_reg' : 187 $sSortParam = ' `Profiles`.`DateReg` DESC'; 188 break; 189 case 'rate' : 190 $sSortParam = ' `profile_rating`.`pr_rating_sum` DESC'; 191 break; 192 default : 193 $sSortParam = ' `Profiles`.`DateLastLogin` DESC'; 194 } 195 } 196 197 $sQuery = 198 " 199 SELECT 200 `Profiles`.* 201 FROM 202 `FriendList` 203 INNER JOIN 204 `Profiles` 205 ON 206 `Profiles`.`ID` = `FriendList`.`Profile` AND `FriendList`.`ID` = {$this -> iProfileID} 207 OR 208 `Profiles`.`ID` = `FriendList`.`ID` AND `FriendList`.`Profile` = {$this -> iProfileID} 209 {$sWhereParam} 210 LEFT JOIN 211 `profile_rating` 212 ON 213 `Profiles`.`ID` = `profile_rating`.`pr_id` 214 WHERE 215 `FriendList`.`Profile` = {$this -> iProfileID} 216 OR 217 `FriendList`.`ID` = {$this -> iProfileID} 218 AND 219 `FriendList`.`Check` = 1 220 ORDER BY 221 {$sSortParam} 222 {$sqlLimit} 223 "; 224 225 $rResult = db_res($sQuery); 226 227 // need for the block devider ; 228 229 $aExtendedCss = array( '__ext_css_class__' => 'search_filled_block'); 230 231 while( $aRow = mysql_fetch_assoc($rResult) ) 232 { 233 234 if ( $aRow['Couple']) 235 { 236 $aCoupleInfo = getProfileInfo( $Row['Couple'] ); 237 if ( !($iIndex % 2) ) 238 { 239 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo); 240 } 241 else 242 { 243 // generate filled block ; 244 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, $aCoupleInfo, $aExtendedCss); 245 } 246 } 247 else 248 { 249 if ( !($iIndex % 2) ) 250 { 251 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1); 252 } 253 else 254 { 255 // generate filled block ; 256 $sOutputHtml .= $this -> rSearchProfileTmpl -> PrintSearhResult($aRow, $sTemplSearch, 1, null, $aExtendedCss); 257 } 258 } 259 260 $iIndex++; 261 } 262 263 $sOutputHtml .= '<div class="clear_both"></div>'; 264 265 // work with link pagination ; 266 267 $sRequest = $_SERVER['PHP_SELF'] . '?'; 268 $aGetParams = array('mode', 'iUser', 'photos_only', 'online_only', 'sort'); 269 if ( is_array($aGetParams) and !empty($aGetParams) ) 270 foreach($aGetParams AS $sValue ) 271 if ( isset($_GET[$sValue]) ) 272 { 273 $sRequest .= '&' . $sValue . '=' . $_GET[$sValue]; 274 } 275 276 // gen pagination block ; 277 278 $sRequest = $sRequest . '&page={page}&per_page=' . $iPerPage; 279 $sPagination = genPagination( $iTotalNum, $iCurPage, $sRequest, null, 4, $iPerPage, 1 ); 280 281 // ** GENERATE HEADER PART ; 282 283 // gen per page block ; 284 285 $sPerPageBlock = $oFunctions -> genPerPageBlock( $iPerPage, $sRequest, null); 286 287 // fill array with sorting params ; 288 289 $aSortingParam = array 290 ( 291 'activity' => _t( '_Latest activity' ), 292 'date_reg' => _t( '_FieldCaption_DateReg_View' ), 293 'rate' => _t( '_Rate' ), 294 ); 295 296 // gen sorting block ( type of : drop down ) ; 297 298 $sRequest = str_replace('{page}', '1', $sRequest); 299 $sSortBlock = $oFunctions -> genSortingBlock( $aSortingParam, $sRequest); 300 301 // init some visible parameters ; 302 303 $sPhotosChecked = ($this -> aDisplayParameters['photos']) 304 ? 'checked="checked"' 305 : null; 306 307 $sOnlineChecked = ($this -> aDisplayParameters['online']) 308 ? 'checked="checked"' 309 : null; 310 311 // link for photos section ; 312 313 $sPhotoLocation = $this -> getCutParam( 'photos_only', $sRequest); 314 315 // link for online section ; 316 317 $sOnlineLocation = $this -> getCutParam( 'online_only', $sRequest); 318 319 // link for `mode switcher` ; 320 321 $sModeLocation = $this -> getCutParam( 'mode', $sRequest); 322 $sModeLocation = $this -> getCutParam( 'per_page', $sModeLocation); 323 324 $sHeaderPart = 325 ' 326 <div class="top_settings_block"> 327 <div class="ordered_block"> 328 ' . $sSortBlock . ' 329 330 <input type="checkbox" ' . $sPhotosChecked . ' name="photos_only" value="on" onclick="oBrowsePage.LocationChange(this, \'' . $sPhotoLocation . '\')" /> 331 ' . $sPhotoCaption . ' 332 333 <input type="checkbox" ' . $sOnlineChecked . ' name="online_only" value="on" onclick="oBrowsePage.LocationChange(this, \'' . $sOnlineLocation . '\')"/> 334 ' . $sOnlineCaption . ' 335 </div> 336 <div class="per_page_block"> 337 ' . $sPerPageBlock . ' 338 </div> 339 <div class="clear_both"></div> 340 </div> 341 '; 342 343 $aToggleItems = array 344 ( 345 '' => _t( '_Simple' ), 346 'extended' => _t( '_Extended' ), 347 ); 348 349 foreach( $aToggleItems AS $sKey => $sValue ) 350 { 351 $aToggleEllements[$sValue] = array 352 ( 353 'href' => $sModeLocation . '&mode=' . $sKey, 354 'dynamic' => true, 355 'active' => ($this -> aDisplayParameters['mode'] == $sKey ), 356 ); 357 } 358 359 return array( $sHeaderPart . $sOutputHtml . $sPagination, $aToggleEllements ); 360 } 361 362 /** 363 * @description : function will cute the parameter from received string; 364 * @param : $aExceptNames (string) - name of unnecessary paremeter; 365 * @return : cleared string; 366 */ 367 368 function getCutParam( $sExceptParam, $sString ) 369 { 370 return preg_replace( "/(&|&){$sExceptParam}=([a-z0-9\_\-]{1,})/i",'', $sString); 371 } 372 373 } 374 375 // generate page ; 376 41 377 $_ni = $_page['name_index']; 42 $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode($iProfileID); 43 } 44 45 PageCode(); 46 47 function PageCompPageMainCode($iProfileID) { 48 $sFriendsListSQL = " 49 SELECT `Profiles`.* FROM `FriendList` 50 INNER JOIN `Profiles` ON (`Profiles`.`ID` = `FriendList`.`Profile` AND `FriendList`.`ID` = '{$iProfileID}' OR `Profiles`.`ID` = `FriendList`.`ID` AND `FriendList`.`Profile` = '{$iProfileID}') 51 WHERE 52 (`FriendList`.`Profile` = '{$iProfileID}' OR `FriendList`.`ID` = '{$iProfileID}') AND 53 `FriendList`.`Check` = '1' 54 ORDER BY `Profiles`.`Picture` DESC 55 "; 56 57 $vFriendsList = db_res($sFriendsListSQL); 58 59 if (mysql_num_rows($vFriendsList)>0) { 60 $iCounter = 0; 61 while ( $aFriendInfo = mysql_fetch_assoc( $vFriendsList ) ) { 62 $ret .= '<div class="search_res_members_block_1">' . get_member_thumbnail($aFriendInfo['ID'], 'none') . '<div class="browse_nick"><a href="' . getProfileLink($aFriendInfo['ID']) . '">' . $aFriendInfo['NickName'] . '</a></div><div class="clear_both"></div></div>'; 63 $iCounter ++; 64 } 65 } else { 66 return MsgBox(_t('_Sorry, nothing found')); 378 379 // init some needed varibales ; 380 381 if ( isset($_GET['per_page']) ) 382 { 383 $iPerPage = (int) $_GET['per_page']; 67 384 } 68 69 $sRet = '<div class="dbContent"><div class="block_rel_100">' . $ret . '</div></div>'; 70 71 return $sRet; 72 } 385 else 386 { 387 $iPerPage = ( isset($_GET['mode']) and $_GET['mode'] == 'extended' ) 388 ? $iPerPage = 5 389 : $iPerPage = 32; 390 } 391 392 if ( $iPerPage <= 0 ) 393 $iPerPage = 32; 394 395 if ( $iPerPage > 100 ) 396 $iPerPage = 100; 397 398 $iPage = ( isset($_GET['page']) ) 399 ? (int) $_GET['page'] 400 : 1; 401 402 if ( $iPage <= 0 ) 403 $iPage = 1; 404 405 $aDisplayParameters = array 406 ( 407 'per_page' => $iPerPage, 408 'page' => $iPage, 409 'mode' => isset($_GET['mode']) ? $_GET['mode'] : null, 410 'ext_tmpl' => BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/search_profiles_ext.html", 411 'sim_tmpl' => BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/search_profiles_sim.html", 412 'photos' => isset($_GET['photos_only']) ? true : false, 413 'online' => isset($_GET['online_only']) ? true : false, 414 'sort' => isset($_GET['sort']) ? $_GET['sort'] : null, 415 ); 416 417 $oFriendsPage = &new BxDolFriendsPageView( 'friends_page', $aDisplayParameters, $iProfileID ); 418 $sOutputHtml = $oFriendsPage -> getCode(); 419 420 $_page_cont[$_ni]['page_main_code'] = $sOutputHtml; 421 422 PageCode(); 423 424 ?>
Note: See TracChangeset
for help on using the changeset viewer.