当前位置:首页 > 文章 > 帝国CMS > 正文内容

帝国CMS灵动标签调用多表多模型调用文章

3年前 (2022-10-21)帝国CMS6426

灵动标签调用多表多模型调用文章

1、调用多模型的最新文章

[e:loop={'select * from ( 

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_movie where newstime union 

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_news where newstime union 

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_photo where newstime union 

select id,classid,titleurl,filename,title,newstime,titlepic from phome_ecms_flash where newstime union 

select id,classid,titleurl,filename,title,newstime,titlepic from phome_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条图片信息,自己根据需求可以附加条件,实现全站点击,全站头条,全站推荐等等.

---------------------------------------------------------------------------------

2、调用多模型的最新文章

[e:loop={'

select title,titleurl,titlepic from [!db.pre!]ecms_photo Union All 

select title,titleurl,titlepic from [!db.pre!]ecms_download Union All 

select title,titleurl,titlepic from [!db.pre!]ecms_news',0,24,0}]

<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>

[/e:loop]

注释:以上调用的是(图片模型:photo、下载模型:download、新闻模型:news)三个模型的文章

三个模型用“Union All”连接调用

若指定栏目用:where classid in(46,47,51),

若调用推荐在其后追加:and isgood=1,

若指定调用条数在其后追加:limit 10

扫描二维码推送至手机访问。

版权声明:本文由蓝博发布,如需转载请注明出处。

本文链接:https://www.blueboss.cn/p/626.shtml

“帝国CMS灵动标签调用多表多模型调用文章” 的相关文章

帝国CMS调用最新DIGG顶数量最多的文章

帝国CMS调用最新DIGG顶数量最多的文章

帝国CMS的DIGG顶数最多的文章怎么调用呢? [e:loop={'select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc,id desc limit 8',10,24,0}] <li><a ...

帝国CMS上传生成的随机文件名前面增加自定义前缀

帝国CMS上传生成的随机文件名前面增加自定义前缀

帝国CMS上传生成的随机文件名前面怎么实现增加自定义前缀呢?如何实现?帝国CMS默认上传文件后生成一个32位的随机名称,今天教大家的方法可以在这个32位的随机名称前增加固定名称。 比如,增加 lexiw_ 那么生成后的文件名称就是: lexiw_3445645iuiu567567u5pou5675...

帝国cms专题页面点击率统计代码

帝国cms专题页面点击率统计代码

帝国cms专题页面点击率统计代码 专题访问浏览点击统计 <script src=[!--news.url--]e/public/onclick/?ztid=[!--self.classid--]&enews=dozt></script> 普通内容页 <scr...

帝国CMS灵动标签调用指定时间段的信息

帝国CMS灵动标签调用指定时间段的信息

帝国CMS灵动标签怎么调用指定时间段的信息呢? 1、某天发布的文章: [e:loop={'news',10,18,0,'newstime>='.to_time('2010-11-11 00:00:01').' and newstime<='.to_time('2010-11-11 23...

帝国CMS灵动标签调用包含指定关键词关键字文章

帝国CMS灵动标签调用包含指定关键词关键字文章

用灵动标签调用包含指定的关键词,和关键字的文章呢?其实实现的方法不难,以下是调用方法: 指定关键词调用: [e:loop={"select * from {$dbtbpre}ecms_news where title like '%这里是指定的关键词%' and checked=1 order b...

帝国CMS跳过选择会员类型直接注册

帝国CMS跳过选择会员类型直接注册

怎么跳过选择会员组类型直接注册呢?帝国cms模板网就来告诉大家帝国CMS跳过选择会员类型直接注册方法! 打开 e/class/user.php 文件 查找: $changeregisterurl="ChangeRegister.php" 替换为: $changeregisterurl="" 即可...