您现在的位置是:首页 > 网站建设网站建设
帝国 CMS把上一篇、下一篇都统一截成 20 字(可自行改数字)
2025-08-18 23:36:13【网站建设】人已围观
简介帝国 CMS把上一篇、下一篇都统一截成 20 字(可自行改数字)
<?php
/* --------- 上一篇 --------- */
$pre = $empire->fetch1("select titleurl,title from {$dbtbpre}ecms_news where id<$navinfor[id] and classid=$navinfor[classid] order by id desc limit 1");
$preHtml = $pre
? '<a href="'.$pre['titleurl'].'">'.esub($pre['title'],20,'…').'</a>'
: '没有了';
/* --------- 下一篇 --------- */
$next = $empire->fetch1("select titleurl,title from {$dbtbpre}ecms_news where id>$navinfor[id] and classid=$navinfor[classid] order by id asc limit 1");
$nextHtml = $next
? '<a href="'.$next['titleurl'].'">'.esub($next['title'],20,'…').'</a>'
: '没有了';
?>
<div class="prev-next">
<span class="prev">上一篇:<?php echo $preHtml; ?></span>
<span class="next">下一篇:<?php echo $nextHtml; ?></span>
</div>
<style>
.prev-next{font-size:14px;margin-top:20px;}
.prev-next span{display:block;margin:5px 0;}
</style>
/* --------- 上一篇 --------- */
$pre = $empire->fetch1("select titleurl,title from {$dbtbpre}ecms_news where id<$navinfor[id] and classid=$navinfor[classid] order by id desc limit 1");
$preHtml = $pre
? '<a href="'.$pre['titleurl'].'">'.esub($pre['title'],20,'…').'</a>'
: '没有了';
/* --------- 下一篇 --------- */
$next = $empire->fetch1("select titleurl,title from {$dbtbpre}ecms_news where id>$navinfor[id] and classid=$navinfor[classid] order by id asc limit 1");
$nextHtml = $next
? '<a href="'.$next['titleurl'].'">'.esub($next['title'],20,'…').'</a>'
: '没有了';
?>
<div class="prev-next">
<span class="prev">上一篇:<?php echo $preHtml; ?></span>
<span class="next">下一篇:<?php echo $nextHtml; ?></span>
</div>
<style>
.prev-next{font-size:14px;margin-top:20px;}
.prev-next span{display:block;margin:5px 0;}
</style>
很赞哦! ()
随机图文
帝国 CMS把上一篇、下一篇都统一截成 20 字(可自行改数字)
帝国 CMS把上一篇、下一篇都统一截成 20 字(可自行改数字)帝国CMS里经常用这个写法来判断 “当前栏目”或“当前栏目的父栏目”
帝国CMS里经常用这个写法来判断 “当前栏目”或“当前栏目的父栏目”帝国 CMS 评论功能,第三方多彩主题评论插件(漂亮、功能全,UTF-8 专用)
插件下载:网上搜 “帝国CMS多彩主题评论插件 2.0” 或见 。① 安装 解压后把 lgyPl2.0 整个目录上传至 /e/extend/ 浏览器访问 http://你的域名/e/extend/lgyPl2.0宝塔面板使用教程汇总(新手指南)
宝塔Linux面板是提升运维效率的服务器管理软件,支持一键LAMP/LNMP/集群/监控/网站/FTP/数据库/JAVA等100多项服务器管理功能。 有30个人的专业团队研发及维护,经过200多个版本的迭代,功能全,少出错且足够安全,已获得全球百万用户认可安装。运维要高效,装宝塔。