Location: PHPKode > scripts > Price Comparison Shopping by DataFeedFile > price-comparison-shopping-by-datafeedfile/include/DFF_featured_prdt.func.php
<?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.
*
**************************************************************/
require_once $DFF_config['dir_include'].'DFF_category1.array.php';

function DFF_get_featured_prdt_by_category($catnum = FALSE){
	global $DFF_category1_array;

	if($catnum === FALSE){
		//PICK RANDOM CAT1NUM
		$categories1 = $DFF_category1_array;
		while(true){
			shuffle($categories1);
			if($categories1[0]['cat1num']!=1838 && $categories1[0]['cat1num']!=2327){
				$catnum = $categories1[0]['cat1num'];
				break;
			}
		}
	}
	
	//GET FEATURED PRODUCTS BY CATEGORY
	$dff_request = new DFF_Client_API;
	$dff_request->set_using_DFF_config();
	$pse_params['cat1num'] = $catnum;
	$pse_params['limit'] = 20;
	$result = $dff_request->post_request(DFF_PSE,$pse_params);
	$dff_request->convert_json_to_array();
	return $dff_request->result_array['productlist'];

}

?>
Return current item: Price Comparison Shopping by DataFeedFile