Размер файла: 3.09Kb
<?php
$title='Поиск файлов';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
echo'<div class="i">'.$title.'<br></div>';
switch($_GET['act']){
case 'go':
echo'<form action="search.php?" method="get">Введите,что исчите:<br />
<input name="see" type="text" size="18" class="form" value=""/><br />Искать:<br><select name="g" class="form"><option value="1">В описание</option><option value="2">В название</option></select><br>
<input type="submit" value="Искать" class="but"></form>';
break;
default:
$g=cifry($_GET['g']);
$see=prov($_GET['see']);
if($g==0 or $g=="" or $see==""){echo'Произошла ошибка'; require"../system/foot.php"; exit;}
if($g==1 or $g==2){}else{echo'Произошла ошибка'; require"../system/foot.php"; exit;}
$num=10;
if($g==1){
$adata=mysql_query("SELECT * FROM `obmen_files` WHERE `opis` LIKE '%".$see."%'");}
if($g==2){
$adata=mysql_query("SELECT * FROM `obmen_files` WHERE `name` LIKE '%".$see."%'");}
$kol=mysql_num_rows($adata);
$total=$kol;
$page = abs((int)$_GET['page']);
if($page < 0 || $page > $total) $page = 0;
if ($total < $page + 10) $end = $total;
else $end = $page + 10; if($g==1){
$sdata=mysql_query("SELECT * FROM `obmen_files` WHERE `opis` LIKE '%".$see."%' ORDER BY `id_file` DESC LIMIT $page,$num");} if($g==2){
$sdata=mysql_query("SELECT * FROM `obmen_files` WHERE `name` LIKE '%".$see."%' ORDER BY `id_file` DESC LIMIT $page,$num");}
if($kol==0){
echo'<div class="p">
По вашему запросу, ничего не найдено..<br>
</div>';
}else{ echo'<div class="i">Результатов '.$kol.'<br></div>';
while($ofile=mysql_fetch_array($sdata)){
$newcolor=mysql_num_rows(mysql_query("SELECT * FROM `obmen_files` WHERE `kogda`>'".(time()-86400*3)."' AND `id_file`='".$ofile['id_file']."'"));
$dokuda='../files/'.$ofile['id_file'].'_'.$krsite.'.'.$ofile['format'];
$vesma=round(filesize($dokuda)/1024); #Вес файла
if($vesma==0){$vesma='Менее 1';}
echo'<div class="p">';
echo'<b>Имя:</b> <a href="'.$ofile['id_file'].'.info">'; if($newcolor==1){echo'<font color="red">';}
echo $ofile['name'];
if($newcolor==1){echo'</font>';}
echo'</a><br><b>Описание: </b>'; if($ofile['opis']==""){echo'нет';}else{echo mb_substr($ofile['opis'],0,200,'UTF-8');} echo'<br>
<small>Скачали: '.$ofile['loads'].' раз<br></small>
<a href="load.php?id_file='.$ofile['id_file'].'">Скачать</a> ['.strtoupper($ofile['format']).'] ['.$vesma.'Кб]<br>
';
$koments=mysql_num_rows(mysql_query("select * from koments where type='obmen' and id_kogo='".$ofile['id_file']."'"));
$koments=mysql_num_rows(mysql_query("select * from koments where type='obmen' and id_kogo='".$ofile['id_file']."'"));
echo'<a href="../pages/koments.php?id_wm='.$ofile['id_file'].'&type=obmen">Комментарии</a> ['.$koments.']<br>
</div>';
}}
strpage($page, 10, $total, 'search.php','see='.$see.'&g='.$g.'&'); break;
} require"../system/foot.php";
?>