<?php /* Smarty version 2.6.22, created on 2014-02-07 15:24:12
         compiled from D:/Program+Files/Ampps/www/zipmarket%5Capps%5Csearch%5Cviews/index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'D:/Program Files/Ampps/www/zipmarket\\apps\\search\\views/index.html', 37, false),array('modifier', 'date_format', 'D:/Program Files/Ampps/www/zipmarket\\apps\\search\\views/index.html', 111, false),array('modifier', 'url', 'D:/Program Files/Ampps/www/zipmarket\\apps\\search\\views/index.html', 141, false),array('modifier', 'nl2br', 'D:/Program Files/Ampps/www/zipmarket\\apps\\search\\views/index.html', 152, false),)), $this); ?>
<div class="page-info">
    <div class="container">
      <div id="breadcrumbs">
        <a href="/" class="first">صفحه اصلی</a>

            / <a href="/categories/all/">جستجو</a>
/
      </div>

<h1 class="page-title">        <?php echo $this->_tpl_vars['searchText']; ?>


</h1>
      
    </div>

  </div>

<div id="content">
      <div class="container">
          
<div class="content-l ">
    <div id="paginated-content-container">
  <div class="page-controls">
  <?php if ($this->_tpl_vars['type'] == 'users'): ?>
  <form action="" class="sort-control" id="sort-by-form" method="get">
  <label for="sort_by" class="sort-control-label"><?php echo $this->_tpl_vars['lang']['order_by']; ?>
:</label>
				<select class="sort_select" id="sort_by" name="sort_by">
	    			<option value="date"><?php echo $this->_tpl_vars['lang']['date']; ?>
</option>
						<option value="name" <?php if ($_GET['sort_by'] == 'name'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['name']; ?>
</option>
						<option value="average_rating" <?php if ($_GET['sort_by'] == 'average_rating'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['rating']; ?>
</option>
						<option value="sales_count" <?php if ($_GET['sort_by'] == 'sales_count'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['sales']; ?>
</option>
					</select>
				</select>   
				<a href="javascript: void(0);" onclick="submitOrder(this);" title="" class="<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>">
				<img src="/static/img/<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>.png"  alt="" /></a>
	     				  <input id="type" name="type" type="hidden" value="users" />			  
				  <input id="term" name="term" type="hidden" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['searchText'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
</form>
  	<?php elseif ($this->_tpl_vars['type'] == 'collections'): ?>
	<form action="" class="sort-control" id="sort-by-form" method="get">
  <label for="sort_by" class="sort-control-label"><?php echo $this->_tpl_vars['lang']['order_by']; ?>
:</label>
				<select class="sort_select" id="sort_by" name="sort_by">
						<option value="published_at"><?php echo $this->_tpl_vars['lang']['date']; ?>
</option>
						<option value="name" <?php if ($_GET['sort_by'] == 'name'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['name']; ?>
</option>
						<option value="average_rating" <?php if ($_GET['sort_by'] == 'average_rating'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['rating']; ?>
</option>
				</select>   
				<a href="javascript: void(0);" onclick="submitOrder(this);" title="" class="<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>">
				<img src="/static/img/<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?>.png"  alt="" /></a>
				  <input id="type" name="type" type="hidden" value="collections" />			  
				  <input id="term" name="term" type="hidden" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['searchText'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
</form>
		<?php else: ?>
		
			<form action="" class="sort-control" id="sort-by-form" method="get">
					<label><?php echo $this->_tpl_vars['lang']['order_by']; ?>
:</label>
					<select name="sort_by" class="sort_select" onchange="this.form.submit()">
						<option value="published_at"><?php echo $this->_tpl_vars['lang']['date']; ?>
</option>
						<option value="name" <?php if ($_GET['sort_by'] == 'name'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['name']; ?>
</option>
						<option value="average_rating" <?php if ($_GET['sort_by'] == 'average_rating'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['rating']; ?>
</option>
						<option value="sales_count" <?php if ($_GET['sort_by'] == 'sales_count'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['sales']; ?>
</option>
						<option value="price" <?php if ($_GET['sort_by'] == 'price'): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['lang']['price']; ?>
</option>
					</select>
					<a href="javascript: void(0);" onclick="submitOrder(this);" title="" class="order-<?php if ($_GET['order'] == 'asc'): ?>asc<?php else: ?>desc<?php endif; ?> sprite left"></a>
				  <input id="type" name="type" type="hidden" value="files" />			  
				  <input id="term" name="term" type="hidden" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['searchText'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
				  <input id="collection_id" name="collection_id" type="hidden" value="<?php echo $_GET['collection_id']; ?>
" />
				  <?php if (isset ( $_GET['categories'] ) && is_array ( $_GET['categories'] )): ?>
				  	<?php $_from = $_GET['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['c']):
?>
				  		<input type="hidden" name="categories[<?php echo $this->_tpl_vars['k']; ?>
]" value="1" />
				  	<?php endforeach; endif; unset($_from); ?>
				  <?php endif; ?>
				</form>
	<?php endif; ?>
    <div class="layout-switcher sort-control">
  <a href="#" class="layout-list sort-control-tooltip active" data-tooltip="List View"></a>
  <a href="#" class="layout-grid sort-control-tooltip" data-tooltip="Grid View"></a>
</div>

    <div class="pagination"><?php echo $this->_tpl_vars['paging']; ?>
</div>   
  </div>
<?php if ($this->_tpl_vars['results']): ?>

	
								<?php if ($this->_tpl_vars['type'] == 'users'): ?>
<ul class="user-list">
	<?php $_from = $this->_tpl_vars['results']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['u']):
        $this->_foreach['foo']['iteration']++;
?>
<li>
  <div class="thumbnail">
    <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
users/<?php echo $this->_tpl_vars['u']['username']; ?>
" class="avatar" title="<?php echo $this->_tpl_vars['u']['username']; ?>
">
							<?php if ($this->_tpl_vars['u']['avatar'] != ''): ?>  
							  <img alt="<?php echo $this->_tpl_vars['u']['username']; ?>
" height="80" src="<?php echo $this->_tpl_vars['data_server']; ?>
/uploads/users/<?php echo $this->_tpl_vars['u']['user_id']; ?>
/A_<?php echo $this->_tpl_vars['u']['avatar']; ?>
" width="80" />
							<?php else: ?>
								<img alt="<?php echo $this->_tpl_vars['u']['username']; ?>
" height="80" src="<?php echo $this->_tpl_vars['data_server']; ?>
/images/common/default-user.jpg" width="80" />
							<?php endif; ?>
	</a>

  </div>

  <div class="user-info">
    <h3><a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
users/<?php echo $this->_tpl_vars['u']['username']; ?>
"><?php echo $this->_tpl_vars['u']['username']; ?>
</a></h3>
    <ul class="badges">

</ul>

  </div>

  <small class="meta">
    <strong><?php echo $this->_tpl_vars['u']['items']; ?>
</strong> <?php echo $this->_tpl_vars['lang']['items']; ?>
<br>
    <strong><?php echo $this->_tpl_vars['u']['followers']; ?>
</strong> <?php echo $this->_tpl_vars['lang']['followers']; ?>
<br>
    					    <?php echo $this->_tpl_vars['lang']['member_since']; ?>
: <?php echo ((is_array($_tmp=$this->_tpl_vars['u']['register_datetime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%b %Y") : smarty_modifier_date_format($_tmp, "%b %Y")); ?>
<br>
					    <?php if ($this->_tpl_vars['u']['freelance'] == 'true'): ?>
					    	<?php echo $this->_tpl_vars['lang']['available_freelancer']; ?>
<br>
					    <?php endif; ?>
    </small>

  <div class="sale-info">
      <em class="sale-count"><?php echo $this->_tpl_vars['u']['sales']; ?>
</em>
      <small><?php echo $this->_tpl_vars['lang']['sales']; ?>
</small>
    <div class="rating">
							<?php unset($this->_sections['foo1']);
$this->_sections['foo1']['name'] = 'foo1';
$this->_sections['foo1']['start'] = (int)1;
$this->_sections['foo1']['loop'] = is_array($_loop=6) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['foo1']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['foo1']['show'] = true;
$this->_sections['foo1']['max'] = $this->_sections['foo1']['loop'];
if ($this->_sections['foo1']['start'] < 0)
    $this->_sections['foo1']['start'] = max($this->_sections['foo1']['step'] > 0 ? 0 : -1, $this->_sections['foo1']['loop'] + $this->_sections['foo1']['start']);
else
    $this->_sections['foo1']['start'] = min($this->_sections['foo1']['start'], $this->_sections['foo1']['step'] > 0 ? $this->_sections['foo1']['loop'] : $this->_sections['foo1']['loop']-1);
if ($this->_sections['foo1']['show']) {
    $this->_sections['foo1']['total'] = min(ceil(($this->_sections['foo1']['step'] > 0 ? $this->_sections['foo1']['loop'] - $this->_sections['foo1']['start'] : $this->_sections['foo1']['start']+1)/abs($this->_sections['foo1']['step'])), $this->_sections['foo1']['max']);
    if ($this->_sections['foo1']['total'] == 0)
        $this->_sections['foo1']['show'] = false;
} else
    $this->_sections['foo1']['total'] = 0;
if ($this->_sections['foo1']['show']):

            for ($this->_sections['foo1']['index'] = $this->_sections['foo1']['start'], $this->_sections['foo1']['iteration'] = 1;
                 $this->_sections['foo1']['iteration'] <= $this->_sections['foo1']['total'];
                 $this->_sections['foo1']['index'] += $this->_sections['foo1']['step'], $this->_sections['foo1']['iteration']++):
$this->_sections['foo1']['rownum'] = $this->_sections['foo1']['iteration'];
$this->_sections['foo1']['index_prev'] = $this->_sections['foo1']['index'] - $this->_sections['foo1']['step'];
$this->_sections['foo1']['index_next'] = $this->_sections['foo1']['index'] + $this->_sections['foo1']['step'];
$this->_sections['foo1']['first']      = ($this->_sections['foo1']['iteration'] == 1);
$this->_sections['foo1']['last']       = ($this->_sections['foo1']['iteration'] == $this->_sections['foo1']['total']);
?>
								<?php if ($this->_tpl_vars['u']['rating'] >= $this->_sections['foo1']['index']): ?>
						    	<img src="/static/img/star-on.png" alt="" />
							  <?php else: ?>
						    	<img src="/static/img/star-off.png" alt="" />
							  <?php endif; ?>
							<?php endfor; endif; ?>
	 </div>
  </div>
</li>		
<?php endforeach; endif; unset($_from); ?>				
</ul>				
				
				
				
				
				<?php elseif ($this->_tpl_vars['type'] == 'collections'): ?>
<ul class="collection-list">
					<?php $_from = $this->_tpl_vars['results']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['c']):
        $this->_foreach['foo']['iteration']++;
?>
<li class="content-box">
  <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
collections/view/<?php echo $this->_tpl_vars['c']['id']; ?>
/<?php echo ((is_array($_tmp=$this->_tpl_vars['c']['name'])) ? $this->_run_mod_handler('url', true, $_tmp) : smarty_modifier_url($_tmp)); ?>
" class="collection-image">
						  <?php if ($this->_tpl_vars['c']['photo'] != ''): ?>
						  <img alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['c']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" src="<?php echo $this->_tpl_vars['data_server']; ?>
/uploads/collections/<?php echo $this->_tpl_vars['c']['photo']; ?>
" width="260" height="140">
						  <?php else: ?>
						  	<img alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['c']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" src="/static/img/default-collection.jpg" width="260" height="140">
						  <?php endif; ?>  					
   </a>

  <div class="collection-info">
    <h3><a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
collections/view/<?php echo $this->_tpl_vars['c']['id']; ?>
/<?php echo ((is_array($_tmp=$this->_tpl_vars['c']['name'])) ? $this->_run_mod_handler('url', true, $_tmp) : smarty_modifier_url($_tmp)); ?>
"><?php echo $this->_tpl_vars['c']['name']; ?>
</a></h3>
    <span>By <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
users/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
"><?php echo $this->_tpl_vars['users'][$this->_tpl_vars['c']['user_id']]['username']; ?>
</a></span>
    <p><?php echo ((is_array($_tmp=$this->_tpl_vars['c']['text'])) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)); ?>
</p>  
  </div>

  <div class="collection-meta">
    <strong><?php echo $this->_tpl_vars['c']['items']; ?>
 <?php echo $this->_tpl_vars['lang']['items']; ?>
</strong>
    <br>
    
								<?php unset($this->_sections['foo']);
$this->_sections['foo']['name'] = 'foo';
$this->_sections['foo']['start'] = (int)1;
$this->_sections['foo']['loop'] = is_array($_loop=6) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['foo']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['foo']['show'] = true;
$this->_sections['foo']['max'] = $this->_sections['foo']['loop'];
if ($this->_sections['foo']['start'] < 0)
    $this->_sections['foo']['start'] = max($this->_sections['foo']['step'] > 0 ? 0 : -1, $this->_sections['foo']['loop'] + $this->_sections['foo']['start']);
else
    $this->_sections['foo']['start'] = min($this->_sections['foo']['start'], $this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] : $this->_sections['foo']['loop']-1);
if ($this->_sections['foo']['show']) {
    $this->_sections['foo']['total'] = min(ceil(($this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] - $this->_sections['foo']['start'] : $this->_sections['foo']['start']+1)/abs($this->_sections['foo']['step'])), $this->_sections['foo']['max']);
    if ($this->_sections['foo']['total'] == 0)
        $this->_sections['foo']['show'] = false;
} else
    $this->_sections['foo']['total'] = 0;
if ($this->_sections['foo']['show']):

            for ($this->_sections['foo']['index'] = $this->_sections['foo']['start'], $this->_sections['foo']['iteration'] = 1;
                 $this->_sections['foo']['iteration'] <= $this->_sections['foo']['total'];
                 $this->_sections['foo']['index'] += $this->_sections['foo']['step'], $this->_sections['foo']['iteration']++):
$this->_sections['foo']['rownum'] = $this->_sections['foo']['iteration'];
$this->_sections['foo']['index_prev'] = $this->_sections['foo']['index'] - $this->_sections['foo']['step'];
$this->_sections['foo']['index_next'] = $this->_sections['foo']['index'] + $this->_sections['foo']['step'];
$this->_sections['foo']['first']      = ($this->_sections['foo']['iteration'] == 1);
$this->_sections['foo']['last']       = ($this->_sections['foo']['iteration'] == $this->_sections['foo']['total']);
?>
								  <?php if ($this->_tpl_vars['c']['rating'] >= $this->_sections['foo']['index']): ?>
							    	<img src="/static/img/star-on.png" alt="" />
								  <?php else: ?>
							    	<img src="/static/img/star-off.png" alt="" />
								  <?php endif; ?>
								<?php endfor; endif; ?>
							  														
	<br><small><?php echo $this->_tpl_vars['c']['votes']; ?>
 ratings</small>
  </div>
</li>
<?php endforeach; endif; unset($_from); ?>				
</ul>				

				<?php else: ?>

    <ul class="item-list">
	<?php $_from = $this->_tpl_vars['results']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['i']):
        $this->_foreach['foo']['iteration']++;
?>
      <li class="source">

  <div class="thumbnail">
    <a href="/<?php echo $this->_tpl_vars['langaugeURL']; ?>
items/<?php echo $this->_tpl_vars['i']['id']; ?>
/<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('url', true, $_tmp) : smarty_modifier_url($_tmp)); ?>
.html" onclick="">

          <img alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" border="0" class="landscape-image-magnifier preload no_preview" data-item-author="توسط <?php echo $this->_tpl_vars['users'][$this->_tpl_vars['i']['user_id']]['username']; ?>
" data-item-category="<?php $_from = $this->_tpl_vars['i']['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['e']):
?><?php $_from = $this->_tpl_vars['e']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['c']):
        $this->_foreach['foo']['iteration']++;
?><?php echo $this->_tpl_vars['categories'][$this->_tpl_vars['c']]['name']; ?>
 <?php if (! ($this->_foreach['foo']['iteration'] == $this->_foreach['foo']['total'])): ?> \ <?php endif; ?><?php endforeach; endif; unset($_from); ?><?php endforeach; endif; unset($_from); ?>" data-item-cost="<?php echo $this->_tpl_vars['i']['price']; ?>
 <?php echo $this->_tpl_vars['currency']['symbol']; ?>
" data-item-name="<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" data-preview-height="" data-preview-url="<?php echo $this->_tpl_vars['data_server']; ?>
/uploads/items/<?php echo $this->_tpl_vars['i']['id']; ?>
/preview.jpg" data-preview-width="" height="80" src="<?php echo $this->_tpl_vars['data_server']; ?>
/uploads/items/<?php echo $this->_tpl_vars['i']['id']; ?>
/<?php echo $this->_tpl_vars['i']['thumbnail']; ?>
" title="<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" width="80" />
    </a>  
   </div>

  <div class="item-info">
    <h3>
      <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
items/<?php echo $this->_tpl_vars['i']['id']; ?>
/<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['name'])) ? $this->_run_mod_handler('url', true, $_tmp) : smarty_modifier_url($_tmp)); ?>
.html"><?php echo $this->_tpl_vars['i']['name']; ?>
</a>
    </h3>

    <span class="author">توسط</span> <a href="/<?php echo $this->_tpl_vars['languageURL']; ?>
users/<?php echo $this->_tpl_vars['users'][$this->_tpl_vars['i']['user_id']]['username']; ?>
/" class="author"><?php echo $this->_tpl_vars['users'][$this->_tpl_vars['i']['user_id']]['username']; ?>
</a>

      </div>

  <small class="meta"><span class="meta-categories"> </span><br /></small>

  <div class="sale-info">
    <small class="sale-count"><?php echo $this->_tpl_vars['i']['sales']; ?>
 <?php echo $this->_tpl_vars['lang']['sales']; ?>
</small>
    <small class="price"><?php echo $this->_tpl_vars['i']['price']; ?>
 <?php echo $this->_tpl_vars['currency']['symbol']; ?>
</small>
    <div class="rating">
		<?php unset($this->_sections['foo']);
$this->_sections['foo']['name'] = 'foo';
$this->_sections['foo']['start'] = (int)1;
$this->_sections['foo']['loop'] = is_array($_loop=6) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['foo']['step'] = ((int)1) == 0 ? 1 : (int)1;
$this->_sections['foo']['show'] = true;
$this->_sections['foo']['max'] = $this->_sections['foo']['loop'];
if ($this->_sections['foo']['start'] < 0)
    $this->_sections['foo']['start'] = max($this->_sections['foo']['step'] > 0 ? 0 : -1, $this->_sections['foo']['loop'] + $this->_sections['foo']['start']);
else
    $this->_sections['foo']['start'] = min($this->_sections['foo']['start'], $this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] : $this->_sections['foo']['loop']-1);
if ($this->_sections['foo']['show']) {
    $this->_sections['foo']['total'] = min(ceil(($this->_sections['foo']['step'] > 0 ? $this->_sections['foo']['loop'] - $this->_sections['foo']['start'] : $this->_sections['foo']['start']+1)/abs($this->_sections['foo']['step'])), $this->_sections['foo']['max']);
    if ($this->_sections['foo']['total'] == 0)
        $this->_sections['foo']['show'] = false;
} else
    $this->_sections['foo']['total'] = 0;
if ($this->_sections['foo']['show']):

            for ($this->_sections['foo']['index'] = $this->_sections['foo']['start'], $this->_sections['foo']['iteration'] = 1;
                 $this->_sections['foo']['iteration'] <= $this->_sections['foo']['total'];
                 $this->_sections['foo']['index'] += $this->_sections['foo']['step'], $this->_sections['foo']['iteration']++):
$this->_sections['foo']['rownum'] = $this->_sections['foo']['iteration'];
$this->_sections['foo']['index_prev'] = $this->_sections['foo']['index'] - $this->_sections['foo']['step'];
$this->_sections['foo']['index_next'] = $this->_sections['foo']['index'] + $this->_sections['foo']['step'];
$this->_sections['foo']['first']      = ($this->_sections['foo']['iteration'] == 1);
$this->_sections['foo']['last']       = ($this->_sections['foo']['iteration'] == $this->_sections['foo']['total']);
?>
							  <?php if ($this->_tpl_vars['i']['rating'] >= $this->_sections['foo']['index']): ?>
						    	<img src="/static/img/star-on.png" alt="" />
							  <?php else: ?>
						    	<img src="/static/img/star-off.png" alt="" />
							  <?php endif; ?>
		<?php endfor; endif; ?>
    </div>

   </div>
</li>
<?php endforeach; endif; unset($_from); ?>
    </ul>
	
<?php endif; ?>	
	<div class="pagination"><?php echo $this->_tpl_vars['paging']; ?>
</div>
		<?php else: ?>
			<div class="content-box vertical-space"><?php echo $this->_tpl_vars['lang']['no_results_found']; ?>
</div>
			<?php endif; ?>
    </div>

</div>
	

<div class="sidebar-s sidebar-right">
    <h2 class="box-heading">جستجوی شما</h2>
    <div class="content-box">
      <p style="font-family:BBCNassim;font-size:18px;">نتایج این جستجو</p>

      <form class="sidebar-search" action="/<?php echo $this->_tpl_vars['languageURL']; ?>
search/" method="get">
	  <input type="text" onclick="this.value = &quot;&quot;" type="text" value="<?php echo $this->_tpl_vars['lang']['search_within']; ?>
"></input>
	  
					  <input id="type" name="type" type="hidden" value="<?php echo $this->_tpl_vars['type']; ?>
" />
					  <input id="category" name="category" type="hidden" value="" />
					  <input id="base" name="base" type="hidden" value="<?php echo ((is_array($_tmp=$_GET['term'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
					  <input id="collection_id" name="collection_id" type="hidden" value="<?php echo $_GET['collection_id']; ?>
" />
					  <?php if (isset ( $_GET['categories'] ) && is_array ( $_GET['categories'] )): ?>
					  	<?php $_from = $_GET['categories']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['c']):
?>
					  		<input type="hidden" name="categories[<?php echo $this->_tpl_vars['k']; ?>
]" value="1" />
					  	<?php endforeach; endif; unset($_from); ?>
					  <?php endif; ?>
 <button type="submit" class="image-button search no-margin">Search</button>
</form>

    </div>
</div>

<script>
<?php echo '
  marketplace.queue( function(){
    marketplace.initializers.itemList({
      ajaxPagination: true,
      layoutSwitcher: true
    });
  });'; ?>

</script>

      </div>
    </div>