Файл: zagruz/fank/load/search/index.php
Строк: 79
<?php
include_once("../head.dat");
include_once("../view.dat");
echo'<img src="/"/img/search.gif" alt="" /><b> Поиск</b><br>';
$query=str_replace(' ','+',$_GET['query']);
$pg=(int)$_GET['pg'];
if(empty($pg)){
$pg=(int)$_GET['qpg']-1;}
$alone=$_GET['alone'];
if(!$alone=="music" || !$alone=="games" || !$alone=="themes" || !$alone=="video")
{header ('Location: /index.php?isset=404');}
$music='мелодии';
$games='игры';
$themes='темы';
$video='видео';
$option='<option value="music">'.$music.'</option>
<option value="games">'.$games.'</option>
<option value="themes">'.$themes.'</option>
<option value="video">'.$video.'</option>';
if($alone=="music"){
$namens=$music;}
if($alone=="games"){
$namens=$games;}
if($alone=="themes"){
$namens=$themes;}
if($alone=="video"){
$namens=$video;}
$option=preg_replace('/<option value="'.$alone.'(.*?)</option>/si','',$option);
$f=file_curl_contents('http://html.fank.ru/search/alone/'.$alone.'/?query='.$query.'&pg='.$pg);
$f=str_replace('href="/search/alone/','href="?alone=',$f);
$f=str_replace('/?query=','&query=',$f);
$f=str_replace('href="/downloads/','href="../?',$f);
$form='<form action="?" method="get">
Поиск по загрузкам:<br><input type="text" id="query" name="query" value="'.$query.'" />
<br><select name="alone">
<option value="'.$alone.'">'.$namens.'</option>
'.$option.'
</select><input type="submit" value="найти" /><br>
</form>
';
$f=preg_replace('/(.*?)<b>Найдено:/si',$form.'<b>Найдено:',$f);
$f=preg_replace('/</b> ((.*?)sec)<br/>/si','</b><br>',$f);
$f=preg_replace('/Область поиска: (.*?)ajajajaj/si','',$f.'ajajajaj');
$f=preg_replace('/<div(.*?)>/si','',$f);
$f=str_replace('</div>','',$f);
$f=str_replace('<input type="text" name="qpg"','<input type="text" name="qpg" style='-wap-input-format: "*N"'',$f);
$f=preg_replace('/action="/search/(.*?)">/si','action="?">
<input type="hidden" name="alone" value="'.$alone.'" />',$f);
if(empty($query))
{$f=$form;}
$f=str_replace('</form>','</form><hr>',$f);
echo $f;
echo'<img src="/img/tabor/download.png" alt="" /><a href="../">Загрузки</a><br>';
include_once("../../themes/$config_themes/foot.php");
?>