公告:575分类目录为广大站长提供免费收录网站服务,我们将免费进行到底,如需快审服务(10元/站)请联系站长QQ

点击这里在线咨询客服
新站提交
  • 网站:19294
  • 待审:3
  • 文章:37080
  • 会员:74
  • 最新会员:3632094

 

要提高这条语句在页面中的性能 博主将这个片段写入了自定义页面这样就能在需要的页面 区域调用出来 而不需要时时访问数据库大约10分钟刷新一次 降低了 大数据下访客每次访问时都要查询多次数据...

要提高这条语句在页面中的性能 博主将这个片段写入了自定义页面3vH575分类目录-全网最大的中文分类目录导航网站

这样就能在需要的页面 区域调用出来 而不需要时时访问数据库大约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 unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_news where newstime unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_photo where newstime unionselect id,classid,titleurl,filename,title,newstime,titlepic from [!db.pre!]ecms_flash where newstime unionselect 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 Allselect 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 id=$bqr[id] and classid=$bqr[classid])Union All(select id,classid,downpath from {$dbtbpre}ecms_movie_data_1 where id=$bqr[id] and classid=$bqr[classid])) as A");$olurl=explode(::::::,$fb[downpath]);?><li><a href="<?=$bqsr[titleurl]?>"><img src="<?=$bqr[titlepic]?>"3vH575分类目录-全网最大的中文分类目录导航网站

发表于 2020-06-11 14:28 阅读 ( 522 ) 分类:国cms
3vH575分类目录-全网最大的中文分类目录导航网站

标签:

分享到: 更多 (0)

下一篇:帝国CMS系统收不到邮件的解决办法(帝国cms 8.0)

上一篇:帝国CMS栏目ID+结合项伪静态,支持分页(帝国cms首页栏目)

  admin95360564zxm

注册时间:

网站:1 个   小程序:3 个  文章:12 篇

  • 19294

    网站

  • 12

    小程序

  • 37080

    文章

  • 74

    会员

赶快注册账号,推广您的网站吧!
热门网站