Home >CMS Tutorial >Empire CMS >How does Imperial CMS implement gift points for member login?

How does Imperial CMS implement gift points for member login?

藏色散人
藏色散人Original
2019-11-18 10:54:112179browse

How does Imperial CMS implement gift points for member login?

How does Empire CMS implement gift points for member login?

The example in this article describes the method of realizing bonus points when logging in to Imperial CMS members.

Modification steps:

1. Enter the management member field and add the following fields:

Field name: LastTime Field identifier: Last login time Field type: large value (INT)

2. Open e/class/user.php and find about line 1019 if ($set1&&$set2). Find:

The code is as follows:

$location=DoingReturnUrl($location,$_POST['ecmsfrom']);

Before Add the following code.

The code is as follows:

//会员登陆赠送点数
$LastTime=time();
$useridz=(int)$r[$user_userid];
$fenus=2; //赠送积分
$LastT=$empire->fetch1("select LastTime from {$dbtbpre}enewsmemberadd where `userid`={$useridz}");
(int)$newstime=$LastT['LastTime'];//时间
(int)$times=mktime(0,0,0,date('m',$LastTime),date('d',$LastTime),date('Y',$LastTime));//当前时间
if($newstime==0){$empire->query("update {$dbtbpre}enewsmember set `userfen`=userfen+{$fenus} where `userid`={$useridz}");}else{
if($times<$newstime && $newstime<$times+86400){
//今天
}else{
$empire->query("update {$dbtbpre}enewsmember set `userfen`=userfen+{$fenus} where `userid`={$useridz}");
}
}
$empire->query("update {$dbtbpre}enewsmemberadd set `LastTime`={$LastTime} where `userid`={$useridz}");
//结束

After modification, save it.

The above is the detailed content of How does Imperial CMS implement gift points for member login?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn