<?php
/**************************************************************
*
* DataFeedFile.com (DFF) Framework API
* Copyright (c) 2008 DataFeedFile.com
*
* DFF Framework API uses CreativeCommons.org by-sa license.
* This license lets others remix, tweak, and build upon your work even for commercial reasons,
* as long as they CREDIT DataFeedFile.com and license their new creations under the identical terms.
* This license is often compared to open source software licenses.
* All new works based on yours will carry the same license, so any derivatives will also allow commercial use.
* Please read our license.txt file for more detail.
*
**************************************************************/
// PSE FUNCTIONS RELATED ARRAYS
$PSE_sort_array[] = array('key'=>'','name'=>'Best Match');
$PSE_sort_array[] = array('key'=>'priceasc','name'=>'Price low to high');
$PSE_sort_array[] = array('key'=>'pricedesc','name'=>'Price high to low');
$PSE_sort_array[] = array('key'=>'prdtrating','name'=>'Product Rating');
$PSE_sort_array[] = array('key'=>'storerating','name'=>'Store Rating');
function DFF_get_PSE_pricerange_options($price_range_array, $selected_key = FALSE){
global $DFF_config;
$output = '';
if($price_range_array){
foreach($price_range_array as $pra){
if(strpos($pra['name'],'under')!==FALSE || strpos($pra['name'],'over')!==FALSE) $caption = str_replace('_',' '.$DFF_config['currency_symbol'],$pra['name']);
else $caption = $DFF_config['currency_symbol'].str_replace('_',' to '.$DFF_config['currency_symbol'],$pra['name']);
$output .= '<option value="'.$pra['name'].'" '.(($pra['name']==$selected_key)?'selected="selected"':'').'>'.$caption.' ('.$pra['count'].')</option>';
}
}
return $output;
}
function DFF_get_PSE_merchant_options($merchant_array, $selected_key = FALSE){
$output = '';
if($merchant_array){
foreach($merchant_array as $ma){
$output .= '<option value="'.$ma['mernum'].'" '.(($ma['mernum']==$selected_key)?'selected="selected"':'').'>'.$ma['mername'].' ('.$ma['count'].')</option>';
}
}
return $output;
}
function DFF_get_PSE_sort_options($selected_key = FALSE){
global $PSE_sort_array;
$output = '';
if($PSE_sort_array){
foreach($PSE_sort_array as $psa){
$output .= '<option value="'.$psa['key'].'" '.(($psa['key']==$selected_key)?'selected="selected"':'').'>'.$psa['name'].'</option>';
}
}
return $output;
}
?>