帝国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]
相关帝国教程
- 02-10帝国CMS灵动标签调用相关文章的方法
- 10-29帝国cms商城根据会员权限显示指定字段教程
- 03-19帝国CMS在JS登陆状态模板中调用显示会员收到的短消息数
- 09-25帝国CMS实现高效随机文章调用的2种方法
- 11-21帝国cms模板中分页函数修改删除空格
- 11-20帝国cms专题功能的使用方法
- 05-19解决帝国CMS文章自动提取简介后双引号显示成”方法
- 11-11帝国CMS二次开发新订单新反馈信息新投稿发邮件通知管理员
- 10-08帝国CMS强制下载txt文件浏览器带下载进度显示
- 12-05帝国CMS 判断文章信息星期几发布
- 10-14列表页随机插入广告list.var代码
- 10-29帝国CMS会员空间调用标签、变量、函数
- 01-08帝国cms可以做商城么
- 07-11简单的方法实现帝国CMS模板制作中的当前栏目高亮功能
- 04-14解决帝国cms采集规则过滤广告正则针对内容newstext的选择
- 07-27phome_enewsgfenip 数据表字段解释(推广插件记录表)
- 03-15wordpress教程启用主题后自动创建页面
- 10-09帝国CMS广告标签phomead生成的HTML代码在哪个文件里修改
- 05-30帝国cms调用指定条件的信息使用方法
- 03-06帝国CMS灵动标签调用排除重复链接的文章