Changeset 9920
- Timestamp:
- Apr 3, 2009, 4:24:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/inc/classes/BxDolFriendsPageView.php ¶
r9910 r9920 106 106 $aWhereParam = array(); 107 107 if ( $this -> aDisplayParameters['photos'] ) 108 $aWhereParam[] = ' `Profiles`.`PrimPhoto` <> 0';108 $aWhereParam[] = 'p.`PrimPhoto` <> 0'; 109 109 110 110 if ( $this -> aDisplayParameters['online'] ) 111 $aWhereParam[] = "( `Profiles`.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $this -> iMemberOnlineTime . " MINUTE)) ";111 $aWhereParam[] = "(p.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $this -> iMemberOnlineTime . " MINUTE)) "; 112 112 113 113 $sWhereParam = null; … … 137 137 switch($this -> aDisplayParameters['sort']) { 138 138 case 'activity' : 139 $s = 'act'; 139 140 $sSortParam = ' p.`DateLastLogin` DESC'; 140 141 break; … … 348 349 global $oSysTemplate, $oFunctions; 349 350 350 $aFriends = array(); 351 $iOnlineTime = getParam("member_online_time" ); 352 351 353 $aLanguageKeys = array ( 352 ' friend_cnt' => _t( '_All friends' ),353 ' request' => _t( '_Friend requests' ),354 ); 355 356 // get number of all friends ;357 $iFriend Count = getFriendNumber( $iMemberId) ;358 $i FriendsRequest = getFriendNumber( $iMemberId, 0) ;354 'requests' => _t( '_Friend Requests' ), 355 'online' => _t( '_Online Friends' ), 356 ); 357 358 // get all friends requests ; 359 $iFriendsRequests = getFriendNumber( $iMemberId, 0 ) ; 360 $iOnlineFriends = getFriendNumber( $iMemberId, 1, $iOnlineTime ) ; 359 361 360 362 // try to generate member's messages list ; 361 if ( $iMemberId ) { 362 363 $sWhereParam = "AND p.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . getParam( "member_online_time" ) . " MINUTE)"; 364 $aAllFriends = getMyFriendsEx($iMemberId, $sWhereParam, 'last_nav', 5); 365 366 /*$sQuery = " 367 SELECT p.* 368 FROM `Profiles` AS p 369 LEFT JOIN `FriendList` AS f1 ON (f1.`ID` = p.`ID` AND f1.`Profile` ='{$iMemberId}' AND `f1`.`Check` = 1) 370 LEFT JOIN `FriendList` AS f2 ON (f2.`Profile` = p.`ID` AND f2.`ID` ='{$iMemberId}' AND `f2`.`Check` = 1) 371 WHERE 1 372 AND (f1.`ID` IS NOT NULL OR f2.`ID` IS NOT NULL) 373 AND p.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . getParam( "member_online_time" ) . " MINUTE) 374 ORDER BY p.`DateLastNav` 375 LIMIT 5 376 ";*/ 377 378 $rResult = db_res($sQuery); 379 //while( $aRow = mysql_fetch_assoc($rResult) ) 380 foreach ($aAllFriends as $iFriendID) { 381 $aMemberInfo = getProfileInfo($iFriendID); 382 $aIcon = $oFunctions -> _getImageShared( $aMemberInfo, 'icon' ); 383 384 $sHeadline = ( mb_strlen($aMemberInfo['Headline']) > 40 ) 385 ? mb_substr($aMemberInfo['Headline'], 0, 40) . '...' 386 : $aMemberInfo['Headline']; 387 388 $aFriends[] = array( 389 'profile_link' => getProfileLink($iFriendID), 390 'profile_nick' => getNickName($iFriendID), 391 'thumbnail' => $aIcon['file'], 392 'head_line' => $sHeadline, 393 ); 394 } 363 364 $sWhereParam = "AND p.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $iOnlineTime . " MINUTE)"; 365 $aAllFriends = getMyFriendsEx($iMemberId, $sWhereParam, 'last_nav', 5); 366 $rResult = db_res($sQuery); 367 368 foreach ($aAllFriends as $iFriendID) 369 { 370 $aMemberInfo = getProfileInfo($iFriendID); 371 $aIcon = $oFunctions -> _getImageShared( $aMemberInfo, 'icon' ); 372 373 $sHeadline = ( mb_strlen($aMemberInfo['Headline']) > 40 ) 374 ? mb_substr($aMemberInfo['Headline'], 0, 40) . '...' 375 : $aMemberInfo['Headline']; 376 377 $aFriends[] = array( 378 'profile_link' => getProfileLink($iFriendID), 379 'profile_nick' => getNickName($iFriendID), 380 'thumbnail' => $aIcon['file'], 381 'head_line' => $sHeadline, 382 ); 395 383 } 396 384 397 385 // fill array with needed keys ; 398 386 $aTemplateKeys = array ( 399 400 'site_url' => $GLOBALS['site']['url'], 401 'ID' => $iMemberId, 402 'all_friends' => $aLanguageKeys['friend_cnt'], 403 'friends_count' => $iFriendCount, 404 'friend_request' => $aLanguageKeys['request'], 405 'request_count' => $iFriendsRequest, 406 387 'friends_request' => $aLanguageKeys['requests'], 388 'request_count' => $iFriendsRequests, 389 390 'ID' => $iMemberId, 391 'online_friends' => $aLanguageKeys['online'], 392 'online_count' => $iOnlineFriends, 393 407 394 'bx_repeat:friend_list' => $aFriends, 408 395 );
Note: See TracChangeset
for help on using the changeset viewer.