Entrée et Inscription
Recherche Wiki
Commanditaires
Membres en ligne
171 utilisateur(s) en ligne (32 membre(s) connecté(s) sur Wiki Verre Carnaval)
Membre(s): 0
Invité(s): 171
Plus ...
Membre(s): 0
Invité(s): 171
Plus ...
eBay Search
Pays d'origine
class Ebay { var $apiURL; var $apiVersion; var $appID; var $campaignID; var $partnerCode; var $customID; function Ebay($customID='') { $this->apiURL = 'http://open.api.ebay.com/shopping'; $this->apiVersion = '705'; $this->appID = 'Antiques-7aae-42cc-9162-0eaf11566250'; $this->campaignID = 5337071420; $this->partnerCode = 9; $this->customID = $customID; } function makeCall(&$items, &$sortKey, $search, $sid=0, $words='', $limit=100) { global $xoopsDB; $apiCall = $this->apiURL .'?callname='.'FindPopularItems' .'&version='.$this->apiVersion .'&appid='.$this->appID .'&responseencoding='.'XML' .'&MaxEntries='.$limit .'&trackingid='.$this->campaignID .'&trackingpartnercode='.$this->partnerCode .'&affiliateuserid='.$this->customID .'&siteid='.$sid; foreach($search as $s) { $cats = is_array($s['cids']) && !empty($s['cids']) ? '&CategoryID='.implode(',', $s['cids']) : ''; $exCats = is_array($s['excludes']) && !empty($s['excludes']) ? '&CategoryIDExclude='.implode(',', $s['excludes']) : ''; $keywords = $s['keywords'] != '' ? '&QueryKeywords='.$s['keywords'] : ''; $keywords .= $words != '' ? ' '.$words : ''; $call = $apiCall .$cats .$exCats .$keywords; $resp = simplexml_load_file($call); if($resp->Ack == "Success") { foreach($resp->ItemArray->Item as $item) { $row = array(); $row['id'] = (string)$item->ItemID; $row['title'] = (string)$item->Title; //$row['Subtitle'] = (string)$item->subtitle; $row['url'] = (string)$item->ViewItemURLForNaturalSearch; $row['picture'] = (string)$item->GalleryURL; $row['bidCount'] = (int)$item->BidCount; $row['watchCount'] = (int)$item->WatchCount; $row['price'] = (float)$item->ConvertedCurrentPrice; $row['currency'] = (string)$item->ConvertedCurrentPrice->attributes()->currencyID; $row['endTime'] = self::timeleft(strtotime((string)$item->EndTime) - time()); $row['sid'] = $sid; $items[(string)$item->ItemID] = $row; $sortKey[(string)$item->ItemID] = $row['price']; } } } } function timeleft($time) { $days = floor($time / 86400); $time = $time - ($days * 86400); if($days > 0) { $hours = floor($time / 3600); return $days.' '._MD_DAYS.' '.$hours.' '._MD_HOURS; } $hours = floor($time / 3600); $time = $time - ($hours * 3600); if($hours > 0) { $mins = floor($time / 60); return $hours.' '._MD_HOURS.' '.$mins.' '._MD_MINS; } $mins = floor($time / 60); $secs = $time - ($mins * 60); return $mins > 0 ? $mins.' '._MD_MINS.' '.$secs.' '._MD_SECS : $secs.' '._MD_SECS; } function timeleftShort($time) { $days = floor($time / 86400); if($days > 0) {return $days.' '._MD_DAYS;} $time = $time - ($days * 86400); $hours = floor($time / 3600); if($hours > 0) {return $hours.' '._MD_HOURS;} $time = $time - ($hours * 3600); $mins = floor($time / 60); if($mins > 0) {return $mins.' '._MD_MINS;} $secs = $time - ($mins * 60); return $secs.' '._MD_SECS; } } ?>