You can browse or search the latest information about spywares, adwares, trojans, viruses, system processes and common applications.
function page_list($curpage=1,$pageurl,$max_pages,$list_size=9) //$page 当前页数 $pageurl 处理页的GET地址 $max_pages 最大页数 $list_size 左右各显示多少条
{
$curpage=$curpage<1?1:$curpage;
$curpage=$curpage>$max_pages?$max_pages:$curpage; ///页数不正确后面就完蛋了
$start_page=$curpage-$list_size;
$start_page=$start_page<1?1:$start_page;
$end_page=$curpage+$list_size;
$end_page=$end_page>$max_pages?$max_pages:$end_page; ///这次显示的第一页码和最后一页码
for($i=$start_page;$i<=$end_page;$i++)
{
if($i!=$curpage)
$page_string.="$i ";
else
$page_string.="[$i] ";
}
echo $page_string; ///大功告成,喜欢的话RETURN也可
}
function navbar()
{
global $tcount, $firstpage, $prevpage, $page, $tpage, $nextpage, $lastpage,$pagelink;
echo " \n";
echo " \n";
echo " | \n";
if ($tcount > 0) echo "Page $page of $tpage\n";
echo " | \n";
echo " \n";
if ($firstpage <> "")
{
echo "First \n";
echo "Previous\n";
}
else echo "First Previous\n";
echo " \n";
page_list($page,$pagelink,$tpage,6);
echo " \n";
if ($nextpage <> "")
{
echo "Next \n";
echo "Last \n";
}
else echo "Next Last\n";
echo " | \n";
echo " \n";
echo " \n";
}
if (empty($filename)) $filename = "a";
if (trim($filename) == ""&&trim($title)=="")
{
die("Error: Empty search string.");
}
else
{
$link_id = mysql_connect($datahost,$userid,$userpassword) or die ("Error connecting to the database server.");
mysql_select_db ($dbname);
$tcount=0;
$ppp = 40;
if (empty($page)) $page = 1;
if ($page < 1) $page = 1;
if(strcmp($filename,"other")==0)
{
$result = mysql_query("select * from prdata where published=1 and left( filename, 1 ) not in('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') order by filename", $link_id);
}
else
{
$result = mysql_query("select * from prdata where published=1 and filename like '$filename%' order by filename", $link_id);
}
$tcount = mysql_num_rows($result);
$tpage = intval(($tcount+$ppp-1)/$ppp);
$reload = "directory";
if (!empty($filename)) $reload .= "_" . $filename ; // changed in v2.00.03 (OG)
if (!empty($title)) $reload .= "&title=".$title; // changed in v2.00.03 (OG)
$pagelink=$reload."_page_";
if ($page > 1)
{
$firstpage = $reload . "_page_1.php";
$prevpage = $reload . "_page_" . ($page-1).".php";
}
if ($page < $tpage)
{
$nextpage = $reload . "_page_" . ($page+1).".php";
$lastpage = $reload . "_page_" . $tpage.".php";
}
if ($tcount > 0)
{
navbar();
echo"
|
Filename
|
Rating
|
More Info
|
";
}
else
{
die("0 results found.You can try to search it on Google!");
}
$count = 0;
$i = ($page-1)*$ppp;
while (($count < $ppp) and ($i < $tcount))
{
mysql_data_seek($result,$i);
$query = mysql_fetch_array($result);
$prid=$query["prid"];
$rtitle = htmlspecialchars($query["title"]);
$rfilename = htmlspecialchars($query["filename"]);
$description = htmlspecialchars($query["description"]);
$rating = $query["rating"];
$sdate = $query["sdate"];
$udate = $query["udate"];
$times=$query["times"];
$linktodetail='/program/' .$prid .'/'.safename($rtitle).'.html';
if($i%2==0)
{
$tblclass='copy';
}
else
{
$tblclass='tablebodyu';
}
if($rating==1)
$rating="Trustworthy";
else if($rating==2)
$rating="Neutral-Not required";
else if($rating==3)
$rating="Neutral-User's choice";
else if($rating==4)
$rating="Dangerous";
else
$rating="Unknown";
echo
"
";
$i++;
$count++;
}
if ($tcount > 0)
{
echo" ";
navbar();
echo" ";
echo " ";
}
}
?>
|