-->

帝国cms分表(帝国cms栏目分类)

分类信息有效期设置,如下图:

步骤1:添加字段gqtime类型以选择日期。

替换提交表单中的html代码(添加字段时请留空),修改内容为:

select name='gqtime' id='gqtime' option value='?echo date('Y-m-d',strtotime('+7day'));=DoReqValue($tbname,'gqtime',stripSlashes($r [gqtime]))?'7 天后过期/optionoption value='?echo date('Y-m-d',strtotime('+1month')) ;=DoReqValue($tbname,'gqtime',stripSlashes($r [gqtime]))?'一个月后过期/optionoption value='?echo date('Y-m-d',strtotime('+3month')) ;=DoReqValue($tbname,'gqtime',stripSlashes($r[gqtime]))?'三个月后过期/optionoption value='?echo date('Y-m-d',strtotime('+6month')) ;=DoReqValue($tbname,'gqtime',stripSlashes ($r[gqtime]))?'所选内容将在六个月后到期/optionoption value='?echo date('Y-m-d',strtotime('+20year'));=DoReqValue($tbname,'gqtime',stripSlashes($r[gqtime]))?'长期有效/option/select 第二步:打开e/class/connect.php文件,找到//栏关联。将以下代码添加到其上面的行:

//时间$odate=round(((strtotime($r[gqtime])-strtotime(date('Y-m-d')))/86400),0); if ($odate0) { $diffTime=''; //} else if ($odate==0) { $diffTime='今天到期'; } else { $diffTime='span class='expire'过期/span '; $listtemp=str_replace('[!--diffTime--]', $diffTime, $listtemp);第三步:信息咨询:

列表页调用:[!--diffTime--]

内容页引用JS:

script language='javascript' src='images/date.js'/script 在需要显示的地方调用:

scriptcheck_tdate('[!--gqtime--]')/scriptdate.js文件代码如下:

//JavaScript Documentfunction check_tdate(odate){ var checkArray=new Array() ;//nowArray=odate.split(' ');checkArray=odate.split('-'); checkDate=new Date(checkArray[0], checkArray[1],checkArray[2]);var nowTime=new Date();//现在时间var the_year=nowTime.getYear(); var the_month=nowTime.getMonth() + 1; var the_day=nowTime.getDate( );nowTime=new Date(the_year,the_month,the_day); var 第二个=24 * 60 * 60 * 1000; var diffTime=(nowTime - checkDate)/thesecond;//计算天数if (diffTime0){myreturn='div style='position:absolute;z-index:100;margin-left:150px;'img src=./././images/guoqi.gif/div';}else if (diffTime==0){myreturn='';} else {diffTime=0-diffTime;myreturn='';}//alert(myreturn); document.write(''+myreturn+'')}过期图片:

上一篇: 帝国cms工作流(帝国cms功能)

下一篇: 帝国cms导航站模板(帝国cms栏目没有了)

关于搜一搜站长工具

如未标明出处,所有模板均为搜一搜站长工具原创,如需转载,请附上原文地址,感谢您的支持和关注。

关于代售类模板,为网友上传发布,如果有侵犯你的权益,请联系我们,第一时间删除。客服邮箱:3801085100#qq.com(#换成@)

本文地址:http://www.soyiso.net/news/12108.html

展开更多