function PageList($base_url,$num_items,$per_page,$start_item,$PageColor)
{
$total_pages = ceil($num_items/$per_page);
$on_page = floor($start_item / $per_page) + 1;
$page_string="
$page_string.="
";$page_string.="共 ".$num_items." 条信息 第 ".$on_page." 页 / 共 ".$total_pages." 页 ";
$page_string.="
";//定义“首页”和“上一页”连接
if ($on_page > 1)
{
$page_string.="[首页] [上一页] ";
}else{
$page_string.="[首页] [上一页] ";
}
//定义页码连接
if ($on_page<5) { $i_num=1;$i_max=10;} else{ $i_num=$on_page-4;$i_max=$on_page+5;}
for($i=$i_num;$i
$page_nums=($i-1)*$per_page;
if ($page_nums>=$total_pages){
continue;
}
if ($i==$on_page){
$page_string.=$i." ";
}else{
$page_string.="[".$i."] ";
}
}
//定义“尾页”和“下一页”连接
if ($on_page < $total_pages)
{
$page_string.="[下一页] [尾页]";
}else{
$page_string.="[下一页] [尾页]";
}
$page_string.="
";return $page_string;
}