Вход Регистрация
Файл: anifun.ru/search.php
Строк: 158
<?
############################################
## By Holopsicon          
## https://psgame.net
############################################
include_once("files/dop.php");

$act = html($_GET['act']);

switch(
$act){
default:
?>
<div class="block_search mb15">
<form action="/search/anime/" method="post">
<table cellpadding="0" cellspacing="0">
<td style="width:1px;">
<button class="button_search" type="submit"><span class="material-icons">search</span></button>
</td>
<td>
<input class="input_search" placeholder="Введите название аниме..." type="text" name="search" value="" autocomplete="off">
</td>
</table>
</form>
</div>
<?
break;
case 
'hentai':
    
?>
<div class="block_search mb15">
<form action="/search/xanime/" method="post">
<table cellpadding="0" cellspacing="0">
<td style="width:1px;">
<button class="button_search" type="submit"><span class="material-icons">search</span></button>
</td>
<td>
<input class="input_search" placeholder="Введите название хентая..." type="text" name="search" value="" autocomplete="off">
</td>
</table>
</form>
</div>
<?
break;
case 
'xanime':

if (!empty(
$_REQUEST['search']) && mb_strlen(html($_REQUEST['search']))>2) $search = substr(html($_REQUEST['search']),0,100);
?>
<div class="block_search mb15">
<form action="/search/search/" method="post">
<table cellpadding="0" cellspacing="0">
<td style="width:1px;">
<button class="button_search" type="submit"><span class="material-icons">search</span></button>
</td>
<td>
<input class="input_search" placeholder="Введите название хентая..." type="text" name="search" value="<?=$search?>" autocomplete="off">
</td>
</table>
</form>
</div>
<?
if(!empty($search)){

?><div class="title">Результаты поиска</div><?

$num 
= 9;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `hentai` WHERE `name` LIKE '%$search%'");
$posts = $result;
$total = intval(($posts - 1) / $num) + 1;
$page = intval($page);
if(empty(
$page) or $page < 0) $page = 1;
if(
$page > $total) $page = $total;
$start = $page * $num - $num;
if (!empty(
$result)) {

?><div style="border-radius: 0 0 5px 5px;" class="video_content"><?

$res 
= DB::$dbs->query("SELECT `name`,`id`,`preview`,`views` FROM `hentai` WHERE `name` LIKE '%$search%' ORDER by `name` DESC LIMIT $start,$num");
while(
$array = $res -> fetch()) {

?><div class="block_video">
<div class="video">
<a href="/xepisode/<?=$array['id']?>">
<img src="/preview/hentai/<?=$array['preview']?>">
<b><?=$array['name']?></b>
</a>
<div class="video_rat"><span class="material-icons">visibility</span> <?=$array['views']?></div>
</div>
</div><?

}

?></div><?

###вывод страниц
if ($page != 1) $pervpage = '<a href=/search/xanime/><strong>В начало</strong></a>';
if (
$page != $total) $nextpage = '<a href=/search/xanime/' .$total. '/><strong>В конец</strong></a>';
if(
$page - 2 > 0) $page2left = '<a href=/search/xanime/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if(
$page - 1 > 0) $page1left = '<a href=/search/xanime/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if(
$page + 2 <= $total) $page2right = '<a href=/search/xanime/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if(
$page + 1 <= $total) $page1right = '<a href=/search/xanime/'. ($page + 1) .'/><strong>'. ($page + 1) .'</strong></a>';

?><div class="block_nav"><?
echo $pervpage.$page1left.'<b>'.$page.'</b>'.$page1right.$nextpage;
?></div><?

}else{
?><div class="no_hentai"><span class="material-icons">error_outline</span> Хентай еще не добавлен</div><?
}

}

break;
case 
'anime':

if (!empty(
$_REQUEST['search']) && mb_strlen(html($_REQUEST['search']))>2) $search = substr(html($_REQUEST['search']),0,100);
?>
<div class="block_search mb15">
<form action="/search/search/" method="post">
<table cellpadding="0" cellspacing="0">
<td style="width:1px;">
<button class="button_search" type="submit"><span class="material-icons">search</span></button>
</td>
<td>
<input class="input_search" placeholder="Введите название аниме..." type="text" name="search" value="<?=$search?>" autocomplete="off">
</td>
</table>
</form>
</div>
<?
if(!empty($search)){

?><div class="title">Результаты поиска</div><?

$num 
= 9;
$page = $_GET['page'];
$result = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM `anime` WHERE `name` LIKE '%$search%'");
$posts = $result;
$total = intval(($posts - 1) / $num) + 1;
$page = intval($page);
if(empty(
$page) or $page < 0) $page = 1;
if(
$page > $total) $page = $total;
$start = $page * $num - $num;
if (!empty(
$result)) {

?><div style="border-radius: 0 0 5px 5px;" class="video_content"><?

$res 
= DB::$dbs->query("SELECT `name`,`id`,`preview`,`views` FROM `anime` WHERE `name` LIKE '%$search%' ORDER by `name` DESC LIMIT $start,$num");
while(
$array = $res -> fetch()) {

?><div class="block_video">
<div class="video">
<a href="/episode/<?=$array['id']?>">
<img src="/preview/<?=$array['preview']?>">
<b><?=$array['name']?></b>
</a>
<div class="video_rat"><span class="material-icons">visibility</span> <?=$array['views']?></div>
</div>
</div><?

}

?></div><?

###вывод страниц
if ($page != 1) $pervpage = '<a href=/search/anime/><strong>В начало</strong></a>';
if (
$page != $total) $nextpage = '<a href=/search/anime/' .$total. '/><strong>В конец</strong></a>';
if(
$page - 2 > 0) $page2left = '<a href=/search/anime/'. ($page - 2) .'/><strong>'. ($page - 2) .'</strong></a>';
if(
$page - 1 > 0) $page1left = '<a href=/search/anime/'. ($page - 1) .'/><strong>'. ($page - 1) .'</strong></a>';
if(
$page + 2 <= $total) $page2right = '<a href=/search/anime/'. ($page + 2) .'/><strong>'. ($page + 2) .'</strong></a>';
if(
$page + 1 <= $total) $page1right = '<a href=/search/anime/'. ($page + 1) .'/><strong>'. ($page + 1) .'</strong></a>';

?><div class="block_nav"><?
echo $pervpage.$page1left.'<b>'.$page.'</b>'.$page1right.$nextpage;
?></div><?

}else{
?><div class="no_hentai"><span class="material-icons">error_outline</span> Аниме еще не добавлен</div><?
}

}

break;

}

include_once(
"files/d_one.php");

?>
Онлайн: 2
Реклама