替换require/forum.php中的
function numofpage 函数
修改方法:
用以下代码
复制程式
function numofpage($count,$page,$numofpage,$url,$max=0)
{
global $tablecolor;
$total=$numofpage;
$max && $numofpage > $max && $numofpage=$max;
if ($numofpage <= 1 || !is_numeric($page)){
$pages= "<input class=inbg type=button value='本版目前只有一页' name=button disabled>"; return $pages;
}else{
$pages="<input class=inbg type=button value='首页' onClick=\"location.href='{$url}page=1'\" name=button title='回到第一页'>";
$flag=0;
for($i=$page-3;$i<=$page-1;$i++)
{
if($i<1) continue;
if($i<10){
$pages.=" <input class=inbg type=button value=' $i ' onClick=\"location.href='{$url}page=$i'\" name=button>";}
else{
$pages.=" <input class=inbg type=button value='$i' onClick=\"location.href='{$url}page=$i'\" name=button>";}
}
if($page<10){
$pages.=" <input class=inbg type=button value=' $page ' name=button disabled>";}
else{$pages.=" <input class=inbg type=button value='$page' name=button disabled>";}
if($page<$numofpage)
{
for($i=$page+1;$i<=$numofpage;$i++)
{
if($i<10){
$pages.=" <input class=inbg type=button value=' $i ' onClick=\"location.href='{$url}page=$i'\" name=button>";}
else{$pages.=" <input class=inbg type=button value='$i' onClick=\"location.href='{$url}page=$i'\" name=button>";}
$flag++;
if($flag==4) break;
}
}
$pages.=" <input class=inbg type=button value='尾页' onClick=\"location.href='{$url}page=$numofpage'\" name=button title='最后一页'> <input type='text' size=ƈ' style='height: 18px; border:1px solid $tablecolor' onkeydown=\"javascript: if(event.keyCode==13) location='{$url}page='+this.value;\"> 总共:(<font color=red>$page</font>/$total)";
return $pages;
}
}