Файл: adultscript-2.0.3-pro/files/modules/user/components/history.php
Строк: 33
<?php
defined('_VALID') or die('Restricted Access!');
class VComponent_user_history extends VModule_user
{
public function __construct()
{
parent::__construct();
}
public function render()
{
VAuth::check('Registered');
$user_id = (int) $_SESSION['user_id'];
$page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1;
$sql_count = "SELECT video_id AS total_videos
FROM #__video_history
WHERE user_id = ".$user_id;
$total_videos = $this->db->get_field($sql_count, 'total_videos');
$pagination = VPagination::get($page, $total_videos, 20);
$sql = "SELECT vh.video_id, vh.view_time, v.title, v.slug, v.rating, v.rated_by, v.likes,
v.hd, v.thumb, v.thumbs, v.duration, v.total_views, v.add_time
FROM #__video_history AS vh
LEFT JOIN #__video AS v ON (v.video_id = vh.video_id AND v.status = 1)
WHERE vh.user_id = ".$user_id."
ORDER BY vh.view_time DESC
LIMIT ".$pagination['limit'];
$videos = $this->db->get_rows($sql);
$this->tpl->menu = 'home';
$this->tpl->colmenu = 'manage';
$this->tpl->submenu = 'user-history';
$this->tpl->title = e(__('my-view-history'));
$this->tpl->meta_title = __('my-view-history');
$this->tpl->videos = $videos;
$this->tpl->pagination = $pagination;
$this->tpl->load(array('header', 'user_videos', 'footer'));
$this->tpl->display();
}
}