function getFriendRequests($sUser, $sPwd, $sLang)
 {
     if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
         return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
     }
     BxDolXMLRPCUtil::setLanguage($sLang);
     $r = db_res("\n            SELECT `Profiles`.* FROM `sys_friend_list`\n            LEFT JOIN `Profiles` ON `Profiles`.`ID` = `sys_friend_list`.`ID`\n            WHERE `sys_friend_list`.`Profile` = {$iId} AND `Check` = 0\n            ORDER BY `Profiles`.`NickName` ASC");
     $aProfiles = array();
     while ($aRow = $r->fetch()) {
         $aProfiles[] = new xmlrpcval(BxDolXMLRPCUtil::fillProfileArray($aRow, 'thumb'), 'struct');
     }
     return new xmlrpcval($aProfiles, "array");
 }
Esempio n. 2
0
 function getSearchResultsKeyword($sUser, $sPwd, $sLang, $sKeyword, $isOnlineOnly, $isWithPhotosOnly, $iStart, $iPP)
 {
     if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
         return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
     }
     BxDolXMLRPCUtil::setLanguage($sLang);
     $sKeyword = process_db_input($sKeyword, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION);
     $sMatch = '';
     if ($sKeyword && strlen($sKeyword) > 2) {
         $sMatch .= " MATCH (`NickName`, `City`, `DescriptionMe`, `Tags`) AGAINST ('{$sKeyword}') ";
         $sWhere .= " AND {$sMatch}  ";
     }
     if ($isWithPhotosOnly) {
         $sWhere .= " AND `Avatar` ";
     }
     if ($isOnlineOnly) {
         $iOnlineTime = (int) getParam('member_online_time');
         $sWhere .= " AND `DateLastNav` >= DATE_SUB(NOW(), INTERVAL {$iOnlineTime} MINUTE)";
     }
     $iStart = (int) $iStart;
     if (!$iStart || $iStart < 0) {
         $iStart = 0;
     }
     $iPP = (int) $iPP;
     if (!$iPP || $iPP < 1) {
         $iPP = 1;
     }
     $r = db_res("\n            SELECT * " . ($sMatch ? ", {$sMatch}" : '') . " FROM `Profiles`\n            WHERE `Status` = 'Active' AND (`Profiles`.`Couple` = 0 OR `Profiles`.`Couple` > `Profiles`.`ID`)  {$sWhere}\n            ORDER BY `DateLastNav` DESC\n            LIMIT {$iStart}, {$iPP}");
     while ($aRow = mysql_fetch_array($r)) {
         $aProfiles[] = new xmlrpcval(BxDolXMLRPCUtil::fillProfileArray($aRow, 'thumb'), 'struct');
     }
     return new xmlrpcval($aProfiles, "array");
 }