帝國cms讀取遠程頁面 (readhttp) 和 引用文件標簽 (includefile)_帝國Cms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!
      帝國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文件,用<!--#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教程  帝國cms模板

      來源:模板無憂//所屬分類:帝國Cms教程/更新時間:2020-05-23
      相關帝國Cms教程