1861资源网:您身边、安全、高速、放心的专业下载站!
手机站 软件专题
1861资源网
热门搜索: 请搜索 软件: 相关信息 照明商店 搜索 教程:相关 爆裂点 照明商店 请输入 相关: 软件

帝国cms定时审核代码可以设置任务自动刷新首页和栏目

    在首页模板中加入下面代码,尽量放在底部。
    <script language="javascript" type="text/javascript" src="/e/htmlindex/index_html.php"></script>
    在 /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, 'w');
    @chmod($filepath_s, 0777);
    ReIndex();
    }elseif(!file_exists($filepath_s) || (filemtime($filepath_s)+1200)<time()){
    fopen($filepath_s, 'w');
    @chmod($filepath_s, 0777);
    ReIndex();
    }else{
    // do nothing
    }
    db_close();
    $empire=null;
    ?>
帝国教程 发布: 2022-04-03   修改: 2024-05-05   阅:   评:   点击报错反馈
相关文章
本类最新发布
本类推荐
本类评论
留言与评论(共有 0 条评论)
验证码:
本类软件分类
文章总排行
文章月排行
装机必备软件
全站下载总排行

1861资源网

http://www.zywlyy.cn/

   |

1861资源网 软件下载

1861资源网

使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

感谢网络科技公司技术支持