Вход Регистрация
Файл: adultscript-2.0.3-pro/files/mobile/components/kb_article.php
Строк: 29
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_mobile_kb_article extends VComponent_mobile_kb
{
    public function 
__construct()
    {
        
parent::__construct();
    }
    
    public function 
render()
    {
        
$id = (VUri::request(1)) ? (int) VUri::request(1) : 0;
        if (!
$article $this->cache->get('article_'.$id86400)) {
            
$this->db->query("SELECT kb_title, kb_content
                              FROM #__kb
                              WHERE kb_id = "
.$id."
                              AND status = '1'
                              LIMIT 1"
);
            if (!
$this->db->affected_rows()) {
                  
$this->notfound();
            }

            
$article $this->db->fetch_assoc();
            
$this->cache->store('article_'.$id86400);
        }

        if (!
VUri::match('kb/'.$id.'/')) {
              
$this->notfound();
        }

        if (!
VBrowser::get('is_robot')) {
            
$this->db->query("
                UPDATE #__kb
                SET total_views = total_views+1
                WHERE kb_id = "
.$id."
                LIMIT 1
            "
);
        }
        
        
VLanguage::load('frontend.kb');
    
        
$this->tpl->menu        'kb';

        
$this->tpl->meta_title  $article['kb_title'].' - '.$this->mcfg['site_name'];
        
$this->tpl->meta_desc   $article['kb_title'].'. '.$this->mcfg['meta_desc'];

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

        
$this->tpl->article        $article;

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