<?php
  /**
   * Most Popular Items
   *
   * @package Digital Downloads Pro
   * @author wojoscripts.com
   * @copyright 2010
   * @version $Id: popular.php, v2.00 2011-07-10 10:12:05 gewa Exp $
   */
  if (!defined("_VALID_PHP"))
      die('. دسترسی مستقیم به این محل مجاز نمی باشد');
	  
  $poprow = $item->mostPopProducts();
?>
<!-- Start Most Popular-->
  <div class="sidebar">
    <div class="inner">
      <h4><img src="<?php echo SITEURL; ?>/images/pop-icon.png" alt=""  />محـبـوب تـریِن محصـولات</h4>
      <div class="content" style="text-align:center; margin-left:auto; margin-right:auto">
      <?php if($poprow):?>
      <?php foreach ($poprow as $prow):?>
      <?php $thumb = ($prow['thumb']) ? PRODIMGURL . 'thumbs/' . $prow['thumb'] : UPLOADURL . 'blank.png';?>
      <?php $url = ($core->seo) ? $core->site_url . '/view-item/' . intval($prow['pid']) . '/' . sanitize($prow['slug']) . '.html' : $core->site_url . '/item.php?pid=' . intval($prow['pid']);?>
      <span class="thumb" style="margin:1%"><a href="<?php echo $url;?>" class="tooltip" title="<?php echo $prow['title'];?>"><img src="<?php echo $thumb;?>" alt=""/></a></span>
      <?php endforeach;?>
      <?php endif;?>
      </div>
    </div>
  </div>
<!-- End Most Popular/--> 