帝国CMS怎样主动刷新首页?
本文实例讲述了帝国CMS主动刷新首页的办法。分享给各人供各人参考。详细完成办法以下:
保举学习《帝国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; ?>
以上就是帝国CMS怎样主动刷新首页的具体内容,更多请存眷资源魔其它相干文章!
标签: 帝国cms 帝国cms教程 帝国cms自学 帝国cms技术
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。