oc-content/plugins/related_ads/index.php
// Manual function to show related Ads    	 
Manual function to show related Ads
Manual function to show related Ads
function related_ads_start() {
    $rmItemId = osc_item_id() ;
    $ra_numads = (osc_related_ra_numads() != '') ? osc_related_ra_numads() : '' ;
    $picOnly = (osc_related_picOnly() != '') ? osc_related_picOnly() : ''; 
    $mSearch = new Search() ;
    $mSearch->addCategory(osc_item_category_id()) ;
    if($picOnly == 1 ) {
    $mSearch->withPicture(true); 
    }
    $mSearch->limit(1, $ra_numads) ; 
    $aItems = $mSearch->doSearch(); 
	GLOBAL $global_items;
	$global_items = View::newInstance()->_get('items') ; 
	View::newInstance()->_exportVariableToView('items', $aItems); 
    require_once 'related_ads.php';
    GLOBAL $stored_items; 
    View::newInstance()->_exportVariableToView('items', $global_items); 
    }
function related_ads_start ( ) { $ rmItemId = osc_item_id ( ) ; $ ra_numads = ( osc_related_ra_numads ( ) != '' ) ? osc_related_ra_numads ( ) : '' ; $ picOnly = ( osc_related_picOnly ( ) != '' ) ? osc_related_picOnly ( ) : '' ; $ mSearch = new Search ( ) ; $ mSearch -> addCategory ( osc_item_category_id ( ) ) ; if ( $ picOnly == 1 ) { $ mSearch -> withPicture ( true ) ; } $ mSearch -> limit ( 1 , $ ra_numads ) ; $ aItems = $ mSearch -> doSearch ( ) ; GLOBAL $ global_items ; $ global_items = View :: newInstance ( ) -> _get ( 'items' ) ; View :: newInstance ( ) -> _exportVariableToView ( 'items' , $ aItems ) ; require_once 'related_ads.php' ; GLOBAL $ stored_items ; View :: newInstance ( ) -> _exportVariableToView ( 'items' , $ global_items ) ; }
Manual function to show related Ads
Manual function to show related Ads
//Search only Item which have pictures // fetch number of ads to show set in preference //save existing item array //exporting our searched item array //calling stored item array //restore original item array