HomeHelpTrac

Changeset 7681 for trunk/xmlrpc


Ignore:
Timestamp:
11/25/08 10:38:21 (4 years ago)
Author:
hihi
Message:
 
Location:
trunk/xmlrpc
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCServer.php

    r7607 r7681  
    3333    } 
    3434 
     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 
    3545    function getMessagesInbox($sUser, $sPwd) 
    3646    { 
     
    5969            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "scruct")); 
    6070 
     71/*         
    6172        require_once( BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php' ); 
    6273        $oPhoto = new ProfilePhotos( $iIdProfile ); 
     
    7283                'title' => new xmlrpcval($aRow['med_title']), 
    7384                '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']), 
    74104            ); 
    75105            $aImages[] = new xmlrpcval($a, 'struct'); 
     
    429459    function _getThumbLink ($iId, $sType = 'thumb') 
    430460    { 
    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']; 
    460466    } 
    461467 
     
    518524    } 
    519525 
     526    function concat($s1, $s2) 
     527    { 
     528        return new xmlrpcval($s1.$s2);             
     529    } 
     530 
    520531    function _checkLogin ($sUser, $sPwd) 
    521532    { 
     
    523534        $_COOKIE["memberID" ] = $iId; 
    524535        $_COOKIE["memberPassword"] = $sPwd; 
    525         return member_auth(0, false) ? $iId : 0; 
     536        return ($GLOBALS['logged']['member'] = member_auth(0, false)) ? $iId : 0; 
    526537    } 
    527538 
  • trunk/xmlrpc/index.php

    r7607 r7681  
    22    include("../inc/header.inc.php"); 
    33    require_once(BX_DIRECTORY_PATH_INC . 'admin.inc.php'); 
     4    require_once(BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCProfileView.php'); 
    45    require_once(BX_DIRECTORY_PATH_ROOT . 'xmlrpc/BxDolXMLRPCServer.php'); 
    56 
     
    1415                "signature" => array (array ($xmlrpcDouble, $xmlrpcStruct)), 
    1516                "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", 
    1622            ), 
    1723            "dolphin.login" => array( 
     
    2935                "signature" => array (array ($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 
    3036                "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            ),                         
    3243            "dolphin.getMessagesInbox" => array( 
    3344                "function" => "BxDolXMLRPCServer::getMessagesInbox", 
Note: See TracChangeset for help on using the changeset viewer.