最新公告
  • 欢迎您光临 我爱模板网,本站秉承服务宗旨 履行“站长”责任,销售只是起点 服务永无止境! 立即加入钻石VIP
  • 帝国cms读取远程页面 (readhttp) 和 引用文件标签 (includefile)

    正文概述 管理员   2025-09-06   3

    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文件,用<!--#include file="/userpage.html"-->调用文件。

    技巧说明:

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

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

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

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

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

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

    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"-->

    我爱模板网 » 帝国cms读取远程页面 (readhttp) 和 引用文件标签 (includefile)

    发表评论

    如需帝国cms功能定制以及二次开发请联系我们

    联系作者
    script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?587cc1e5c052b5b0ce99533beff13c96"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();

    请选择支付方式

    ×
    支付宝支付
    余额支付
    ×
    微信扫码支付 0 元