Файл: EROCMS 11.2 ДЛЯ ADULT/Script/pages/default.php
Строк: 69
<?php
/*
Автор скрипта https://bymas.ru/id85823
Скрипты, программы на заказ.
Быстро, качественно, недорого.
*/
$caching = $_SERVER['DOCUMENT_ROOT'].'/content/cache/default.html';
if (file_exists($caching)) {
if ((time() - $settings['cache']) < filemtime($caching)) {
echo file_get_contents($caching);
foot();
exit;
}
}
ob_start();
$title = $settings['title'];
$description = $settings['description'];
$keywords = $settings['keywords'];
head();
advertising();
#404 ошибка
if (isset($_GET['error'])) error('Страница не найдена');
#Новые видео
?>
<p class="functions_data" align="center">Новинки видео</p>
<?
$query = $mysqli -> query("select screenshot, name, duration, translit from ero_files where date < '".time()."' order by date desc limit 3");
while($row = $query -> fetch_assoc())
echo '<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>';
#Вывод категорий
$query = $mysqli -> query("select id, name, translit from ero_categories order by id asc");
while($row = $query -> fetch_assoc()){
$quantity = $mysqli -> query("select count(*) from ero_files where category = '$row[id]' and date < '".time()."'") -> fetch_row();
$new = $mysqli -> query("select count(*) from ero_files where category = '$row[id]' and date > '".(time()-86400)."' and date < '".time()."'") -> fetch_row();
if ($new[0] > 0) $new = '<span class="new">'.$new[0].'</span>'; else $new = false;
echo '<a href="/'.$row['translit'].'/" class="tach" title="'.$row['name'].'">
'.$new.' <span class="sample">'.$quantity[0].'</span>
<h2 style="font-size: 12px;"> <img src="/designs/icons/view/category.png" width="16" height="16" /> '.$row['name'].'</h2></a>';
}
$handle = fopen($caching, 'w');
fwrite($handle, ob_get_contents());
fclose($handle);
ob_end_flush();
$query -> free();