<?php
///
$hostdir=dirname(__FILE__);
include_once ($hostdir."/config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>无标题文档</title>
<style>
.pages a{ padding:8px; }
.pages li { padding:5px; border:#999999 1px solid; margin:2px; display:inline-block;}
.pages a.hover{ color:#FF0000;}
body { width:1000px; margin:0 auto;}
</style>
</head>
<body>
<?php
//require_once($hostdir.'/mofenji/data/common.inc.php');
$keywords=file($hostdir."/files/keywords.txt");
$total = count($keywords);//总数量
// echo $total ;
$page = isset($_GET['page'])?intval($_GET['page']):0;//第几页值
$shownum = 100;//每页显示数量
$limit = $page * $shownum;//查询开始数
$pagenum = ceil($total/$shownum);//总共页数
$pages = '';
$pages .='总共'.$total.'信息'.' 共'.$pagenum.'页,每页'.$shownum.'条信息'."<hr />";
$pages .='<a href="page.php?page=0">'.'首页'.'</a>';
if($page = 0){
$pages .='<a href="page.php?page='.$page.'">'.'上一页'.'</a>' ;
}else{
$pages .='<a href="page.php?page='.($page-1).'">'.'上一页'.'</a>' ;
}
for($i=0;$i<$pagenum;$i++){
if($page == $i){
$pages .='<li><a class="hover">'.($i).'</a></li>';
}else{
$pages .='<li><a href="page.php?page='.$i.'">'.($i).'</a></li>';
}
}
if($page >= ($pagenum-1)){
$pages .=' <a href="page.php?page='.($pagenum-1).'">'.'下一页'.'</a>';
}else{
$pages .='<a href="page.php?page='.($page+1).'">'.'下一页'.'</a>';
}
$pages .='<a href="page.php?page='.($pagenum-1).'">'.'末页'.'</a>';
?>
<div class="pages"><?php echo $pages;?></div>
<ol>
<?php
$pageyema=@$_GET['page'] ;
//echo $pagenumsy ;
//http://dede.com/mfj/single.php?p=50
for($k=1;$k<=$shownum;$k++){
$pcanshu=$shownum*$pageyema +$k;
// echo $installdir. "/single.php?p=" .$pcanshu ."<br />";
$singeurl= $installdir. "/single.php?p=" .$pcanshu ;
echo "<li>";
echo " <a href=".$singeurl.">".$singeurl ."</a>" ;
echo "</li>";
}
?>
</ol>
</body>
</html>
08-23
08-23