Вход Регистрация
Файл: adultscript-2.0.3-pro/files/mobile/components/news_view.php
Строк: 56
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_mobile_news_view extends VComponent_mobile_news
{
    public function 
__construct()
    {
        
parent::__construct();
    }
    
    public function 
render()
    {
        
$slug   VUri::request(1);
        if (!
VValid::aldash($slug)) {
            
$this->notfound();
        }    
    
        
VLanguage::load('frontend.news');

        
$this->db->query("SELECT n.news_id, n.user_id, n.title, n.slug, n.content,
                                 n.total_views, n.add_date, u.username,
                                 n.meta_title, n.meta_desc, n.meta_keys
                          FROM #__news AS n
                          INNER JOIN #__user AS u ON (u.user_id = n.user_id)
                          WHERE n.slug = '"
.$this->db->escape($slug)."'
                          AND n.status = '1'
                          LIMIT 1"
);
        if (!
$this->db->affected_rows()) {
            
$this->notfound();
        }

        
$article    $this->db->fetch_assoc();
        
$news_id    = (int) $article['news_id'];

        if (!
VBrowser::get('is_robot')) {
              
$this->db->query("UPDATE #__news
                              SET total_views = total_views+1
                              WHERE news_id = "
.$news_id."
                              LIMIT 1"
);
        }
    
        
$this->tpl->menu        'news';

        
$this->tpl->meta_title  $article['meta_title'];
        
$this->tpl->meta_desc   $article['meta_desc'];
        
$this->tpl->meta_keys    $article['meta_keys']; 

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

        
$this->tpl->article        $article;

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