<?php if (!empty($tpl['category']['stats']) || !empty($tpl['category']['tags']) || !empty($tpl['links']) || !empty($tpl['users_online']) || !empty($tpl['random_item'])) : ?>
<div id="bottom">
<?php if (!empty($tpl['category']['stats'])) : ?>
	<div id="bottom_stats">
		<h3><?php echo __('Statistiques'); ?></h3>
		<ul>
<?php foreach ($tpl['category']['stats'] as $name => &$i) : ?>
			<li<?php if ($name == 'rating') : ?> class="rating" title="<?php echo $i['text']; ?>"<?php endif; ?>><?php if ($name == 'rating') : ?><?php foreach ($i['array'] as $k => $v) : ?><span><?php if ($v == 1) : ?>&#xe9d9;<?php elseif ($v == 0) : ?>&#xe9d7;<?php else : ?>&#xe9d8;<?php endif; ?></span><?php endforeach; ?><?php elseif ($i['link']) : ?><a href="<?php echo $i['link']; ?>#content"><?php echo $i['text']; ?></a><?php if ($name == 'comments') : ?> <a class="icon" href="<?php echo $i['link_comments']; ?>#content" title="<?php echo __('Afficher les commentaires'); ?>">&#xe932;</a><?php endif; ?><?php else : ?><?php echo $i['text']; ?><?php endif; ?></li>
<?php endforeach; ?>
		</ul>
	</div>
<?php endif; ?>
<?php if (!empty($tpl['category']['tags'])) : ?>
	<div id="bottom_tags">
		<h3><?php echo substr($_GET['filter'] ?? '', 0, 3) == 'tag' ? __('Tags combinés') : __('Tags'); ?></h3>
		<div id="cat_tags">
			<ul>
<?php foreach ($tpl['category']['tags'] as &$i) : ?>
				<li class="w<?php echo $i['weight']; ?>"><a title="<?php echo $i['text']; ?>" href="<?php echo $i['link']; ?>#content"><span><?php echo $i['name']; ?></span></a></li>
<?php endforeach; ?>
			</ul>
		</div>
		<a href="<?php echo $tpl['category']['tags_link']; ?>"><?php echo __('Tous les tags'); ?></a>
	</div>
<?php endif; ?>
<?php if (!empty($tpl['links'])) : ?>
	<div id="bottom_links">
		<h3><?php echo __('Liens'); ?></h3>
		<div>
			<ul>
<?php foreach ($tpl['links'] as &$i) : ?>
<?php if ($i['title'] !== NULL) : ?>
				<li><a href="<?php echo $i['url']; ?>"<?php if ($i['desc']) : ?> title="<?php echo $i['desc']; ?>"<?php endif; ?>><?php echo $i['title']; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
			</ul>
		</div>
	</div>
<?php endif; ?>
<?php if (!empty($tpl['users_online'])) : ?>
	<div id="bottom_online">
		<h3><?php echo __('En ligne'); ?></h3>
		<div>
			<ul>
<?php foreach ($tpl['users_online'] as &$i) : ?>
				<li><a title="<?php echo $i['last_visite']; ?>" href="<?php echo $i['link']; ?>"><?php echo $i['nickname']; ?></a></li>
<?php endforeach; ?>
			</ul>
		</div>
	</div>
<?php endif; ?>
<?php if (!empty($tpl['random_item'])) : ?>
	<div id="bottom_random">
		<h3><?php echo __('Au hasard'); ?></h3>
		<div class="thumbs_items <?php echo $thumbs_items_layout; ?><?php if ($tpl['selection_params']['start']) : ?> selectable<?php endif; ?>">
<?php foreach ($tpl['random_item'] as &$i) : ?>
			<dl class="<?php if ($i['is_video']) : ?> video<?php endif; ?><?php if ($i['in_selection']) : ?> selected<?php endif; ?>" data-id="<?php echo $i['id']; ?>">
				<dt>
					<a href="<?php echo $i['link_item']; ?>#content">
<?php if ($i['is_recent']) : ?>
						<span class="new"><?php echo __('Nouveau'); ?></span>
<?php endif; ?>
<?php if ($i['is_video']) : ?>
						<span class="duration" id="videoduration_<?php echo $i['id']; ?>"><?php echo $i['duration_text']; ?></span>
<?php endif; ?>
						<img alt="<?php echo $i['title']; ?>" src="<?php echo $i['thumb_src']($thumbs_items_size); ?>"<?php if ($i['is_video']) : ?> data-video-id="<?php echo $i['id']; ?>"<?php endif; ?>>
<?php if ($i['stats']['views'] || $i['stats']['comments'] || $i['stats']['votes'] || $i['stats']['favorites']) : ?>
						<ul class="stats_icon">
<?php if ($i['stats']['views']) : ?>
							<li class="views"><span><?php echo $i['stats']['views']['short']; ?></span><span>&#xe907;</span></li>
<?php endif; ?>
<?php if ($i['stats']['comments']) : ?>
							<li class="comments"><span><?php echo $i['stats']['comments']['short']; ?></span><span>&#xe932;</span></li>
<?php endif; ?>
<?php if ($i['stats']['votes']) : ?>
							<li class="votes"><span><?php echo $i['stats']['votes']['short']; ?></span><span>&#xe9d9;</span></li>
<?php endif; ?>
<?php if ($i['stats']['favorites']) : ?>
							<li class="favorites"><span><?php echo $i['stats']['favorites']['short']; ?></span><span>&#xe910;</span></li>
<?php endif; ?>
						</ul>
<?php endif; ?>
					</a>
				</dt>
<?php if ($i['title'] !== '') : ?>
				<dd>
					<span class="title"><a tabindex="-1" href="<?php echo $i['link_item']; ?>"><?php echo $i['title']; ?></a></span>
				</dd>
<?php endif; ?>
			</dl>
<?php endforeach; ?>
		</div>
	</div>
<?php endif; ?>
</div>
<?php endif; ?>