帝国CMS自定义列表的使用实例
<p>帝国CMS提供了自定义列表功能,该功能灵活使用,有着极大的应用空间。<br />如根据某一sql查询条件展示固定信息列表的情况下就可以采用自定义列表功能。<br />举例说明如下:<br />进入后台->栏目->自定义列表->增加自定义列表<br />填写字段及SQL语句,</p><p>此处使用帝国CMS自带的数据库内置数据,SQL语句测试为查询关键词“中国”:</p>
<p>统计记录:</p>
<div class="msgheader">代码如下:</div>
<div class="msgborder" id="phpcode46">select count(*) as total from [!db.pre!]ecms_news where title like '%中国%'</div>
<p>查询记录:</p>
<div class="msgheader">代码如下:</div>
<div class="msgborder" id="phpcode47">select * from [!db.pre!]ecms_news where title like '%中国%' order by id desc</div>
<p>如下图所示:</p>
<p><img style="max-width:100%!important;height:auto!important;"alt="" src="https://zhuji.jb51.net/uploads/allimg/20250616/1-2506161501304N.jpg" /></p>
<p>点击提交后进入【管理自定义列表】页面,<br />如下图所示:</p>
<p><img style="max-width:100%!important;height:auto!important;"alt="" src="https://zhuji.jb51.net/uploads/allimg/20250616/1-2506161501312X.jpg" /></p>
<p>点击【预览】,可以看到预览效果:</p>
<p><img style="max-width:100%!important;height:auto!important;"alt="" src="https://zhuji.jb51.net/uploads/allimg/20250616/1-250616150131423.jpg" /></p>
<div class="clearfix"></div>
頁:
[1]