- 论坛徽章:
- 0
|
phpcms2008添加上一篇下一篇的功能
第一步:修改show.php
在代码
if(!$C['defaultchargepoint'] && !$r['readpoint'])
前面增加代码
//<FKE.LA添加代码>
//上一篇文章
$more_pre = $db->get_one("SELECT title,url FROM `".DB_PRE."content` WHERE `contentid`<$contentid and `catid`='{$r['catid']}' order by contentid desc limit 0,1");
if(empty($more_pre)) {
$more_pre['title']='没有了';
$more_pre['url']='';
}
//下一篇文章
$more_next = $db->get_one("SELECT title,url FROM `".DB_PRE."content` WHERE `contentid`>$contentid and `catid`='{$r['catid']}' order by contentid asc limit 0,1");
if(empty($more_next)) {
$more_next['title']='没有了';
$more_next['url']='';
}
//</FKE.LA添加代码>
第二步:修改include/html.class.php中的show函数
在代码
if(strpos($content, ' |
|