<?php
/**
  @licence GPL 2005-2011  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  26/01/11, 15:13
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
 *\group boxes
 *\file recently_viewed.php
 *\dir includes/boxes/
 *\brief  display list product recently viewed
*/
global $recently_viewed,$recent_products;
$count=0;
if($page->_conf_value('OSCSS__B_RECENTLY_VIEWED') && isset($recently_viewed)&& tep_not_null($recently_viewed) ) {
  $rec_products = explode(';',$recently_viewed );
  $recent_products = array();
  if (count($rec_products) >1) {
    $s = '<div id="recently_viewed_inbox">'."\n".'<ul>'."\n";;
    foreach ($rec_products as $recent) {
      if (strlen($recent) >0 && $count<=$page->_conf_value('MAX_DISPLAY_RECENTLY_VIEWED') && ( ($recent_info_values = product_info($recent)) !=false) && ( !isset($_GET['products_id']) || (isset($_GET['products_id']) && $_GET['products_id'] !=$recent)) ) {
	$recent_products[]=arrayInfo($recent_info_values);
	$count++;
      }
    }
    $s .= '</ul>'."\n".'</div>'."\n";

    $array= array('title'=>__('box heading viewed products'),'content'=>tep_output_string_protected(tep_get_include_contents('box.recently_viewed'),false,true));
  }
}
?>