@@ -159,7 +159,7 @@ else if ($dopost == 'edituser') { | |||
$query = "UPDATE `#@__member` SET send_max='$send_max',email='$email',uname='$uname',sex='$sex',matt='$matt',user_money='$user_money',money='$money',scores='$scores',`rank`='$rank',spacesta='$spacesta',uptime='$uptime',exptime='$exptime'$pwdsql WHERE mid='$id' AND matt<>10 "; | |||
$rs = $dsql->ExecuteNoneQuery2($query); | |||
if ($rs == 0) { | |||
$query = "UPDATE `#@__member` SET email='$email',uname='$uname',sex='$sex',user_money='$user_money',money='$money',scores='$scores',`rank`='$rank',spacesta='$spacesta',uptime='$uptime',exptime='$exptime'$pwdsql WHERE mid='$id' "; | |||
$query = "UPDATE `#@__member` SET send_max='$send_max',email='$email',uname='$uname',sex='$sex',user_money='$user_money',money='$money',scores='$scores',`rank`='$rank',spacesta='$spacesta',uptime='$uptime',exptime='$exptime'$pwdsql WHERE mid='$id' "; | |||
$rs = $dsql->ExecuteNoneQuery2($query); | |||
if ($rank == 10 || $rank == 100) { | |||
$dsql->ExecuteNoneQuery2("UPDATE `#@__admin` SET `uname`='$uname' WHERE id='$id'"); | |||
@@ -28,6 +28,15 @@ if ($row['uptime'] > 0 && $row['exptime'] > 0) { | |||
} else { | |||
$mhasDay = 0; | |||
} | |||
//获取用户投稿剩余次数 | |||
$isAdmin = $row['matt'] == 10; | |||
$sendtime = GetMemberSendTime($id); | |||
if ($row['send_max'] == -1) { | |||
$rtimes = '无限'; | |||
} else { | |||
$rtimes = ($row['send_max'] - $sendtime) > 0? $row['send_max'] - $sendtime : 0; | |||
} | |||
function GetMemberTypeName($rank) | |||
{ | |||
global $dsql; | |||
@@ -38,7 +47,16 @@ function GetMemberTypeName($rank) | |||
return $row['membername']; | |||
} | |||
} | |||
function GetMemberSendTime($mid) | |||
{ | |||
global $dsql; | |||
$arr = $dsql->GetOne("SELECT COUNT(*) as dd FROM `#@__arctiny` WHERE mid='{$mid}'"); | |||
if (is_array($arr)) { | |||
return $arr['dd']; | |||
} else { | |||
return 0; | |||
} | |||
} | |||
function GetHonor($scores) | |||
{ | |||
global $dsql; | |||
@@ -113,9 +113,13 @@ | |||
<td>投稿限制:</td> | |||
<td> | |||
<input type="text" name="send_max" class="admin-input-xs" value="<?php echo $row['send_max']?>"> | |||
<span>(0为不能投稿)</span> | |||
<span>(0不能投稿,-1无限次)</span> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td>投稿剩余次数:</td> | |||
<td><?php echo $rtimes;?>次</td> | |||
</tr> | |||
<tr> | |||
<td>资料状况:</td> | |||
<td> | |||
@@ -124,4 +124,5 @@ INSERT INTO `#@__sys_payment`(`id`, `code`, `name`, `short_name`, `sortrank`, `c | |||
ALTER TABLE `#@__member` ADD COLUMN `user_money` decimal(10, 2) UNSIGNED NULL DEFAULT 0.00 AFTER `send_max`; | |||
-- 6.2.7 | |||
ALTER TABLE `#@__arctype` ADD COLUMN `apienabled` tinyint UNSIGNED NULL DEFAULT 0 AFTER `smalltypes`,ADD COLUMN `apikey` varchar(64) NULL AFTER `apienabled`; | |||
ALTER TABLE `#@__arctype` ADD COLUMN `apienabled` tinyint UNSIGNED NULL DEFAULT 0 AFTER `smalltypes`,ADD COLUMN `apikey` varchar(64) NULL AFTER `apienabled`; | |||
ALTER TABLE `#@__member` ADD COLUMN `pmid` INT(8) UNSIGNED NULL DEFAULT NULL AFTER `user_money`; |
@@ -108,7 +108,6 @@ class MemberLogin | |||
var $M_KeepTime; | |||
var $M_Spacesta; | |||
var $fields; | |||
var $isAdmin; | |||
var $M_UpTime; | |||
var $M_ExpTime; | |||
var $M_HasDay; | |||
@@ -116,10 +115,12 @@ class MemberLogin | |||
var $M_Honor = ''; | |||
var $M_SendMax = 0; | |||
var $memberCache = 'memberlogin'; | |||
var $dsql; | |||
//php5构造函数 | |||
function __construct($kptime = -1, $cache = FALSE) | |||
{ | |||
global $dsql; | |||
$this->dsql = $dsql; | |||
if ($kptime == -1) { | |||
$this->M_KeepTime = 3600 * 24 * 7; | |||
} else { | |||
@@ -129,26 +130,24 @@ class MemberLogin | |||
$this->M_ID = $this->GetNum(GetCookie("DedeUserID")); | |||
$this->M_LoginTime = GetCookie("DedeLoginTime"); | |||
$this->fields = array(); | |||
$this->isAdmin = FALSE; | |||
if (empty($this->M_ID)) { | |||
$this->ResetUser(); | |||
} else { | |||
$this->M_ID = intval($this->M_ID); | |||
if ($cache) { | |||
$this->fields = GetCache($this->memberCache, $this->M_ID); | |||
if (empty($this->fields)) { | |||
$this->fields = $dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$this->M_ID}' "); | |||
$this->fields = $this->dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$this->M_ID}' "); | |||
} else { | |||
$formcache = TRUE; | |||
} | |||
} else { | |||
$this->fields = $dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$this->M_ID}' "); | |||
$this->fields = $this->dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$this->M_ID}' "); | |||
} | |||
if (is_array($this->fields)) { | |||
//间隔一小时更新一次会员登录时间 | |||
if (time() - $this->M_LoginTime > 3600) { | |||
$dsql->ExecuteNoneQuery("update `#@__member` set logintime='".time()."',loginip='".GetIP()."' WHERE mid='".$this->fields['mid']."';"); | |||
$this->dsql->ExecuteNoneQuery("update `#@__member` set logintime='".time()."',loginip='".GetIP()."' WHERE mid='".$this->fields['mid']."';"); | |||
PutCookie("DedeLoginTime", time(), $this->M_KeepTime); | |||
} | |||
$this->M_LoginID = $this->fields['userid']; | |||
@@ -161,10 +160,9 @@ class MemberLogin | |||
$this->M_Rank = $this->fields['rank']; | |||
$this->M_Spacesta = $this->fields['spacesta']; | |||
$sql = "SELECT titles From `#@__scores` WHERE integral<={$this->fields['scores']} ORDER BY integral DESC"; | |||
$scrow = $dsql->GetOne($sql); | |||
$scrow = $this->dsql->GetOne($sql); | |||
$this->fields['honor'] = $scrow['titles']; | |||
$this->M_Honor = $this->fields['honor']; | |||
if ($this->fields['matt'] == 10) $this->isAdmin = TRUE; | |||
$this->M_UpTime = $this->fields['uptime']; | |||
$this->M_ExpTime = $this->fields['exptime']; | |||
$this->M_SendMax = $this->fields['send_max']; | |||
@@ -202,11 +200,11 @@ class MemberLogin | |||
*/ | |||
function Judgemember() | |||
{ | |||
global $dsql, $cfg_mb_rank; | |||
global $cfg_mb_rank; | |||
$nowtime = time(); | |||
$mhasDay = $this->M_ExpTime - ceil(($nowtime - $this->M_UpTime) / 3600 / 24) + 1; | |||
if ($mhasDay <= 0) { | |||
$dsql->ExecuteNoneQuery("UPDATE `#@__member` SET uptime='0',exptime='0',`rank`='$cfg_mb_rank' WHERE mid='".$this->fields['mid']."';"); | |||
$this->dsql->ExecuteNoneQuery("UPDATE `#@__member` SET uptime='0',exptime='0',`rank`='$cfg_mb_rank' WHERE mid='".$this->fields['mid']."';"); | |||
} | |||
return $mhasDay; | |||
} | |||
@@ -236,9 +234,8 @@ class MemberLogin | |||
*/ | |||
function GetUserSpace() | |||
{ | |||
global $dsql; | |||
$uid = $this->M_ID; | |||
$row = $dsql->GetOne("SELECT sum(filesize) AS fs FROM `#@__uploads` WHERE mid='$uid';"); | |||
$row = $this->dsql->GetOne("SELECT sum(filesize) AS fs FROM `#@__uploads` WHERE mid='$uid';"); | |||
return $row['fs']; | |||
} | |||
/** | |||
@@ -267,9 +264,8 @@ class MemberLogin | |||
*/ | |||
function UpdateUserTj($field, $uptype = 'add') | |||
{ | |||
global $dsql; | |||
$mid = $this->M_ID; | |||
$arr = $dsql->GetOne("SELECT * `#@__member_tj` WHERE mid='$mid' "); | |||
$arr = $this->dsql->GetOne("SELECT * `#@__member_tj` WHERE mid='$mid' "); | |||
if (!is_array($arr)) { | |||
$arr = array('article' => 0, 'album' => 0, 'archives' => 0, 'homecount' => 0, 'pagecount' => 0, 'feedback' => 0, 'friend' => 0, 'stow' => 0); | |||
} | |||
@@ -282,8 +278,8 @@ class MemberLogin | |||
} | |||
} | |||
$inquery = "INSERT INTO `#@__member_tj` (`mid`,`article`,`album`,`archives`,`homecount`,`pagecount`,`feedback`,`friend`,`stow`) VALUES ('$mid','$article','$album','$archives','$homecount','$pagecount','$feedback','$friend','$stow'); "; | |||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__member_tj` WHERE mid='$mid' "); | |||
$dsql->ExecuteNoneQuery($inquery); | |||
$this->dsql->ExecuteNoneQuery("DELETE FROM `#@__member_tj` WHERE mid='$mid' "); | |||
$this->dsql->ExecuteNoneQuery($inquery); | |||
} | |||
/** | |||
* 重置会员信息 | |||
@@ -349,16 +345,15 @@ class MemberLogin | |||
/** | |||
* 投稿是否被限制 | |||
* | |||
* @return bool | |||
* @return array | |||
*/ | |||
function IsSendLimited() | |||
{ | |||
global $dsql; | |||
$arr = $dsql->GetOne("SELECT COUNT(*) as dd FROM `#@__arctiny` WHERE mid='{$this->M_ID}'"); | |||
if ($this->isAdmin === true ) { | |||
return false; | |||
} | |||
$arr = $this->dsql->GetOne("SELECT COUNT(*) as dd FROM `#@__arctiny` WHERE mid='{$this->M_ID}'"); | |||
if (is_array($arr)) { | |||
if ($this->M_SendMax < 0) { | |||
return false; | |||
} | |||
if ($arr['dd'] >= $this->M_SendMax) { | |||
return true; | |||
} else { | |||
@@ -367,7 +362,6 @@ class MemberLogin | |||
} else { | |||
return true; | |||
} | |||
} | |||
/** | |||
* 把数据库密码转为特定长度 | |||
@@ -407,7 +401,6 @@ class MemberLogin | |||
*/ | |||
function CheckUser(&$loginuser, $loginpwd) | |||
{ | |||
global $dsql; | |||
//检测会员名的合法性 | |||
$rs = CheckUserID($loginuser, '会员名', FALSE); | |||
//会员名不正确时返回验证错误,原登录名通过引用返回错误提示信息 | |||
@@ -416,7 +409,7 @@ class MemberLogin | |||
return '0'; | |||
} | |||
//matt=10 是管理员关连的前台帐号,为了安全起见,这个帐号只能从后台登录,不能直接从前台登录 | |||
$row = $dsql->GetOne("SELECT mid,matt,pwd,pwd_new,logintime FROM `#@__member` WHERE userid LIKE '$loginuser' "); | |||
$row = $this->dsql->GetOne("SELECT mid,matt,pwd,pwd_new,logintime FROM `#@__member` WHERE userid LIKE '$loginuser' "); | |||
if (is_array($row)) { | |||
if (!empty($row['pwd_new']) && !password_verify($loginpwd, $row['pwd_new'])) { | |||
$this->loginError($loginuser); | |||
@@ -429,7 +422,7 @@ class MemberLogin | |||
//升级密码 | |||
$newpwd = password_hash($loginpwd, PASSWORD_BCRYPT); | |||
$inquery = "UPDATE `#@__member` SET pwd='',pwd_new='{$newpwd}' WHERE mid='".$row['mid']."'"; | |||
$dsql->ExecuteNoneQuery($inquery); | |||
$this->dsql->ExecuteNoneQuery($inquery); | |||
} | |||
//管理员帐号不允许从前台登录 | |||
if ($row['matt'] == 10) { | |||
@@ -462,7 +455,6 @@ class MemberLogin | |||
*/ | |||
function getLoginError($loginuser) | |||
{ | |||
global $dsql; | |||
$rs = CheckUserID($loginuser, '会员名', FALSE); | |||
//会员名不正确时返回验证错误,原登录名通过引用返回错误提示信息 | |||
if ($rs != 'ok') { | |||
@@ -471,7 +463,7 @@ class MemberLogin | |||
if (!TableHasField("#@__member", "loginerr")) { | |||
return 0; | |||
} | |||
$row = $dsql->GetOne("SELECT loginerr,logintime FROM `#@__member` WHERE userid LIKE '$loginuser'"); | |||
$row = $this->dsql->GetOne("SELECT loginerr,logintime FROM `#@__member` WHERE userid LIKE '$loginuser'"); | |||
if (is_array($row)) { | |||
//1分钟内如果输错3次则需要验证码 | |||
return (time() - (int)$row['logintime']) < 60 ? (int)$row['loginerr'] : 0; | |||
@@ -486,7 +478,6 @@ class MemberLogin | |||
*/ | |||
function loginError($loginuser) | |||
{ | |||
global $dsql; | |||
$rs = CheckUserID($loginuser, '会员名', FALSE); | |||
//会员名不正确时返回验证错误,原登录名通过引用返回错误提示信息 | |||
if ($rs != 'ok') { | |||
@@ -494,7 +485,7 @@ class MemberLogin | |||
} | |||
$loginip = GetIP(); | |||
$inquery = "UPDATE `#@__member` SET loginip='$loginip',logintime='".time()."',loginerr=loginerr+1 WHERE userid='".$loginuser."'"; | |||
$dsql->ExecuteNoneQuery($inquery); | |||
$this->dsql->ExecuteNoneQuery($inquery); | |||
} | |||
/** | |||
* 保存会员cookie | |||
@@ -506,16 +497,16 @@ class MemberLogin | |||
*/ | |||
function PutLoginInfo($uid, $logintime = 0) | |||
{ | |||
global $cfg_login_adds, $dsql; | |||
global $cfg_login_adds; | |||
//登录添加积分(上一次登录时间必须大于两小时) | |||
if (time() - $logintime > 7200 && $cfg_login_adds > 0) { | |||
$dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `scores`=`scores`+{$cfg_login_adds} WHERE mid='$uid' "); | |||
$this->dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `scores`=`scores`+{$cfg_login_adds} WHERE mid='$uid' "); | |||
} | |||
$this->M_ID = $uid; | |||
$this->M_LoginTime = time(); | |||
$loginip = GetIP(); | |||
$inquery = "UPDATE `#@__member` SET loginip='$loginip',logintime='".$this->M_LoginTime."',loginerr=0 WHERE mid='".$uid."'"; | |||
$dsql->ExecuteNoneQuery($inquery); | |||
$this->dsql->ExecuteNoneQuery($inquery); | |||
if ($this->M_KeepTime > 0) { | |||
PutCookie('DedeUserID', $uid, $this->M_KeepTime); | |||
PutCookie('DedeLoginTime', $this->M_LoginTime, $this->M_KeepTime); | |||
@@ -526,11 +517,10 @@ class MemberLogin | |||
} | |||
function GetMemberTypeName() | |||
{ | |||
global $dsql; | |||
if ($this->M_Rank == 0) { | |||
return '注册会员'; | |||
} else { | |||
$row = $dsql->GetOne("SELECT membername FROM `#@__arcrank` WHERE `rank`='".$this->M_Rank."'"); | |||
$row = $this->dsql->GetOne("SELECT membername FROM `#@__arcrank` WHERE `rank`='".$this->M_Rank."'"); | |||
return $row['membername']; | |||
} | |||
} | |||
@@ -538,18 +528,17 @@ class MemberLogin | |||
* 获得会员目前的状态 | |||
* | |||
* @access public | |||
* @param object $dsql 数据库连接 | |||
* @return string | |||
*/ | |||
function GetSta($dsql) | |||
function GetSta() | |||
{ | |||
$sta = ''; | |||
if ($this->M_Rank == 0) { | |||
$sta .= "您目前等级是:注册会员"; | |||
} else { | |||
$row = $dsql->GetOne("SELECT membername FROM `#@__arcrank` WHERE `rank`='".$this->M_Rank."'"); | |||
$row = $this->dsql->GetOne("SELECT membername FROM `#@__arcrank` WHERE `rank`='".$this->M_Rank."'"); | |||
$sta .= "您目前等级是:".$row['membername']; | |||
$rs = $dsql->GetOne("SELECT id FROM `#@__admin` WHERE userid='".$this->M_LoginID."'"); | |||
$rs = $this->dsql->GetOne("SELECT id FROM `#@__admin` WHERE userid='".$this->M_LoginID."'"); | |||
if (!is_array($rs)) { | |||
if ($this->M_Rank > 10 && $this->M_HasDay > 0) $sta .= ",剩余<span class='text-primary'>".$this->M_HasDay."</span>天"; | |||
elseif ($this->M_Rank > 10) $sta .= ",<span class='text-danger'>会员已到期</span>"; | |||
@@ -29,7 +29,7 @@ $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
$menutype = 'content'; | |||
if (empty($formhtml)) $formhtml = 0; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -28,7 +28,7 @@ $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
$menutype = 'content'; | |||
if (empty($formhtml)) $formhtml = 0; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -20,7 +20,7 @@ $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
$mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
$menutype = 'content'; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -19,7 +19,7 @@ $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
$mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
$menutype = 'content'; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -20,7 +20,7 @@ $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
$mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
$menutype = 'content'; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -19,7 +19,7 @@ $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
$mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
$menutype = 'content'; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -20,7 +20,7 @@ $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0; | |||
$mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
$menutype = 'content'; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -19,7 +19,7 @@ $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | |||
$mtypesid = isset($mtypesid) && is_numeric($mtypesid) ? $mtypesid : 0; | |||
$menutype = 'content'; | |||
if ($cfg_ml->IsSendLimited()) { | |||
ShowMsg("投稿失败,每天次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>,需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
ShowMsg("投稿失败,投稿限定次数<span class='text-primary'>{$cfg_ml->M_SendMax}次</span>(剩余0次),需要增加次数,请联系网站管理员", "-1", "0", 5000); | |||
exit(); | |||
} | |||
if (empty($dopost)) { | |||
@@ -207,6 +207,65 @@ if ($fmdo == 'sendMail') { | |||
ShowMsg("已退出登录", "index.php", 0, 2000); | |||
exit(); | |||
} | |||
} else if ($fmdo == 'purl'){ | |||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||
CheckRank(0, 0); | |||
$row = $dsql->GetOne("SELECT count(*) as dd FROM `#@__member` WHERE `pmid`='{$cfg_ml->M_ID}' "); | |||
$msg = "您已经邀请了{$row['dd']}人: | |||
<div class='my-3 bg-white'> | |||
<div class='media text-muted pt-3'> | |||
<svg class='bd-placeholder-img mr-2 rounded' width='32' height='32' xmlns='http://www.w3.org/2000/svg' role='img' aria-label='Placeholder: 32x32' preserveAspectRatio='xMidYMid slice' focusable='false'><title>Placeholder</title><rect width='100%' height='100%' fill='green'></rect><text x='50%' y='50%' fill='green' dy='.3em'>32x32</text></svg> | |||
<div class='media-body pb-3 mb-0 small lh-125 border-bottom border-gray'> | |||
<div class='d-flex justify-content-between align-items-center w-100'> | |||
<strong class='text-gray-dark'>链接邀请</strong> | |||
<a href='javascript:Copylink()'>复制链接</a> | |||
</div> | |||
<span class='d-block'>复制链接分享给其他人,对方通过链接注册后双方均可获得{$cfg_userad_adds}积分<span id='text' style='font-size:0'>{$cfg_basehost}/user/index_do.php?fmdo=user&dopost=regnew&pid={$cfg_ml->M_LoginID}</span></span> | |||
</div> | |||
</div> | |||
<div class='media text-muted pt-3'> | |||
<svg class='bd-placeholder-img mr-2 rounded' width='32' height='32' xmlns='http://www.w3.org/2000/svg' role='img' aria-label='Placeholder: 32x32' preserveAspectRatio='xMidYMid slice' focusable='false'><title>Placeholder</title><rect width='100%' height='100%' fill='#007bff'></rect><text x='50%' y='50%' fill='#007bff' dy='.3em'>32x32</text></svg> | |||
<div class='media-body pb-3 mb-0 small lh-125 border-bottom border-gray'> | |||
<div class='d-flex justify-content-between align-items-center w-100'> | |||
<strong class='text-gray-dark'>二维码邀请</strong> | |||
<a href='javascript:ShowQrcode()'>查看二维码</a> | |||
</div> | |||
<span class='d-block'>分享二维码到移动设备,通过二维码扫码注册,双方均可获得{$cfg_userad_adds}积分</span> | |||
</div> | |||
</div> | |||
<div><a href='index.php' class='btn btn-outline-success btn-sm mt-3'>返回</a></div> | |||
</div> | |||
<div id='qrcode' style='margin:15px 0;width:200px;height:200px;display:none;margin:0 auto'></div> | |||
<script type=\"text/javascript\">var qrcode = new QRCode(document.getElementById(\"qrcode\"), { | |||
width : 200, | |||
height : 200, | |||
correctLevel : 3 | |||
});qrcode.makeCode('{$cfg_basehost}/user/index_do.php?fmdo=user&dopost=regnew&pid={$cfg_ml->M_LoginID}');</script> | |||
<script> | |||
function Copylink() { | |||
var val = document.getElementById('text'); | |||
window.getSelection().selectAllChildren(val); | |||
document.execCommand(\"Copy\"); | |||
ShowMsg(\"复制推广链接成功\"); | |||
} | |||
function ShowQrcode(){ | |||
ShowMsg(document.getElementById('qrcode').innerHTML); | |||
} | |||
</script> | |||
<style> | |||
.modal-body img{ | |||
margin:0 auto; | |||
} | |||
</style> | |||
"; | |||
$wintitle = "邀请好友赚积分"; | |||
$wecome_info = " "; | |||
$win = new OxWindow(); | |||
$win->AddMsgItem($msg); | |||
$winform = $win->GetWindow("hand", " ", false); | |||
$win->Display(DEDEMEMBER."/templets/win_templet.htm"); | |||
exit; | |||
} else { | |||
ShowMsg("本页面禁止返回", "index.php"); | |||
} |
@@ -28,6 +28,10 @@ if ($step == 1) { | |||
exit(); | |||
} | |||
$userid = $uname = trim($userid); | |||
$pid = HtmlReplace($pid, 1); | |||
//推广pid | |||
$pRow = $dsql->GetOne("SELECT mid FROM `#@__member` WHERE userid LIKE '$pid'"); | |||
$pMid = isset($pRow['mid'])? intval($pRow['mid']) : 0; | |||
$pwd = trim($userpwd); | |||
$pwdc = trim($userpwdok); | |||
$rs = CheckUserID($userid, '会员名'); | |||
@@ -63,6 +67,9 @@ if ($step == 1) { | |||
$dfmoney = $dfrank['money']; | |||
$dfscores = $dfrank['scores']; | |||
} | |||
if ($pMid > 0) { | |||
$dfscores = $dfscores + $cfg_userad_adds; | |||
} | |||
$jointime = time(); | |||
$logintime = time(); | |||
$joinip = GetIP(); | |||
@@ -76,7 +83,7 @@ if ($step == 1) { | |||
} | |||
$mtype = '个人'; | |||
$spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0); | |||
$inQuery = "INSERT INTO `#@__member` (`mtype` ,`userid` ,`$pp`,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,`matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip`) VALUES ('$mtype','$userid','$pwd','$uname','','10','$dfmoney','','$dfscores','0','$spaceSta','','','','$jointime','$joinip','$logintime','$loginip'); "; | |||
$inQuery = "INSERT INTO `#@__member` (`mtype` ,`userid` ,`$pp`,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,`matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip`, `pmid`) VALUES ('$mtype','$userid','$pwd','$uname','','10','$dfmoney','','$dfscores','0','$spaceSta','','','','$jointime','$joinip','$logintime','$loginip', '$pMid'); "; | |||
if ($dsql->ExecuteNoneQuery($inQuery)) { | |||
$mid = $dsql->GetLastID(); | |||
//写入默认会员详细资料 | |||
@@ -98,6 +105,9 @@ if ($step == 1) { | |||
//模拟登录 | |||
$cfg_ml = new MemberLogin(7 * 3600); | |||
$rs = $cfg_ml->CheckUser($userid, $userpwd); | |||
if ($pMid > 0) { | |||
$dsql->ExecuteNoneQuery("UPDATE `#@__member` SET scores=scores+{$cfg_userad_adds} WHERE mid='$pMid'"); | |||
} | |||
ShowMsg('操作成功,请重新登录系统', 'index.php'); | |||
exit; | |||
} else { | |||
@@ -105,6 +115,7 @@ if ($step == 1) { | |||
exit(); | |||
} | |||
} | |||
$pid = HtmlReplace($pid, 1); | |||
require_once(DEDEMEMBER."/templets/reg-new.htm"); | |||
} else { | |||
if (!$cfg_ml->IsLogin()) { | |||
@@ -23,7 +23,7 @@ | |||
</ol> | |||
<span class="navbar-text"><a href="javascript:history.back(-1);" class="btn btn-outline-success btn-sm">返回</a></span> | |||
</nav> | |||
<div class="alert alert-success"><?php echo $cfg_ml->GetSta($dsql);?></div> | |||
<div class="alert alert-success"><?php echo $cfg_ml->GetSta();?></div> | |||
<?php if ($cfg_money_scores > 0) {?> | |||
<?php $canCav = floor($cfg_ml->fields['scores'] / $cfg_money_scores);?> | |||
<div class="pb-3"> | |||
@@ -61,6 +61,10 @@ | |||
<div class="bg-light user-meter rounded mb-2 p-4 py-3"><a href="<?php echo $cfg_memberurl;?>/edit_baseinfo.php"><i class="fa fa fa-pencil-square"></i></a></div> | |||
<a href="<?php echo $cfg_memberurl;?>/edit_baseinfo.php">资料修改</a> | |||
</li> | |||
<li class="col" data-tags="space align distribute"> | |||
<div class="bg-light user-meter rounded mb-2 p-4 py-3"><a href="<?php echo $cfg_memberurl;?>/index_do.php?fmdo=purl"><i class="fa fa fa-share"></i></a></div> | |||
<a href="<?php echo $cfg_memberurl;?>/index_do.php?fmdo=purl">推广链接</a> | |||
</li> | |||
</ul> | |||
</div> | |||
</div> | |||
@@ -21,6 +21,7 @@ | |||
<input type="hidden" value="regbase" name="dopost"> | |||
<input type="hidden" value="1" name="step"> | |||
<input type="hidden" value="个人" name="mtype"> | |||
<input type="hidden" value="<?php echo $pid;?>" name="pid"> | |||
<div class="form-group"> | |||
<label for="iptUserid">会员账号</label> | |||
<input type="text" name="userid" id="iptUserid" class="form-control" placeholder="请输入会员账号"> | |||