Changeset 11465 for trunk/xmlrpc
- Timestamp:
- 07/17/09 06:28:35 (3 years ago)
- Location:
- trunk/xmlrpc
- Files:
-
- 4 edited
-
BxDolXMLRPCImages.php (modified) (1 diff)
-
BxDolXMLRPCMedia.php (modified) (9 diffs)
-
BxDolXMLRPCUtil.php (modified) (4 diffs)
-
index.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc/BxDolXMLRPCImages.php
r11418 r11465 92 92 return new xmlrpcval ("fail upload"); 93 93 } 94 95 function getImagesInAlbum($sUser, $sPwd, $sNick, $iAlbumId) 96 { 97 $iIdProfile = BxDolXMLRPCUtil::getIdByNickname ($sNick); 98 if (!$iIdProfile || !($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 99 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 100 101 return BxDolXMLRPCMedia::_getFilesInAlbum ('photos', $iIdProfile, $iAlbumId); 102 } 103 94 104 } 95 105 -
trunk/xmlrpc/BxDolXMLRPCMedia.php
r11418 r11465 11 11 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 12 12 13 return BxDolXMLRPCMedia::_getFilesInCategory ('videos', $iIdProfile, $sCat );13 return BxDolXMLRPCMedia::_getFilesInCategory ('videos', $iIdProfile, $sCat, 'video', 'getToken', 'flash/modules/video/files/get_mobile.php?id='); 14 14 } 15 15 … … 20 20 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 21 21 22 return BxDolXMLRPCMedia::_getFilesInCategory ('sounds', $iIdProfile, $sCat );23 } 24 25 function _getFilesInCategory ($sModuleName, $iIdProfile, $sCat )22 return BxDolXMLRPCMedia::_getFilesInCategory ('sounds', $iIdProfile, $sCat, 'mp3', 'getMp3Token', 'flash/modules/mp3/files/get_file.php?id='); 23 } 24 25 function _getFilesInCategory ($sModuleName, $iIdProfile, $sCat, $sWidget = '', $sFuncToken = '', $sTokenUrl = '') 26 26 { 27 if ($sWidget) { 28 $GLOBALS['sModule'] = $sWidget; 29 require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/{$sWidget}/inc/header.inc.php"); 30 } 31 27 32 $a = BxDolService::call ($sModuleName, 'get_files_in_cat', array($iIdProfile, $sCat), 'Search'); 28 33 if (!$a) … … 30 35 foreach ($a as $k => $aRow) 31 36 { 37 $sToken = ''; 38 if ($sFuncToken) 39 $sToken = $sFuncToken($aRow['id']); 40 41 $sUrl = $sTokenUrl && $sToken ? BX_DOL_URL_ROOT . $sTokenUrl . $aRow['id'] . '&token=' . $sToken : $aRow['file']; 42 32 43 $a = array ( 33 44 'id' => new xmlrpcval($aRow['id']), … … 36 47 'icon' => new xmlrpcval($aRow['icon']), 37 48 'thumb' => new xmlrpcval($aRow['thumb']), 38 'file' => new xmlrpcval($ aRow['file']),49 'file' => new xmlrpcval($sUrl), 39 50 'cat' => new xmlrpcval($sCat), 40 51 'rate' => new xmlrpcval($aRow['voting_rate']), … … 150 161 $aList = $o->getAlbumList (array('owner' => $iIdProfile)); 151 162 $aXmlRpc = array (); 152 while ($aList = mysql_fetch_array ($r))163 foreach ($aList as $r) 153 164 { 154 165 $a = array ( 155 'Id' => new xmlrpcval($ a['ID']),156 'Title' => new xmlrpcval($ a['Caption']),157 'Num' =>new xmlrpcval($ a['ObjCount']),158 ); 159 $aXmlRpc[] = new xmlrpcval($a File, 'struct');166 'Id' => new xmlrpcval($r['ID']), 167 'Title' => new xmlrpcval($r['Caption']), 168 'Num' =>new xmlrpcval($r['ObjCount']), 169 ); 170 $aXmlRpc[] = new xmlrpcval($a, 'struct'); 160 171 } 161 172 return new xmlrpcval ($aXmlRpc, "array"); … … 170 181 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 171 182 172 return BxDolXMLRPCMedia::_getFilesInAlbum ('videos', $iIdProfile, $iAlbumId );183 return BxDolXMLRPCMedia::_getFilesInAlbum ('videos', $iIdProfile, $iAlbumId, 'video', 'getToken', 'flash/modules/video/files/get_mobile.php?id='); 173 184 } 174 185 … … 179 190 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 180 191 181 return BxDolXMLRPCMedia::_getFilesInAlbum ('sounds', $iIdProfile, $iAlbumId );182 } 183 184 function _getFilesInAlbum ($sModuleName, $iIdProfile, $iAlbumId )192 return BxDolXMLRPCMedia::_getFilesInAlbum ('sounds', $iIdProfile, $iAlbumId, 'mp3', 'getMp3Token', 'flash/modules/mp3/files/get_file.php?id='); 193 } 194 195 function _getFilesInAlbum ($sModuleName, $iIdProfile, $iAlbumId, $sWidget = '', $sFuncToken = '', $sTokenUrl = '') 185 196 { 197 if ($sWidget) { 198 require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/global/inc/db.inc.php"); 199 require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/{$sWidget}/inc/header.inc.php"); 200 require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/{$sWidget}/inc/constants.inc.php"); 201 require_once (BX_DIRECTORY_PATH_ROOT . "flash/modules/{$sWidget}/inc/functions.inc.php"); 202 } 203 186 204 $a = BxDolService::call ($sModuleName, 'get_files_in_album', array($iAlbumId), 'Search'); 187 205 if (!$a) … … 189 207 foreach ($a as $k => $aRow) 190 208 { 209 $sToken = ''; 210 if ($sFuncToken) 211 $sToken = $sFuncToken($aRow['id']); 212 213 $sUrl = $sTokenUrl && $sToken ? BX_DOL_URL_ROOT . $sTokenUrl . $aRow['id'] . '&token=' . $sToken : $aRow['file']; 214 191 215 $a = array ( 192 216 'id' => new xmlrpcval($aRow['id']), … … 195 219 'icon' => new xmlrpcval($aRow['icon']), 196 220 'thumb' => new xmlrpcval($aRow['thumb']), 197 'file' => new xmlrpcval($ aRow['file']),221 'file' => new xmlrpcval($sUrl), 198 222 'cat' => new xmlrpcval($sCat), 199 'rate' => new xmlrpcval($aRow[' voting_rate']),200 'rate_count' => new xmlrpcval((int)$aRow[' voting_count']),223 'rate' => new xmlrpcval($aRow['Rate']), 224 'rate_count' => new xmlrpcval((int)$aRow['RateCount']), 201 225 ); 202 226 $aFiles[] = new xmlrpcval($a, 'struct'); -
trunk/xmlrpc/BxDolXMLRPCUtil.php
r11418 r11465 82 82 function getThumbLink ($iId, $sType = 'thumb') 83 83 { 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); 88 86 } 89 87 … … 98 96 $aRet['country'] = new xmlrpcval($aSexSql['Country']); 99 97 $aRet['city'] = new xmlrpcval($aSexSql['City']); 98 $aRet['countFriends'] = new xmlrpcval(getFriendNumber($iId)); 100 99 101 100 bx_import('BxDolAlbums'); 102 101 103 102 $o = new BxDolAlbums ('bx_photos', $iId); 104 $aRet['countPhotos'] = new xmlrpcval($o->get AlbumList (array('owner' => $iId, 'status' => '')));103 $aRet['countPhotos'] = new xmlrpcval($o->getObjTotalCount (array('owner' => $iId))); 105 104 106 105 $o = new BxDolAlbums ('bx_videos', $iId); 107 $aRet['countVideos'] = new xmlrpcval($o->get AlbumList (array('owner' => $iId, 'status' => '')));106 $aRet['countVideos'] = new xmlrpcval($o->getObjTotalCount (array('owner' => $iId))); 108 107 109 108 $o = new BxDolAlbums ('bx_sounds', $iId); 110 $aRet['countSounds'] = new xmlrpcval($o->get AlbumList (array('owner' => $iId, 'status' => '')));109 $aRet['countSounds'] = new xmlrpcval($o->getObjTotalCount (array('owner' => $iId))); 111 110 112 111 return $aRet; … … 116 115 { 117 116 $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 119 125 return array ( 120 126 'ID' => new xmlrpcval($a['ID']), … … 125 131 'Country' => new xmlrpcval(_t($GLOBALS['aPreValues']['Country'][$a['Country']]['LKey'])), 126 132 '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'])), 127 137 $sImageKey => new xmlrpcval($sImage), 128 138 ); -
trunk/xmlrpc/index.php
r11418 r11465 211 211 "docstring" => "get profile's video albums", 212 212 ), 213 "dolphin.getImagesInAlbum" => array( 214 "function" => "BxDolXMLRPCImages::getImagesInAlbum", 215 "signature" => array (array ($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 216 "docstring" => "get profile's images in specified album", 217 ), 218 "dolphin.getVideoInAlbum" => array( 219 "function" => "BxDolXMLRPCMedia::getVideoInAlbum", 220 "signature" => array (array ($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 221 "docstring" => "get profile's video in specified album", 222 ), 223 "dolphin.getAudioInAlbum" => array( 224 "function" => "BxDolXMLRPCMedia::getAudioInAlbum", 225 "signature" => array (array ($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 226 "docstring" => "get profile's sounds in specified album", 227 ), 213 228 ), 214 229 0
Note: See TracChangeset
for help on using the changeset viewer.