Файл: modules/video/history.php
Строк: 57
<?php
require_once '../../incfiles/core.php';
require_once '../../incfiles/func.php';
require_once '../../incfiles/auth.php';
require_once '../../incfiles/user.php';
if (!$user_id) {header('location: /'); exit;}
$title = ''.lang('История просмотров','Історія переглядів');
require_once '../../incfiles/head.php';
echo '<div class="title">
<a href="'.URL.'/video/?id='.$user_id.'" onclick="Page.Go(this.href); return false">'.$user['name'].' '.$user['surname'].'</a>
<a class="title_a_hover" href="'.URL.'/modules/video/add.php" onclick="Page.Go(this.href); return false">'.lang('Добавить видео c','Додати відео з').' youtube</a>
<a class="title_a_hover" href="'.URL.'/modules/video/history.php" onclick="Page.Go(this.href); return false">'.lang('История просмотров','Історія переглядів').'</a>
<a class="title_a_hover" href="'.URL.'/modules/video/cat.php" onclick="Page.Go(this.href); return false">'.lang('Каталог','Каталог').'</a>
<a class="title_a_hover" href="'.URL.'/modules/video/top_video.php" onclick="Page.Go(this.href); return false">'.lang('TOP: «Нам нравится»','TOP: «Нам подобається»').'</a>
</div>';
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `video_view` WHERE `user_id` = '".$user_id."'"),0);
if ($all > 0)
{
$cp = ceil($all/27);
$p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp) ? $_GET['p'] : 1;
$start = $p*27-27;
$res = mysql_query("SELECT * FROM `video_view` WHERE `user_id` = '".$user_id."' ORDER by `time` DESC LIMIT $start,27");
while ($arr = mysql_fetch_array($res)){
$arr_video = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` = '".$arr['v_id']."' LIMIT 1"));
$name = no_tags($arr_video['name']);
$name = substr($name, 0, 45);
$name = rtrim($name, "!,.-");
if($arr_video['type']==0 || $arr_video['type']==2)
{
if(is_file(HOME .''.$arr_video['img'].''))$img =''.URL.''.$arr_video['img'].'';
else
$img =''.URL.'/design/img/video404.jpg';
}
elseif($arr_video['type']==1)
{
$img ='https://i.ytimg.com/vi/'.$arr_video['file'].'/mqdefault.jpg';
}else $img =''.URL.'/desing/img/video404.jpg';
//echo '<a href="'.URL.'/video/'.$arr['id'].'" onclick="Page.Go(this.href); return false;"><img class="preview_mini" src="'.$img.'"></a>';
//if (empty($_COOKIE['site_version']) || $_COOKIE['site_version'] == 'default')
echo '<div class="video"><a href="'.URL.'/video/'.$arr_video['id'].'" onclick="Page.Go(this.href); return false;"><div class="video_block"><img src="'.$img.'"/><div class="video_title">'.$name.'</div></div></a></div>';
//else
//echo '<a href="'.URL.'/video/'.$arr['id'].'" onclick="Page.Go(this.href); return false;"><img class="preview_mini" src="'.$img.'"></a>';
}
navi($p,$cp,'/modules/video/history.php?');
}
require_once '../../incfiles/foot.php';
?>