Файл: adultscript-2.0.3-pro/files/mobile/components/user_videos.php
Строк: 38
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_mobile_user_videos 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_videos
FROM #__video
WHERE user_id = ".$user_id."
AND status = 1";
$total_videos = $this->db->get_field($sql_count, 'total_videos');
$pagination = VPagination::get($page, $total_videos, $this->mcfg['videos_per_page']);
$sql = "SELECT v.video_id, v.title, v.slug, v.description, v.thumb, v.rating, v.rated_by, v.total_views, v.duration
FROM #__video AS v
WHERE v.user_id = ".$user_id."
AND v.status = 1
ORDER BY v.add_time DESC
LIMIT ".$pagination['limit'];
$videos = $this->db->get_rows($sql);
$this->tpl->menu = 'community';
$this->tpl->submenu = 'videos';
$this->tpl->title = __('videos-title');
$this->tpl->canonical = BASE_URL.'/user/videos/';
$this->tpl->videos = $videos;
$this->tpl->pagination = $pagination;
$this->tpl->load(array('header', 'user_videos', 'footer'));
$this->tpl->display();
}
}