Файл: adultscript-2.0.3-pro/files/mobile/components/user_albums.php
Строк: 36
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_mobile_user_albums extends VComponent_mobile_user
{
public function __construct()
{
parent::__construct();
}
public function render()
{
VAuth::check('Registered', MOBILE_URL.'/user/login/');
$user_id = (int) $_SESSION['user_id'];
$page = (isset($_GET['page'])) ? (int) trim($_GET['page']) : 1;
$sql_count = "SELECT COUNT(*) AS total_albums
FROM #__photo_albums
WHERE user_id = ".$user_id;
$total_albums = $this->db->get_field($sql_count, 'total_albums');
$pagination = VPagination::get($page, $total_albums, 6);
$sql = "SELECT a.album_id, a.title, a.slug, a.total_views, a.rating,
a.rated_by, a.total_photos, a.add_time
FROM #__photo_albums AS a
WHERE a.user_id = ".$user_id."
AND a.status = '1'
ORDER BY a.album_id DESC
LIMIT ".$pagination['limit'];
$albums = $this->db->get_rows($sql);
$this->tpl->menu = 'community';
$this->tpl->submenu = 'albums';
$this->tpl->title = __('albums-title');
$this->tpl->canonical = BASE_URL.'/user/albums/';
$this->tpl->albums = $albums;
$this->tpl->pagination = $pagination;
$this->tpl->load(array('header', 'user_albums', 'footer'));
$this->tpl->display();
}
}