0 "; //"WHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND a.crea" $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.max_bid'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC'; break; case 'ending': $page_header_msg = MSG_ENDING_SOON_AUCTIONS; $where_query = "WHERE a.active=1 AND a.approved=1 AND a.closed=0 AND a.deleted=0 AND a.list_in!='store' AND a.creation_in_progress=0"; $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.end_time'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC'; break; default : $where_query = "WHERE a.closed=0 AND a.active=1 AND a.approved=1 AND a.deleted=0 AND a.creation_in_progress=0 AND a.list_in!='store'"; } //////////////////////////////////////////////////////////////// // for finding sever offset $q = "select * from " . DB_PREFIX . "gen_setts"; $res = mysql_query($q); $row = mysql_fetch_array($res); $time_offset = $row["time_offset"]; //////////////////////////////////////////////////////////////// $sort = $_REQUEST["sort"]; switch ($sort) { case 'time_ending_soonest': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.end_time, a.hpfeat, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC'; break; case 'time_newly_listed': break; case 'time_ending_today': $today_date = date("d F Y"); $yesterday = mktime(date("H")+$time_offset, date("i"), date("s"), date("m"), (date("d")+1), date("y")); $yesterday_date = date("d F Y", $yesterday); $min = strtotime($yesterday_date); $max = strtotime($today_date); $min -= 28800; $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.hpfeat, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC'; break; case 'time_new_today': $today_date = date("d F Y"); $yesterday = mktime(date("H")+$time_offset, date("i"), date("s"), date("m"), (date("d")+1), date("y")); $yesterday_date = date("d F Y", $yesterday); $min = strtotime($yesterday_date); $max = strtotime($today_date); $max -= 28800; $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.hpfeat, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC'; break; case 'condition_new_first': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.it_condition'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC'; break; case 'condition_used_first': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.it_condition'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC'; break; case 'price_highest_first': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.start_price DESC, a.max_bid DESC, a.hpfeat DESC, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC'; break; case 'price_lowest_first': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.start_price ASC, a.max_bid ASC, a.hpfeat DESC, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC'; break; case 'bids_higher_first': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.nb_bids DESC, a.hpfeat, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'DESC'; break; case 'bids_lower_first': $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.nb_bids ASC, a.hpfeat, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC'; break; } (array) $query = null; $keywords_search = trim($_REQUEST["keywords_search"]); if(!empty($keywords_search)) $query[] = "MATCH (a.name, a.description) AGAINST ('*" . $keywords_search . "*' IN BOOLEAN MODE)"; $min_price = $_REQUEST["min_price"]; $max_price = $_REQUEST["max_price"]; if(!empty($min_price) && !empty($max_price)) { $query[] = "( (a.max_bid BETWEEN '$min_price' AND '$max_price') OR (a.it_price BETWEEN '$min_price' AND '$max_price') OR (a.start_price BETWEEN '$min_price' AND '$max_price') )"; } $buyout_price = $_REQUEST["buyout_price"]; if($buyout_price == 1) { $query[] = "a.buyout_price>0"; } $fpay = $_REQUEST["fpay"]; if ($fpay == 1) { $fpaym = $_REQUEST["fpaym"]; $query[] = "a.direct_payment = $fpaym"; }//payment $free_shipping = $_REQUEST["free_shipping"]; if ($free_shipping == 1) { $query[] = "a.shipping_method = 2"; } $item_condition = $_REQUEST["item_condition"]; if ($item_condition == 1) { $item_condition_values = $_REQUEST['item_condition_values']; if($item_condition_values == "New") $query[] = "a.it_condition = 'New'"; else $query[] = "a.it_condition = 'Used'"; } $zip_code = $_REQUEST["zip_code"]; if(!empty($zip_code)) $query[] = "a.zip_code = '$zip_code'"; $city = $_REQUEST["city"]; if(!empty($city)) { $query[] = "a.state=$city"; } ////// for category ////////////////////////////////////////////////////////// $cat_mode = $_REQUEST["cat_mode"]; if(!empty($cat_mode)) { (array) $src_cats = null; (string) $category_name = null; reset($categories_array); foreach ($categories_array as $key => $value) { if ($cat_mode == $key) list($category_name, $tmp_user_id) = $value; } reset($categories_array); while (list($cat_array_id, $cat_array_details) = each($categories_array)) { list($cat_array_name, $cat_user_id) = $cat_array_details; $categories_match = strpos($cat_array_name, $category_name); if (trim($categories_match) == "0") $src_cats[] = $cat_array_id; $all_subcategories = $db->implode_array($src_cats, ', '); } $query[] = "(a.category_id IN (" . $cat_array . ") OR a.addl_category_id IN (" . $cat_array . "))"; } $w1 = $where_query; if (count($query)) $where_query = $w1 . " AND " . $db->implode_array($query, ' AND '); $order_field = ($_REQUEST['order_field']) ? $_REQUEST['order_field'] : 'a.nb_bids ASC, a.hpfeat, a.catfeat'; $order_type = ($_REQUEST['order_type']) ? $_REQUEST['order_type'] : 'ASC'; // }//switch //$header_browse_auctions = header5_list($page_header_msg); /* * below we have the variables that need to be declared in each separate browse page */ $page_url = 'auctions_show'; $additional_vars = '&option=' . $_REQUEST['option']; include_once('includes/page_browse_auctions.php'); include_once ('global_footer.php'); echo $template_output; ?>