Файл: adultscript-2.0.3-pro/files/mobile/components/users_connections.php
Строк: 62
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_mobile_users_connections 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.'/connections/';
        if ($page !== 1) {
            $url .= $page.'/';
        }
        if (!VUri::match($url)) {
            $this->notfound();
        }
        $this->update_views($user_id);
        if ($this->show($this->user['show_friends'])) {
            if ($this->tpl->total_friends = $this->get_friends_count($user_id)) {
                $this->tpl->friends = $this->get_friends($user_id, 2);
            }
        }
        
        if ($this->show($this->user['show_subscribers'])) {
            if ($this->tpl->total_subscribers = $this->get_subscribers_count($user_id)) {
                $this->tpl->subscribers = $this->get_subscribers($user_id, 2);
            }
        }
        
        if ($this->show($this->user['show_subscriptions'])) {
            if ($this->tpl->total_subscriptions = $this->get_subscriptions_count($user_id)) {
                $this->tpl->subscriptions = $this->get_subscriptions($user_id, 2);
            }
        }
        
        $this->tpl->menu            = 'community';
        $this->tpl->submenu            = 'profile';
        $this->tpl->meta_title      = __('connections-meta-title', array($this->user['username'], $this->tpl->mcfg['site_name']));
        $this->tpl->meta_desc       = __('connections-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->load(array('header', 'users_connections', 'footer'));
        $this->tpl->display();    
    }
}