Файл: EROCMS 11.2 ДЛЯ ADULT/Script/pages/video.php
Строк: 153
<?php
$view = $mysqli -> query("select * from ero_files where translit = '".mysqli_real_escape_string($mysqli, filter($_GET['translit']))."'") -> fetch_assoc();
if (!$view){
header('location: /');
exit;
}
$category = $mysqli -> query("select * from ero_categories where id = '$view[category]'") -> fetch_assoc();
$favorites = $mysqli -> query("select count(*) from ero_favorites where id_video = '$view[id]'") -> fetch_row();
if (isset($_GET['favorites'])){
$favorites_my = $mysqli -> query("select count(*) from ero_favorites where id_video = '$view[id]' and data = '".mysqli_real_escape_string($mysqli, filter($_SERVER['REMOTE_ADDR']))."'") -> fetch_row();
if ($favorites_my[0] == 0)
$mysqli -> query("INSERT INTO ero_favorites SET id_video = '$view[id]', data = '".mysqli_real_escape_string($mysqli, filter($_SERVER['REMOTE_ADDR']))."'");
else
$mysqli -> query("delete from ero_favorites where id_video = '$view[id]' and data = '".mysqli_real_escape_string($mysqli, filter($_SERVER['REMOTE_ADDR']))."'");
header('location: /watch/'.$view['translit'].'.html');
exit;
}
$title = $view['name'];
$description = mb_substr($view['description'], 0, 156, 'UTF-8').'..';
$keywords = str_replace(' ', ', ', $view['tags']);
head();
advertising();
$mysqli -> query("update ero_files set view = view + '1' where id = '$view[id]'");
$tags = explode(' ', tags($view['tags']));
?>
<p class="functions_data">
<a href="/" title="Домой">Домой</a> »
<a href="/<?=$category['translit']?>/" title="<?=$category['name']?>"><?=$category['name']?></a> »
<b><?=$view['name']?></b>
</p>
<p class="view">
<img src="/designs/icons/view/added.png" width="16" height="16" /> <?=date('Y-m-d H:i:s', $view['date']);?>
<img src="/designs/icons/view/view.png" width="16" height="16" /> <?=$view['view'];?>
<img src="/designs/icons/view/duration.png" width="16" height="16" /> <?=$view['duration'];?> <br />
</p>
<?
if ($settings['player'] == 0) echo '
<video width="100%" controls="controls" poster="'.$view['screenshot'].'">
<source src="/view_'.$view['translit'].'">
</video>';
if ($settings['player'] == 1) echo '
<script src="/core/javascript/uppod-0.5.32.js" type="text/javascript"></script>
<div class="player" id="porno_video"></div>
<script type="text/javascript">
document.getElementById("porno_video").style.height = document.getElementById("porno_video").offsetWidth/1.666+ "px";
this.player = new Uppod({m:"video",uid:"porno_video",file:"/view_'.$view['translit'].'",poster:"'.$view['screenshot'].'"});
</script>';
if ($settings['player'] == 2) echo '
<script src="/core/javascript/playerjs.js" type="text/javascript"></script>
<div id="player"></div>
<script>
var player = new Playerjs({id:"player", file:"/view_'.$view['translit'].'",
title:"'.filter($_SERVER['HTTP_HOST']).'"
});
</script>';
?>
<p align="center">
<span class="likebtn-wrapper" data-theme="drop" data-lang="ru" data-ef_voting="heartbeat" data-rich_snippet="true"></span>
<script>(function(d,e,s){if(d.getElementById("likebtn_wjs"))return;a=d.createElement(e);m=d.getElementsByTagName(e)[0];a.async=1;a.id="likebtn_wjs";a.src=s;m.parentNode.insertBefore(a, m)})(document,"script","//w.likebtn.com/js/w/widget.js");</script>
</p>
<h2 class="functions_data"><font color="DimGrey"><?=$view['description'];?></font></h2>
<div class="functions_data">
<img src="/designs/icons/view/category.png" width="16" height="16" /> Категория: <a href="/<?=$category['translit'];?>/" title="<?=$category['name'];?>"><?=$category['name'];?></a><br />
<img src="/designs/icons/view/tags.png" width="16" height="16" /> Теги:
<?
for($i = 0; $i < 5; $i++) echo '<a href="/tag/'.$tags[$i].'"><span style="font-size: '.rand(10, 18).'px;"><b>'.$tags[$i].'</b></span></a> ';
?>
</div>
<p>
<div align="center">
<table cellpadding="7" width="100%">
<tr>
<th><div class="menu_j"><a href="/download/<?=$view['translit'];?>.mp4" class="tach" title="Скачать видео <?=$view['name'];?>"><img src="/designs/icons/view/download.png" width="16" height="16" /> Скачать (<?=$view['downloads'];?>)</a></div></th>
<th><div class="menu_j"> <a href="/watch/<?=$view['translit'];?>.html?favorites" class="tach" title="Добавить видео <?=$view['name'];?>"><img src="/designs/icons/view/my_favorites.png" width="16" height="16" /> В избранное (<?=$favorites[0];?>)</a></div></th>
</tr>
</table>
</div>
<?
if ($user['access'] == 1) {
?>
<div align="center">
<table cellpadding="7" width="100%">
<tr>
<th><div class="menu_j"><a href="/editing_<?=$view['id']?>.html" class="tach"><img src="/designs/icons/view/edit.png" width="16" height="16" /> Редактировать</a></div></th>
<th><div class="menu_j"> <a href="/deletion_<?=$view['id']?>.html" class="tach"><img src="/designs/icons/view/remove.png" width="16" height="16" /> Удалить</a></div></th>
</tr>
</table>
</div>
<?
}
?>
</p>
<p class="view">Похожие видео</p>
<?
$query = $mysqli -> query("select id, screenshot, name, translit, duration, view from ero_files where category = '$category[id]' and date < '".time()."' and id != '$category[id]' order by rand() desc limit 3");
while($row = $query -> fetch_assoc()) {
if ($user['access'] == 1)
$edit = '<p align="right"><a href="/editing_'.$row['id'].'.html"><img src="/designs/icons/view/edit.png" width="16" height="16" /> Ред.</a>
<a href="/deletion_'.$row['id'].'.html"><img src="/designs/icons/view/remove.png" width="16" height="16" /> Удал.</a></p>'; else $edit = false;
?>
<a href="/watch/<?=$row['translit']?>.html" class="tach" title="<?=$row['name']?>">
<img class="screenshots" src="<?= $row['screenshot'] ?>" alt="<?=$row['name']?>" />
<span class="sample"><?=$row['duration']?></span>
<h2 style="font-size: 12px;"><?=$row['name']?></h2></a><?=$edit?>
<?
}
$query -> free();