HomeHelpTrac

Ignore:
Timestamp:
07/17/09 06:28:35 (3 years ago)
Author:
Alexander Trofimov
Message:

albums for media

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCUtil.php

    r11418 r11465  
    8282    function getThumbLink ($iId, $sType = 'thumb') 
    8383    { 
    84         global $oFunctions; 
    85         $aProfileInfo = getProfileInfo( $iId );          
    86         $aImageFile = BxDolService::call('bx_photos', 'get_image', array($aProfileInfo, $sType), 'Search'); 
    87         return $aImageFile ? $aImageFile['file'] : false; 
     84        $sType = $sType == 'thumb' ? 'medium' : 'small'; 
     85        return $GLOBALS['oFunctions']->getMemberAvatar ($iId, $sType); 
    8886    } 
    8987 
     
    9896        $aRet['country'] = new xmlrpcval($aSexSql['Country']); 
    9997        $aRet['city'] = new xmlrpcval($aSexSql['City']); 
     98        $aRet['countFriends'] = new xmlrpcval(getFriendNumber($iId)); 
    10099 
    101100        bx_import('BxDolAlbums'); 
    102101 
    103102        $o = new BxDolAlbums ('bx_photos', $iId); 
    104         $aRet['countPhotos'] = new xmlrpcval($o->getAlbumList (array('owner' => $iId, 'status' => ''))); 
     103        $aRet['countPhotos'] = new xmlrpcval($o->getObjTotalCount (array('owner' => $iId))); 
    105104 
    106105        $o = new BxDolAlbums ('bx_videos', $iId); 
    107         $aRet['countVideos'] = new xmlrpcval($o->getAlbumList (array('owner' => $iId, 'status' => ''))); 
     106        $aRet['countVideos'] = new xmlrpcval($o->getObjTotalCount (array('owner' => $iId))); 
    108107 
    109108        $o = new BxDolAlbums ('bx_sounds', $iId); 
    110         $aRet['countSounds'] = new xmlrpcval($o->getAlbumList (array('owner' => $iId, 'status' => ''))); 
     109        $aRet['countSounds'] = new xmlrpcval($o->getObjTotalCount (array('owner' => $iId))); 
    111110 
    112111        return $aRet; 
     
    116115    { 
    117116        $sImageKey = ucfirst ($sImage); 
    118         $sImage = BxDolXMLRPCUtil::getThumbLink($a['ID'], $sImage);  
     117        $sImage = BxDolXMLRPCUtil::getThumbLink($a['ID'], $sImage); 
     118 
     119        bx_import('BxDolAlbums'); 
     120 
     121        $oPhotos = new BxDolAlbums ('bx_photos', $iId); 
     122        $oVideos = new BxDolAlbums ('bx_videos', $iId); 
     123        $oSounds = new BxDolAlbums ('bx_sounds', $iId); 
     124 
    119125        return array ( 
    120126               'ID' => new xmlrpcval($a['ID']), 
     
    125131               'Country' => new xmlrpcval(_t($GLOBALS['aPreValues']['Country'][$a['Country']]['LKey'])), 
    126132               'City' => new xmlrpcval($a['City']), 
     133               'CountPhotos' => new xmlrpcval($oPhotos->getObjTotalCount (array('owner' => $a['ID']))), 
     134               'CountVideos' => new xmlrpcval($oVideos->getObjTotalCount (array('owner' => $a['ID']))), 
     135               'CountSounds' => new xmlrpcval($oSounds->getObjTotalCount (array('owner' => $a['ID']))), 
     136               'CountFriends' => new xmlrpcval(getFriendNumber($a['ID'])), 
    127137               $sImageKey => new xmlrpcval($sImage), 
    128138            ); 
Note: See TracChangeset for help on using the changeset viewer.