资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

帝国cms的时间函数 帝国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中加入了JS代码用来显示系统时间,但是无论怎么试都无效,显示不出来时间,求大神帮忙 谢谢

span id=localtime/span

script type="text/javascript"

function showLocale(objD)

{

var str;

var yy = objD.getYear();

if(yy1900) yy = yy+1900;

var MM = objD.getMonth()+1;

if(MM10) MM = '0' + MM;

var dd = objD.getDate();

if(dd10) dd = '0' + dd;

var hh = objD.getHours();

if(hh10) hh = '0' + hh;

var mm = objD.getMinutes();

if(mm10) mm = '0' + mm;

var ss = objD.getSeconds();

if(ss10) ss = '0' + ss;

var ww = objD.getDay();

if (ww==0) ww="星期日";

if (ww==1) ww="星期一";

if (ww==2) ww="星期二";

if (ww==3) ww="星期三";

if (ww==4) ww="星期四";

if (ww==5) ww="星期五";

if (ww==6) ww="星期六";

str = yy + "年" + MM + "月" + dd + "日" + hh + ":" + mm + ":" + ss + " " + ww + colorfoot;

return(str);

}

function tick()

{

var today;

today = new Date();

document.getElementById("localtime").innerHTML = showLocale(today);

window.setTimeout("tick()", 1000);

}

tick();

/script

其中

if ( ww==0 ) colorhead="font color=\"#FF0000\"";

if ( ww 0 ww 6 ) colorhead="font color=\"#373737\"";

if ( ww==6 ) colorhead="font color=\"#008000\"";

这几个判断周末颜色的代码不能用,删除后就可以显示。我也不知道是什么原因?

关于帝国CMS显示系统当前时间问题

在首页模板中加入显示当前时间的js代码即可

js代码看下面参考内容

首页调用日期型字段 怎样才能只显示 月和日 不显示 年 帝国cms

?=date('m-d',$bqr[newstime])?

不知道你是不是要灵动标签调用,这里给出的是灵动标签的调用方法。date是格式化时间的函数,单引号里是日期格式,Y-m-d是2015-11-04这种格式,Y代表年m代表月d也就是day,你自己看着写,‘-’是连接符,也可以自己换成中文。比如'm月d日',显示的就是11月04日这种格式。

有什么疑问欢迎咨询7n7z资源网。


文章标题:帝国cms的时间函数 帝国cms的时间函数有哪些
本文来源:http://cdkjz.cn/article/ddgjcig.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220