<?php
include('./data/config.php');
include('./core/db.fun.php');
include('./core/page.fun.php');
$searchword=$_GET['searchword'];
$result=search($searchword);

$file['notice']='抱歉，没有搜索到相关文件！';
$counts=mysql_num_rows($result);
if($counts==0){
	$div=$file['notice']; 
	}
else{
	$div='';
	while($file=mysql_fetch_array($result))
	{
		$div=$div.'
			 <p class="filename"><a href="'.$config['url'].'/t.php/'.$file['id'].'.html">'.str_replace($searchword,'<span style=color:red>'.$searchword.'</span>',$file['name']).'</a></p>
			 <p class="fileinfo">文件类型：'.$file['type'].' | 文件大小：'.size_info($file['size']).' | 上传时间：'.date('Y-m-d h:s',$file['up']).' | 下载次数：'.$file['down'].'</p>
			 <p class="discription">'.$file['des'].'</p>
			';
		}

}

$tag['<#url#>']        = $config['url'];
$tag['<#sitename#>']   = $config['sitename'];
$tag['<#description#>']= $config['description'];
$tag['<#keywords#>']   = $config['keywords'];
$tag['<#beian#>']      = $config['beian'];
$tag['<#tongji#>']     = stripslashes($config['tongji']);

$tag['<#search#>']        = $div;

$tag['<#pages#>']        = pages('search.php','id',$_GET['searchword']);

echo html_mod('search',$tag);
?>