本帖最后由 lucklu 于 2009-1-13 19:55 编辑
很多网友提出如何自动激活论坛,以下是本人改写uc API的代码,供大家参考:- $member = array();
- $member[uid] = $uid;
- $member[username] = $get['username'];
- $member[email] = empty($get['email'])?'your@email.com':$get['email'];
- $member[password] = md5(time().rand(100000, 999999));
- $member[secques] = '';
- $db->query("INSERT INTO {$tablepre}members (uid,username,email,password,groupid,regip,regdate,timeoffset) VALUES ('{$member[uid]}','{$member[username]}','{$member[email]}','{$member[password]}',10,'', '$timestamp',9999)");
- dsetcookie('sid', '', -86400 * 365);
- dsetcookie('cookietime', $cookietime, 31536000);
- dsetcookie('auth', authcode("$member[password]\t$member[secques]\t$member[uid]", 'ENCODE', $discuz_auth_key), $cookietime);
复制代码 |