示例#1
0
 public function ajax_wpl_ebay_item_query()
 {
     $col = isset($_REQUEST['col']) ? intval($_REQUEST['col']) : 'ebay_id';
     $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : false;
     if ($col != 'ebay_id') {
         return;
     }
     // limited to single use case for now
     if ($id == '') {
         return;
     }
     $items = WPLE_ListingQueryHelper::getWhere('id', $id);
     $result = $items ? reset($items)->ebay_id : false;
     // check if callback parameter is set
     if (isset($_REQUEST['callback'])) {
         // return JSONP
         header('content-type: application/javascript; charset=utf-8');
         echo $_REQUEST['callback'] . '(' . json_encode($result) . ')';
     } else {
         // return plain JSON
         header('content-type: application/json; charset=utf-8');
         echo json_encode($result);
     }
     exit;
 }
示例#2
0
function wple_get_listings_where($column, $value)
{
    return WPLE_ListingQueryHelper::getWhere($column, $value);
}