Ecmsphp开发中心

1252

帖子

19

跟帖

8

粉丝

用户组:普通会员

头    衔:白银会员

版主

积分
356930
登陆
2134 次
私信
注册时间
2014-06-21 14:06:06
最后登陆时间
2023-09-24 16:04:46

帝国CMS读取远程页面(readhttp)和引用文件标签(includefile)的方法!(超简单!)

 [只看主题]
楼主
0 |
发表: 3 年前
| |
| |
跳转

  帝国CMS读取远程页面(readhttp)和引用文件标签(includefile)的方法!(超简单!)

  很多的朋友经常问到,帝国CMS读取远程页面readhttp和引用文件标签includefile呢?需要怎么操作呢?怎么修改程序?接下来帝国cms模板网小编就来告诉大家帝国CMS读取远程页面(readhttp)和引用文件标签(includefile)的方法,一起来看看吧:

  调用如下:

  1、开启标签 后台--模板--标签--标签管理--修改(选择对应标签)--开启

  2、读取远程页面 (readhttp) [readhttp]'http://127.0.0.1/bbs//incfile/head.html'[/readhttp] 可以是本站的但是要写绝对路径

  引用文件标签 (includefile)

  include自定义页面方法:(自定义页面在后台>"栏目">"自定义页面"里增加)

  include 自定义页面有两种方法(userpage.html在根目录):

  第一种:页面生成.html文件情况下,

  模板用:<?php include(ECMS_PATH.'userpage.html');?>

  或 [includefile]'../../page1.html"'[/includefile]

  或 <?php require(ECMS_PATH.'userpage.html');?>

  调用文件。

  第二种:页面生成.shtml文件,用调用文件。

  技巧说明:

  1、自定义页面存放目录说明:

<?php include(ECMS_PATH.'userpage.html');?>与<!--#include file="/userpage.html"-->

  上面例子是以自定义页面生成到根目录为例,你也可以单独建个自定义页面存放目录,比如:/incpage/ 目录那模板include就是用:

  2、自定义页面可以设置定义生成,以让文件内容实时更新:

<?php include(ECMS_PATH.'/incpage/userpage.html');?>与<!--#include file="/incpage/userpage.html"-->

  在后台>"系统">"计划任务">"管理刷新任务"里增加定时刷新自定义页面。

  3、如果是不同栏目不同自定义页面如何引用?

  (1)、增加自定义页面按栏目ID命名,比如:/incpage/userpage1.html (其中1为栏目ID)

  (2)、模板中include文件用:

<?php include(ECMS_PATH.'/incpage/userpage'.$GLOBALS[navclassid].'.html');?>

  或

<?php require(ECMS_PATH.'/incpage/userpage'.$GLOBALS[navclassid].'.html');?>

  或

<!--#include file="/incpage/userpage<?=$GLOBALS[navclassid]?>.html"-->

  OK!搞定!大家自行测试吧!


ecmsphp开发中心
ecmsphp开发中心
验证码 换一个

当前在线人数: 0
取消

感谢您的支持,我们会继续努力!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

×

打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮

帝国CMS读取远程页面(readhttp)和引用文件标签(includefile)的方法!(超简单!)