| 主機參考:VPS測評參考推薦/專注分享VPS服務器優(yōu)惠信息!若您是商家可以在本站進行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務,查看詳情! |
| 我們發(fā)布的部分優(yōu)惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作 |

帝國CMS如何自動刷新主頁?
本文結(jié)合實例介紹了帝國CMS自動刷新主頁的方法。分享給大家,供大家參考。具體實現(xiàn)方法如下:
建議學習“帝國cms教程”
將下面的代碼添加到主頁模板中,盡可能放在底部。
代碼如下:
& lt腳本語言= & quotjavascript & quottype = & quottext/JavaScript & quot;src = & quot/e/html index/index _ html . PHP & quot;& gt& lt/script & gt;在/e/中創(chuàng)建文件夾htmlindex并設置777權限,在/e/htmlindex/index_html.php中保存以下代碼,修改刷新時間,將文件中的1200改為你想要的時間,以秒為單位。
代碼如下:
& lt?php要求(& quot../class/connect . PHP & quot;);包括(& quot../class/db _ SQL . PHP & quot;);包括(& quot../class/config . PHP & quot;);包括(& quot../class/functions.php");包括(& quot../class/t_functions.php");需要LoadLang(& quot;pub/fun . PHP & quot;);要求(& quot../data/db cache/class . PHP & quot;);要求(& quot../data/db cache/member level . PHP & quot;);包括(& quot../class/chtmlfun . PHP & quot;);$ link = db _ connect();$ empire = new MySQL query();$ filepath _ s = & quotindexhtmlhc.txt & quot;$ time = time();@ $ filemtime =(int)filemtime($ file path _ s)+1200;/*函數(shù)解釋file_exists()函數(shù)檢查文件或目錄是否存在。函數(shù)的作用是:創(chuàng)建一個目錄。time()函數(shù)返回當前時間的Unix時間戳。函數(shù)的作用是:返回文件內(nèi)容的最后修改時間。*/ if(!file _ exists($ file path _ s)){ fopen($ file path _ s,& # 39;w & # 39);@chmod($filepath_s,0777);ReIndex();}elseif(!file _ exists($ file path _ s)| |(file time($ file path _ s)+1200)& lt;time()){ fopen($file path _ s,& # 39;w & # 39);@chmod($filepath_s,0777);ReIndex();}else{ //什么都不做} db _ close();$ empire = null?& gt以上是帝國CMS如何自動刷新主頁的細節(jié)。更多信息請關注主機參考其他相關文章!
這幾篇文章你可能也喜歡:
- 帝國如何處理CMS圖像上傳失敗并提示“文件大小超過限制”?
- 帝國 CMS文章批處理導入失敗。如何檢查數(shù)據(jù)格式?
- 帝國調(diào)整CMS模板布局和替換元素的提示(帝國 CMS視頻教程)
- 帝國 CMS移動適應的常見問題和解決方案?
- 零貝葉斯初學者帝國 CMS生產(chǎn)公司網(wǎng)站教程
本文由主機參考刊發(fā),轉(zhuǎn)載請注明:帝國CMS如何自動刷新主頁 http://www.k2270.com/93152.html
主機參考

















評論前必須登錄!
注冊