destoon 调用会员注册了多少时间的方法

api/extend.func.php 中添加以下函数

function from_date($regtime){

global $DT_TIME;
$time = $DT_TIME – $regtime;
if($time>31536000){
$year = intval($time/31536000);
$t = $time%1314000;
if($t>259200){
$month = intval($t/259200);
$x = $t%259200;
if($x){
$month += 1;
}
return $year.’年’.$month.’个月’;
}else{
return $year.’年1个月’;
}
}else{
if($time>259200){
$month = intval($time/259200);
$t = $time%259200;
if($t>86400){
$day = intval($t/86400);
}else{
$day = 1;
}
return $month.’个月’.$day.’天’;
}else{
if($time>86400){
$day = intval($t/86400);
}else{
$day = 1;
}
return $day.’天’;
}
}

}

会员列表页使用  {from_date($t[regtime])} 调用即可

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注