Файл: adultscript-2.0.3-pro/files/modules/categories/categories.php
Строк: 26
<?php
defined('_VALID') or die('Restricted Access!');
class VModule_categories
{
public function __construct()
{
}
public function render()
{
VLanguage::load('frontend.categories');
$db = VF::factory('database');
$tpl = VF::factory('template');
$order = (isset($_GET['o'])) ? trim($_GET['o']) : 'name';
if ($order == 'name') {
$tpl->title = __('categories-title');
$tpl->meta_title = __('categories-meta-title', array('', VF::cfg_item('site_name')));
$tpl->meta_desc = __('categories-meta-desc', array('', VF::cfg_item('meta_desc')));
$sort = 'slug, parent_id ASC';
} elseif ($order == 'popular') {
$tpl->title = __('categories-title-popular');
$tpl->meta_title = __('categories-meta-title', array(__('popular'), VF::cfg_item('site_name')));
$tpl->meta_desc = __('categories-meta-desc', array(__('popular'), VF::cfg_item('meta_desc')));
$sort = 'total_videos DESC';
} elseif ($order == 'videos') {
$tpl->title = __('categories-title-videos');
$tpl->meta_title = __('categories-meta-title-videos', array(VF::cfg_item('site_name')));
$tpl->meta_desc = __('categories-meta-desc-videos', array(VF::cfg_item('meta_desc')));
$sort = 'total_videos DESC';
} else {
VModule::load('404', true);
}
$db->query("SELECT cat_id, parent_id, name, slug, description, total_videos
FROM #__video_categories
WHERE status = '1'
AND parent_id = 0
ORDER BY ".$sort);
$categories = $db->fetch_rows();
$tpl->menu = 'categories';
$tpl->meta_keys = __('categories-meta-keys', array(VF::cfg_item('meta_keys')));
$tpl->canonical = BASE_URL.'/categories/';
$tpl->canonicalm = MOBILE_URL.'/categories/';
$tpl->order = $order;
$tpl->categories = $categories;
$tpl->load(array('header', 'categories', 'footer'));
$tpl->display();
}
}