Файл: adultscript-2.0.3-pro/files/templates/defboot/extend/widgets/categories_popular.widget.php
Строк: 19
<?php
defined('_VALID') or die('Restricted Access!');
function template_widget_categories_popular()
{
$db = VF::factory('database');
$db->query("SELECT cat_id, name, slug, total_videos
FROM #__video_categories
ORDER BY total_videos DESC
LIMIT 5");
if (!$db->affected_rows()) {
return;
}
$categories = $db->fetch_rows();
$output = array();
$output[] = '<div class="panel panel-default">';
$output[] = '<div class="panel-heading">';
$output[] = '<h3 class="panel-title">'.__('popular-categories').'</h3>';
$output[] = '</div>';
$output[] = '<div class="panel-body">';
$output[] = '<ul class="categories">';
foreach ($categories as $category) {
$output[] = '<li id="category-'.$category['cat_id'].'">';
$output[] = '<div class="category">';
$output[] = '<a href="'.REL_URL.'/'.$category['slug'].'/" class="thumbnail">';
$output[] = '<img src="'.MEDIA_REL.'/videos/cat/'.$category['cat_id'].'.jpg" alt="'.e($category['name']).'">';
$output[] = '<div class="category-title">'.e($category['name']).'</div>';
$output[] = '<div class="category-overlay badge transparent"><i class="fa fa-video-camera"></i> '.$category['total_videos'];
$output[] = '</div>';
$output[] = '</a>';
$output[] = '</div>';
$output[] = '</li>';
}
$output[] = '</ul>';
$output[] = '</div>';
$output[] = '</div>';
return implode("n", $output);
}
?>