帝国CMS“上一篇”“下一篇”用标题图片代替的方法(灵...

[复制链接]
查看335 | 回复0 | 2019-4-21 18:54:09 | 显示全部楼层 |阅读模式
帝国CMS“上一篇”“下一篇”用标题图片代替的方法(灵动标签)

下面是新闻模型举列子,如果要自己的模型的就调自己的表

较新一篇:
<?php
$infoPreNext = $empire->fetch1("select * from {$dbtbpre}ecms_news where classid=$GLOBALS[navclassid] and checked=1 and newstime>$navinfor[newstime] order by newstime asc limit 1;");
if(empty($infoPreNext[id])){
        echo "没有了";
}else{
        echo "<a href='".sys_ReturnBqTitleLink($infoPreNext)."'><img src='".$infoPreNext[titlepic]."'></a>";
}
?>
较早前一篇:
<?php
$infoPreNext = $empire->fetch1("select * from {$dbtbpre}ecms_news where classid=$GLOBALS[navclassid] and checked=1 and newstime<$navinfor[newstime] order by newstime desc limit 1;");
if(empty($infoPreNext[id])){
        echo "没有了";
}else{
        echo "<a href='".sys_ReturnBqTitleLink($infoPreNext)."'><img src='".$infoPreNext[titlepic]."'></a>";
}
?>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则