include "../global/global.php";
$logthis="Search Fnd:".$find.', Srt:'.$usesort;
include "../global/db.php";
dohead();
include "lang/".$char."search.php";
dopage($lng[0]);
$next=xnext();
if (($id!="")&(!$valid)) include"../login/logoff.php"; else { echo dohibar($lng[1],'00CCFF'); ?>
include "spanel.php"; ?>
echo nmess();
if (!connect_db()) {
echo" Selhání databáze! ";
exit;
}
$sortstr='ORDER BY fullname';
$findstr='';
$find=htmlentities($find);
$next2.="find=".$find."&";
if ($usesort) $next2.="usesort=".$usesort."&";
if ($blok) $next2.="blok=".$blok."&";
if ($next) $next.='&'; else $next='?';
$next.='find='.$find;
if ($usesort) $next.="&usesort=".$usesort;
if ($blok) $next.="&blok=".$blok;
if ($usesort) {
if ($find=='') $find="*";
switch ($usesort) {
case'S2':
$sortstr='ORDER BY name';
break;
case'S3':
$sortstr='ORDER BY created DESC';
break;
case'S4':
$sortstr='ORDER BY downcnt DESC';
break;
case'S5':
$sortstr='ORDER BY vote DESC';
break;
case'S6':
$sortstr='ORDER BY year DESC';
break;
case'S7':
$sortstr='ORDER BY created DESC';
break;
}
}
if ($find) {
$item=str_replace('*','%',$find);
$found=mysql_query("SELECT * FROM sdc_files WHERE name like '$item' OR fullname like '$item' ".$sortstr, $db);
$rowcnt=mysql_num_rows($found);
echo ' Na výraz "'.$find.'" nalezeno položek: '.$rowcnt.'
';
if ($blok<1) $blok=10;
@mysql_data_seek($found,$line*$blok);
$i=$rowcnt;
if ($i>$blok) {
if (($line<0)|($line>=($i/$blok))) { $line=0; }
$posun='\n
\n";
$i-=$line*$blok;
echo $posun;
}
echo'';
for ($findi=1;($findi<=$i)&($findi<=$blok);$findi++) {
$row=@mysql_fetch_object($found);
include "vitem.php";
echo"
\n";
}
echo"\n";
echo $posun;
mysql_free_result($found);
} else if ($sel) {
$row=getitem_db(basename($sel),dirname($sel));
if ($row) {
echo"\n";
include "vitem.php";
echo"
\n";
} else echo"Položka nebyla nalezena!";
} else if ($sort) {
}
?>
} dodone(); ?>