Файл: adultscript-2.0.3-pro/files/mobile/components/community.php
Строк: 45
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_mobile_community extends VMobile
{
public function __construct()
{
parent::__construct();
}
public function render()
{
$errors = array();
$messages = array();
$sql_add = NULL;
if (isset($_GET['username'])) {
$username = VF::factory('filter')->get('username', 'STRING', 'GET');
if (!empty($username)) {
$sql_add .= " AND username LIKE '".$this->db->escape($username)."%'";
}
}
$page = (isset($_GET['page'])) ? (int) trim($_GET['page']) : 1;
$this->db->query("SELECT COUNT(*) AS total_users
FROM #__user
WHERE status = '1'".$sql_add);
$total_users = $this->db->fetch_field('total_users');
$pagination = VPagination::get($page, $total_users, 20);
$this->db->query("SELECT user_id, username, gender, avatar, online
FROM #__user
WHERE status = '1'".$sql_add."
ORDER BY online DESC
LIMIT ".$pagination['limit']);
$users = $this->db->fetch_rows();
$this->tpl->menu = 'community';
$this->tpl->title = __('community-title');
$this->tpl->meta_title = __('community-title');
$this->tpl->meta_desc = $this->mcfg['meta_desc'];
$this->tpl->meta_keys = $this->mcfg['meta_keys'];
$this->tpl->canonical = BASE_URL.'/community/';
$this->tpl->errors = $errors;
$this->tpl->messages = $messages;
$this->tpl->users = $users;
$this->tpl->pagination = $pagination;
$this->tpl->load(array('header', 'community', 'footer'));
$this->tpl->display();
}
}