Вход Регистрация
Файл: adultscript-2.0.3-pro/files/mobile/components/users_subscribers.php
Строк: 52
<?php
defined
('_VALID') or die('Restricted Access!');
class 
VComponent_mobile_users_subscribers extends VComponent_mobile_users
{
    public function 
__construct()
    {
        
parent::__construct(true);
    }

    public function 
render()
    {
        
$errors        = array();
        
$messages    = array();
        
        
$user_id    = (int) $this->user['user_id'];
        
$page        = (VUri::request(3)) ? (int) VUri::request(3) : 1;
        
        
$url    'users/'.$this->username.'/subscribers/';
        if (
$page !== 1) {
            
$url .= $page.'/';
        }

        if (!
VUri::match($url)) {
              
$this->notfound();
        }        
        
        
$this->update_views($user_id);
        
        
$sql_count          "SELECT COUNT(*) AS total_subscribers
                               FROM #__user_subscriptions
                               WHERE user_id = "
.$user_id;
        
$total_subscribers  $this->db->get_field($sql_count'total_subscribers');
        
$pagination         VPagination::get($page$total_subscribers30);
        
$sql                "SELECT u.user_id, u.username, u.gender, u.avatar, u.online
                               FROM #__user_subscriptions AS us
                               INNER JOIN #__user AS u ON (u.user_id = us.subscriber_id)
                               WHERE us.user_id = "
.$user_id."
                               ORDER BY us.add_date DESC
                               LIMIT "
.$pagination['limit'];
        if (!
$subscribers $this->cache->get($sql3600)) {
            
$this->db->query($sql);
            if (
$this->db->affected_rows()) {
                
$subscribers    $this->db->fetch_rows($sql);
                
$this->cache->store($sql$subscribers3600);
            } else {
                
$subscribers    = array();
            }
        }        
        
        
$this->tpl->menu            'community';
        
$this->tpl->submenu            'subscribers';

        
$this->tpl->meta_title      __('subscribers-meta-title', array($this->user['username'], $this->tpl->mcfg['site_name']));
        
$this->tpl->meta_desc       __('subscribers-meta-desc', array($this->user['username'], $this->tpl->mcfg['meta_desc']));
        
$this->tpl->meta_keys       $this->mcfg['meta_keys'];

        
$this->tpl->canonical       BASE_URL.'/'.$url;

        
$this->tpl->errors          $errors;
        
$this->tpl->messages        $messages;    
        
$this->tpl->user            $this->user;
        
$this->tpl->username          e($this->user['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->users            $subscribers;
        
$this->tpl->pagination        $pagination;       
        
$this->tpl->load(array('header''users_subscribers''footer'));
        
$this->tpl->display();    
    }
}
Онлайн: 2
Реклама