子文章的上下页mod, 适合pa所有版本
一个文章有多个小文章,就会有个下一页小标题,如果有多个小文章,仍然只有个下一页小标题,呵呵,为了浏览方便就增加一个上一页功能,修改如下:
两个地方
admin/mkarticle.php
根目录下article.php
两个文件一样的修改,寻找以下语句
if ($pagenum>=$totalpages) {
$nextpage = "";
} else {
$nextpagenum = $pagenum+1;
$nextarticlehtmllink = "../".date("Y_m",$articledate)."/".$prefilename2.$article['articleid']."_$nextpagenum.".HTMLEXT;
$nextsubhead = $subhead[$nextpagenum];
eval("\$nextpage = \"".gettemplate('articlehome_nextpage')."\";");
}
$nextpage = "";
} else {
$nextpagenum = $pagenum+1;
$nextarticlehtmllink = "../".date("Y_m",$articledate)."/".$prefilename2.$article['articleid']."_$nextpagenum.".HTMLEXT;
$nextsubhead = $subhead[$nextpagenum];
eval("\$nextpage = \"".gettemplate('articlehome_nextpage')."\";");
}
下面增加
if ($pagenum == 1 or $pagenum > $totalpages) {
$propage = "";
} else {
$propagenum = $pagenum - 1;
$proarticlehtmllink = "../".date("Y_m",$articledate)."/".$prefilename2.$article['articleid']."_$propagenum.".HTMLEXT;
$prosubhead = $subhead[$propagenum];
eval("\$propage = \"" . gettemplate('articlehome_propage') . "\";");
}
$propage = "";
} else {
$propagenum = $pagenum - 1;
$proarticlehtmllink = "../".date("Y_m",$articledate)."/".$prefilename2.$article['articleid']."_$propagenum.".HTMLEXT;
$prosubhead = $subhead[$propagenum];
eval("\$propage = \"" . gettemplate('articlehome_propage') . "\";");
}
接着去后台模版处增加一个articlehome_propage自定义摸版,大概这样
<a href="$proarticlehtmllink" title=$prosubhead><b>上一页</b></a>
最后在模版articlehome里面添加$nextpage
责任编辑:semirock