Changeset 7681 for trunk/xmlrpc
- Timestamp:
- 11/25/08 10:38:21 (4 years ago)
- Location:
- trunk/xmlrpc
- Files:
-
- 1 added
- 2 edited
-
BxDolXMLRPCProfileView.php (added)
-
BxDolXMLRPCServer.php (modified) (6 diffs)
-
index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc/BxDolXMLRPCServer.php
r7607 r7681 33 33 } 34 34 35 function getUserInfoExtra($sUser, $sPwd, $sNick) 36 { 37 $iIdProfile = (int)db_value ("SELECT `ID` FROM `Profiles` WHERE `NickName` = '$sNick' LIMIT 1"); 38 if (!$iIdProfile || !($iId = BxDolXMLRPCServer::_checkLogin ($sUser, $sPwd))) 39 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "scruct")); 40 41 $o = new BxDolXMLRPCProfileView ($iIdProfile); 42 return $o->getProfileInfoExtra(); 43 } 44 35 45 function getMessagesInbox($sUser, $sPwd) 36 46 { … … 59 69 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "scruct")); 60 70 71 /* 61 72 require_once( BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php' ); 62 73 $oPhoto = new ProfilePhotos( $iIdProfile ); … … 72 83 'title' => new xmlrpcval($aRow['med_title']), 73 84 'image' =>new xmlrpcval( $oPhoto -> sMediaUrl . 'photo_' . $aRow['med_file']), 85 ); 86 $aImages[] = new xmlrpcval($a, 'struct'); 87 } 88 89 return new xmlrpcval ($aImages, "array"); 90 */ 91 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolSharedMedia.php' ); 92 $a = BxDolSharedMedia::getActiveUserPhotosListForCategory ($iIdProfile, PROFILE_PHOTOS_CATEGORY); 93 if (!$a) 94 { 95 return new xmlrpcval (array(), "array"); 96 } 97 $aImages = array(); 98 foreach ($a as $aRow) 99 { 100 $a = array ( 101 'id' => new xmlrpcval($aRow['id']), 102 'title' => new xmlrpcval($aRow['title']), 103 'image' =>new xmlrpcval($aRow['medium']), 74 104 ); 75 105 $aImages[] = new xmlrpcval($a, 'struct'); … … 429 459 function _getThumbLink ($iId, $sType = 'thumb') 430 460 { 431 require_once( BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php' ); 432 $aSexSql = getProfileInfo( $iId ); //db_arr( $sSexSql ); 433 $oPhoto = new ProfilePhotos( $iId ); 434 $oPhoto -> getActiveMediaArray(); 435 $aFile = $oPhoto -> getPrimaryPhotoArray(); 436 437 if( extFileExists( $oPhoto -> sMediaDir . $sType . '_' . $aFile['med_file'] ) ) 438 { 439 $sFileName = $oPhoto -> sMediaUrl . $sType . '_' . $aFile['med_file']; 440 } 441 else 442 { 443 switch ($sType) 444 { 445 case 'thumb': $sPrefix = 'medium'; break; 446 case 'icon': $sPrefix = 'small'; break; 447 default: $sPrefix = 'big'; break; 448 } 449 450 if( $aSexSql['Sex'] == 'female' or $aSexSql['Sex'] == 'Female' ) 451 $sSexPic = 'woman_'.$sPrefix.'.gif'; 452 elseif( $aSexSql['Sex'] == 'male' or $aSexSql['Sex'] == 'Male' ) 453 $sSexPic = 'man_'.$sPrefix.'.gif'; 454 else 455 $sSexPic = 'visitor_'.$sPrefix.'.gif'; 456 457 $sFileName = getTemplateIcon( $sSexPic ); 458 } 459 return $sFileName; 461 global $oFunctions; 462 $aProfileInfo = getProfileInfo( $iId ); 463 $aSizes = array ($sType . 'Width' => 0, $sType . 'Height' => 0); 464 $aImageFile = $oFunctions->_getImageShared ($aSizes, $aProfileInfo, $sType); 465 return $aImageFile['file']; 460 466 } 461 467 … … 518 524 } 519 525 526 function concat($s1, $s2) 527 { 528 return new xmlrpcval($s1.$s2); 529 } 530 520 531 function _checkLogin ($sUser, $sPwd) 521 532 { … … 523 534 $_COOKIE["memberID" ] = $iId; 524 535 $_COOKIE["memberPassword"] = $sPwd; 525 return member_auth(0, false) ? $iId : 0;536 return ($GLOBALS['logged']['member'] = member_auth(0, false)) ? $iId : 0; 526 537 } 527 538 -
trunk/xmlrpc/index.php
r7607 r7681 2 2 include("../inc/header.inc.php"); 3 3 require_once(BX_DIRECTORY_PATH_INC . 'admin.inc.php'); 4 require_once(BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCProfileView.php'); 4 5 require_once(BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCServer.php'); 5 6 … … 14 15 "signature" => array (array ($xmlrpcDouble, $xmlrpcStruct)), 15 16 "docstring" => "Add/Sub/Mul/Div function", 17 ), 18 "dolphin.concat" => array( 19 "function" => "BxDolXMLRPCServer::concat", 20 "signature" => array (array ($xmlrpcString, $xmlrpcString, $xmlrpcString)), 21 "docstring" => "concat two strings", 16 22 ), 17 23 "dolphin.login" => array( … … 29 35 "signature" => array (array ($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 30 36 "docstring" => "return user information", 31 ), 37 ), 38 "dolphin.getUserInfoExtra" => array( 39 "function" => "BxDolXMLRPCServer::getUserInfoExtra", 40 "signature" => array (array ($xmlrpcArray, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 41 "docstring" => "return extended users information", 42 ), 32 43 "dolphin.getMessagesInbox" => array( 33 44 "function" => "BxDolXMLRPCServer::getMessagesInbox",
Note: See TracChangeset
for help on using the changeset viewer.