帝国cms灵动标签调用多表多模型调用文章的方法
发布时间:2020-08-03作者:帝国建站网
调用多模型的最新文章
注释:以上多个模型用“Union”连接调用
若只调用图片:要加ispic=1条件
举例:
[e:loop={'select * from (
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_movie where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_news where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_article where newstime
) a order by newstime desc limit 10',10,24,1}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
帝国CMS多表调用最新信息,该演示代码为默认数据表下全站最新10条图片信息,自己根据需求可以附加条件,实现全站点击,全站头条,全站推荐等等.注释:以上多个模型用“Union”连接调用
若只调用图片:要加ispic=1条件
举例:
[e:loop={'select * from (
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_news where newstime and ispic=1 union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime and ispic=1 union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime and ispic=1 union
select id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_article where newstime and ispic=1) a order by newstime desc limit 10',10,24,1}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><img src="<?=$bqr['titlepic']?>"/><?=$bqr['title']?></a> <br>
[/e:loop] 相关帝国教程
- 06-29帝国CMS内容页点击改变文字号大小
- 02-24IIS环境下开启TAG伪静态
- 07-04帝国CMS列表页模板调用TAG的两种方法
- 10-10帝国导航栏目100%简单实现导航高亮效果栏目
- 09-15帝国cms后台发布信息时的多图上传去掉链接a标签
- 12-07帝国cms动态页分页函数page1及参数详细解析说明
- 09-23帝国cms验证码说明
- 04-02帝国CMS用自定义列表来制作带分页的专题列表页(感觉很绕口)
- 08-31帝国下载不采用弹出窗口式的修改方法
- 11-14帝国cms栏目导航调用之SQL语句调用一级栏目和二级栏目的方法
- 03-13帝国cms模板制作之模板数据是如何保留的
- 10-10帝国cms模板中载入html页面调用方法和代码是什么?
- 03-31帝国CMS二次开发后台增加添加会员功能
- 04-11帝国cms教程:修改d目录
- 10-08帝国CMS调用当前栏目下的栏目简介等信息
- 07-25帝国CMS单页面栏目解决方案
- 09-06帝国CMS模板怎么禁止鼠标右键菜单和复制功能
- 10-29帝国CMS会员空间调用标签、变量、函数
- 03-29在帝国CMS后台禁止了管理自己的ip地址无法访问解决办法
- 08-21帝国cms不想显示不投稿的系统模型