HomeHelpTrac

Ignore:
Timestamp:
08/28/09 05:41:07 (3 years ago)
Author:
Alexander Trofimov
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc/BxDolXMLRPCSearch.php

    r10411 r12465  
    3333            WHERE 1 $sWhere 
    3434            ORDER BY `DateLastNav` DESC 
     35            LIMIT $iStart, $iPP"); 
     36 
     37        while ($aRow = mysql_fetch_array ($r)) 
     38            $aProfiles[] = new xmlrpcval(BxDolXMLRPCUtil::fillProfileArray($aRow, 'thumb'), 'struct'); 
     39 
     40        return new xmlrpcval ($aProfiles, "array"); 
     41    } 
     42 
     43    function getSearchResultsNearMe($sUser, $sPwd, $sLang, $sLat, $sLng, $isOnlineOnly, $isWithPhotosOnly, $iStart, $iPP) 
     44    { 
     45        if (!($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 
     46            return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 
     47 
     48        BxDolXMLRPCUtil::setLanguage ($sLang);  
     49 
     50        $sWhere = ''; 
     51        $sJoin = ''; 
     52        $sLocation = ''; 
     53        if ($sLat && $sLng) 
     54        { 
     55            $sDistance = ", (POW($sLat-`loc`.`lat`, 2)+POW($sLng-`loc`.`lng`, 2)) AS `distance`"; 
     56            $sJoin .= " INNER JOIN `bx_map_profiles` AS `loc` ON  (`loc`.`id` = `ID` AND `loc`.`failed` = 0) "; 
     57        } 
     58        if ($isWithPhotosOnly) 
     59            $sWhere .= " AND `Avatar` "; 
     60        if ($isOnlineOnly)  
     61        { 
     62            $iOnlineTime = getParam( 'member_online_time' ); 
     63            $sWhere .= " AND `DateLastNav` >= DATE_SUB(NOW(), INTERVAL $iOnlineTime MINUTE)"; 
     64        } 
     65        $iStart = (int)$iStart; 
     66        if (!$iStart || $iStart < 0) 
     67            $iStart = 0; 
     68        $iPP = (int)$iPP; 
     69        if (!$iPP || $iPP < 1) 
     70            $iPP = 1; 
     71 
     72        $r = db_res (" 
     73            SELECT * " . $sDistance  . " FROM `Profiles` 
     74            $sJoin 
     75            WHERE 1 $sWhere 
     76            ORDER BY `distance` ASC 
    3577            LIMIT $iStart, $iPP"); 
    3678 
Note: See TracChangeset for help on using the changeset viewer.