Вход Регистрация
Файл: adultscript-2.0.3-pro/files/mobile/components/kb_category.php
Строк: 28
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_mobile_kb_category extends VComponent_mobile_kb
{
    public function 
__construct()
    {
        
parent::__construct();
    }
    
    public function 
render()
    {
        
$slug    VUri::request(1);
        if (!
VUri::match('kb/'.$slug.'/')) {
            
$this->notfound();
        }
        
        
$this->db->query("SELECT cat_id, name
                          FROM #__kb_categories
                          WHERE slug = '"
.$this->db->escape($slug)."'
                          LIMIT 1"
);
        if (!
$this->db->affected_rows()) {
              
$this->notfound();
          }
        
        
$category    $this->db->fetch_assoc();
        
        
$this->db->query("
            SELECT kb_id, kb_title, total_views
            FROM #__kb
            WHERE cat_id = "
.(int) $category['cat_id']."
            AND status = '1'
            ORDER BY kb_title ASC
            LIMIT 10
        "
);
            
        
$articles   $this->db->fetch_rows();
        
        
VLanguage::load('frontend.kb');
    
        
$this->tpl->menu        'kb';

        
$this->tpl->meta_title  __('article-meta-title').' - '.$this->mcfg['site_name'];

        
$this->tpl->canonical   BASE_URL.'/kb/'.$slug.'/';

        
$this->tpl->category    $category;
        
$this->tpl->articles       $articles;
        
$this->tpl->categories    $this->get_kb_categories();

        
$this->tpl->load(array('header''kb_category''footer'));
        
$this->tpl->display();
    }
}
Онлайн: 2
Реклама