帝国CMS帝国CMS灵动标签调用多表多模型文章信息的写法

帝国CMS帝国CMS灵动标签调用多表多模型文章信息的写法

添加时间:2021-03-12 11:48:25
要提高这条语句在页面中的性能 博主将这个片段写入了自定义页面这样就能在需要的页面 区域调用出来 而不需要时时访问数据库大约10分钟刷新一次 降低了 大数据下访客每次访
举报 举报
收藏

 要提高这条语句正在页面中的性能 博主将这个片段写入了自定义页面

这样就可以正在需要的页面 区域调用出来 而不需要时时访问数据库大约10分钟革新一次 降低了 大数据下访客每次访问时都要查询多次数据库的巨大压力帝国7的包露自定义页面可以这么写  <?php require(ECMS_PATH.'page1.html');?> 注意:page1.html正在根目录。若正在t目录则写成“t/page1.html” 或  [includefile]'../../page1.html'[/includefile]  注意:开启“[includefile]”标签   后台--模板--标签--标签管理--修改(选择对应标签)--开启 ----------------------------------------------------------------------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 unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime and ispic=1 unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime and ispic=1 unionselect 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]   ---------------------------------------------------------------------------------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 举例:多表调用 同时显现“标题”所正在的“栏目名称”跟“链接” 及以“点击排止”[e:loop={"select titleurl,title,onclick,classid from phome_ecms_news union all select titleurl,title,onclick,classid from phome_ecms_article order by onclick desc limit 10",1,24,0}]<LI><A href="<?=$bqsr[classurl]?>" target=_blank><?=$bqsr[classname]?></A> | <A href="<?=$bqsr[titleurl]?>" target=_blank><?=$bqr[title]?></A></LI>[/e:loop] ---------------------------------------------------------------------------------3、多表联合查询“主、副”表调用文章[e:loop={'select * from ((select id,classid,title,titleurl,titlepic,newstime from [!db.pre!]ecms_download limit 3 )Union All(select id,classid,title,titleurl,titlepic,newstime from [!db.pre!]ecms_movie limit 3))  as A  order by newstime desc ',0,24,0}]<?php$fb=$empire->fetch1("select * from ((select id,classid,downpath from {$dbtbpre}ecms_download_data_1 where and class) Union All(select id,classid,downpath from {$dbtbpre}ecms_movie_data_1 where and class) ) as A");$olurl=explode('::::::',$fb['downpath']);?><li><a href="<?=$bqsr['titleurl']?>"><img src="<?=$bqr['titlepic']?>" alt="<?=$bqr['title']?>"></a><div><h3 ><?=$bqr['title']?></h3><p>下载地址:<?=$olurl[1]?></p></div></li>[/e:loop] 注释:以上调用的是(下载模型:download、电影模型:movie)两个模型,并电影副表中下载地址“downpath”(电影副表下载地址未调出,因为内里没有器材)       两个模型用“Union All”毗连调用      $olurl=explode('::::::',$fb['downpath']); 真实下载地址的分割 

转载请注明: 帝国模板 » 帝国CMS灵动标签调用多表多模型文章信息的写法

相关内容推荐
资源求助发帖
查看更多发帖

*

回帖描述:

*

链接类型:

*

下载链接:

密码:
发帖规则:回帖内容为会员之间的私信,普通网友无法查看。
免责声明:回帖中提供的链接内容仅供会员之间学习参考使用,获取内容后请在法律法规范围内使用。回帖提供的内容应符合法律法规要求,不得违反法律法律的要求。
站点权责:回帖内容如违反法律法规,站点有权封停账号使用权利。对用户举报的内容,站点有责任及时删除违规内容。
热点内容推荐
标题:帝国CMS帝国CMS灵动标签调用多表多模型文章信息的写法

*

描述:
平均回复时间:3-10分钟
规则介绍:悬赏寻求论坛网友分享资源,站点对分享内容的准确性,合法性,版权等没有足够的监管能力。如果您发现资源不正确,无法使用,不符合法律法律等情况,您可以直接举报资源。站长将尽快核实您的举报,并根据情况,采取封号,退换米粒等处理。

*

回帖描述:

*

链接类型:

*

阅读权限:

*

下载链接:

密码:
发帖规则:回帖内容为会员之间的私信,普通网友无法查看。
免责声明:回帖中提供的链接内容仅供会员之间学习参考使用,获取内容后请在法律法规范围内使用。回帖提供的内容应符合法律法规要求,不得违反法律法律的要求。
站点权责:回帖内容如违反法律法规,站点有权封停账号使用权利。对用户举报的内容,站点有责任及时删除违规内容。
  • 背景波浪
  • 背景波浪
  • 波浪
  • 波浪
客服
在线咨询
周一 至 周日 9:00 ~ 22:00
QQ:1326974360
微信:juyoubuluo6688
客服热线
18205485173
工作日 9:00 ~ 18:00
微信扫码咨询
客户服务
欢迎咨询服务
咨询量较多时,请耐心等待
社群

关注公众号

获取更多资讯

扫码进群(QQ)

与更多大牛交流沟通

0.118466s