最新公告
欢迎您光临零氪源码,本站秉承服务宗旨 履行“站长”责任,销售只是起点 服务永无止境!欢迎加入VIP

帝国CMS怎么自动刷新首页

正文概述 零氪   2024-05-23  

前言概述

帝国CMS怎么自动刷新首页。n67零氪源码
n67零氪源码
==========================================n67零氪源码

本文实例讲述了帝国CMS自动刷新首页的方法。分享给大家供大家参考。n67零氪源码
n67零氪源码
具体实现方法如下n67零氪源码

==========================================n67零氪源码

1、在首页模板中加入下面代码,尽量放在底部

<script language="javascript" type="text/javascript" src="/e/htmlindex/index_html.php"></script>

2、在 /e/ 建立文件夹 htmlindex,并设置 777权限。

将下面代码保存在 /e/htmlindex/index_html.php,修改刷新时间,将文件中1200改为你想要的时间,单位为秒:
<?php

require("../class/connect.php");

include("../class/db_sql.php");

include("../class/config.php");

include("../class/functions.php");

include("../class/t_functions.php");

require LoadLang("pub/fun.php");

require("../data/dbcache/class.php");

require("../data/dbcache/MemberLevel.php");

include("../class/chtmlfun.php");

$link=db_connect();

$empire=new mysqlquery();

$filepath_s="indexhtmlhc.txt";

$time=time();

@$filemtime=(int)filemtime($filepath_s)+1200;

/*

函数解释

file_exists() 函数检查文件或目录是否存在。

mkdir() 函数创建目录。

time() 函数返回当前时间的 Unix 时间戳。

filemtime() 函数返回文件内容上次的修改时间。

*/

if (!file_exists($filepath_s)){

fopen($filepath_s, &#39;w&#39;);

@chmod($filepath_s, 0777);

ReIndex();

}elseif(!file_exists($filepath_s) || (filemtime($filepath_s)+1200)<time()){

fopen($filepath_s, &#39;w&#39;);

@chmod($filepath_s, 0777);

ReIndex();

}else{

// do nothing

}

db_close();

$empire=null;

?>

以上就是帝国CMS怎么自动刷新首页的详细内容,更多请关注『零氪源码』其它相关文章!n67零氪源码


内容加载中..
  • 231新增会员(位)
  • 0本年发布(个)
  • 0本月发布(个)
  • 0 今日发布(个)
  • 稳定运行(天)

零氪源码,欢迎你!


零氪源码致力于资源分享!

SVIP会员限时优惠,享受资源免费下载

内容持续更新,永不间断


所有资源均与网上收集整理,仅限交流学习使用

请自觉在下载后24小时内删除

勿用于非法用途,本站不承担任何责任

我知道了

回到顶部