Вход Регистрация
Файл: adultscript-2.0.3-pro/files/modules/profile/components/comments.php
Строк: 71
<?php
class VComponent_profile_comments extends VModule_profile
{
    public function 
__construct()
    {
        
parent::__construct();
    }
    
    public function 
render()
    {
        if (!
VUri::match('users/'.$this->username.'/comments/')) {
            
VModule::load('404'true);
        }
        
        if (!
$this->profile($this->username)) {
            return 
false;
        }
        
        
VLanguage::load('frontend.global');
        
VLanguage::load('frontend.profile');
        
        
$user_id        $this->user['user_id'];
        
$page           = (isset($_GET['page'])) ? (int) $_GET['page'] : 1;
        
$sql_count      "SELECT COUNT(*) AS total_comments
                           FROM #__user_comments
                           WHERE user_id= "
.$user_id."
                           AND status = '1'"
;
        
$total_comments $this->db->get_field($sql_count'total_comments');
        
$pagination     VPagination::get($page$total_comments10);
        
$sql            "SELECT uc.comment_id, uc.parent_id, uc.user_id, uc.poster_id, uc.comment,
                                  uc.add_time, uc.likes, uc.rated_by, u.username, u.gender, u.avatar
                           FROM #__user_comments AS uc
                           LEFT JOIN #__user AS u ON (u.user_id = uc.poster_id)
                           WHERE uc.user_id = "
.$user_id."
                           AND uc.status = '1'
                           ORDER BY uc.comment_id DESC
                           LIMIT "
.$pagination['limit'];
        if (!
$comments $this->cache->get($sql3600)) {
            
$this->db->query($sql);
            if (
$this->db->affected_rows()) {
                
$comments $this->db->fetch_rows();
                
$this->cache->store($sql$comments3600);
            } else {
                
$comments = array();
            }
        }        
        
        
$this->tpl->menu              'community';
        
$this->tpl->submenu           'comments';
        
        
$this->tpl->meta_title        __('comments-meta-title', array($this->usernameVF::cfg_item('site_name')));
        
$this->tpl->meta_desc        __('comments-meta-desc', array($this->usernameVF::cfg_item('site_name')));
        
        
$this->tpl->user              $this->user;
        
$this->tpl->username          e($this->username);
        
$this->tpl->is_subscribed     $this->is_subscribed;
        
$this->tpl->is_friend         $this->is_friend;
        
$this->tpl->is_self           $this->is_self;
        
$this->tpl->is_moderator      $this->is_moderator;
        
$this->tpl->is_loggedin       $this->is_loggedin;
        
$this->tpl->is_blocked        $this->is_blocked;
        
$this->tpl->comments        $comments;
        
$this->tpl->pagination        $pagination;
        
$this->tpl->load(array('header''profile_comments''footer'));
        
$this->tpl->display();
    }
}
Онлайн: 3
Реклама