Changeset 11465 for trunk/xmlrpc/BxDolXMLRPCMedia.php
- Timestamp:
- 07/17/09 06:28:35 (3 years ago)
- File:
-
- 1 edited
-
trunk/xmlrpc/BxDolXMLRPCMedia.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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');
Note: See TracChangeset
for help on using the changeset viewer.