HomeHelpTrac

Changeset 15620 for tags


Ignore:
Timestamp:
10/16/11 21:13:39 (7 months ago)
Author:
Alexander Trofimov
Message:

Ticket #2679

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/7.0/xmlrpc/BxDolXMLRPCSearch.php

    r15342 r15620  
    5454        $sLng = (float)$sLng; 
    5555 
     56        if ((!$sLat || !$sLng) && BxDolRequest::serviceExists('map_profiles', 'get_location')) { 
     57            $aLocation = BxDolService::call('map_profiles', 'get_location', array($iId, 0, false)); 
     58            if ($aLocation && !empty($aLocation['lat']) && !empty($aLocation['lng'])) { 
     59                $sLat = $aLocation['lat']; 
     60                $sLng = $aLocation['lng']; 
     61            } 
     62        } 
     63 
     64        if (!$sLat || !$sLng) 
     65            return new xmlrpcval (array(), "array"); 
     66 
    5667        $sWhere = ''; 
    5768        $sJoin = ''; 
    58         $sLocation = ''; 
    59         if ($sLat && $sLng) 
    60         { 
    61             $sDistance = ", (POW($sLat-`loc`.`lat`, 2)+POW($sLng-`loc`.`lng`, 2)) AS `distance`"; 
    62             $sJoin .= " INNER JOIN `bx_map_profiles` AS `loc` ON  (`loc`.`id` = `Profiles`.`ID` AND `loc`.`failed` = 0) "; 
    63         } 
     69        $sLocation = '';         
     70        $sDistance = ", (POW($sLat-`loc`.`lat`, 2)+POW($sLng-`loc`.`lng`, 2)) AS `distance`"; 
     71        $sJoin .= " INNER JOIN `bx_map_profiles` AS `loc` ON  (`loc`.`id` = `Profiles`.`ID` AND `loc`.`failed` = 0) "; 
     72         
     73 
    6474        if ($isWithPhotosOnly) 
    6575            $sWhere .= " AND `Avatar` "; 
Note: See TracChangeset for help on using the changeset viewer.