先备份好你现在的数据,然后按下面步骤,重新转换会员(只升级注册时间)
打开转换程序主文件dv7xacc-dz500.php
查找- } elseif($step == 1) { // 会员
- if($start <= 1) {
- truncatetable('members');
- truncatetable('memberfields');
- validid('userid', 'user');
- $extcredits = 'a:8:{i:1;a:6:{s:5:"title";s:4:"经验";s:4:"unit";s:2:"点";s:5:"ratio";i:0;s:9:"available";s:1:"1";s:10:"lowerlimit";i:0;s:12:"showinthread";s:1:"1";}i:2;a:6:{s:5:"title";s:4:"威望";s:4:"unit";s:2:"点";s:5:"ratio";i:0;s:9:"available";s:1:"1";s:10:"lowerlimit";i:0;s:12:"showinthread";s:1:"1";}i:3;a:6:{s:5:"title";s:4:"金钱";s:4:"unit";s:2:"¥";s:5:"ratio";i:0;s:9:"available";s:1:"1";s:10:"lowerlimit";i:0;s:12:"showinthread";s:1:"1";}i:4;a:6:{s:5:"title";s:4:"魅力";s:4:"unit";s:0:"";s:5:"ratio";i:0;s:9:"available";s:1:"1";s:10:"lowerlimit";i:0;s:12:"showinthread";s:1:"1";}i:5;a:6:{s:5:"title";s:4:"点券";s:4:"unit";s:2:"¥";s:5:"ratio";i:0;s:9:"available";s:1:"1";s:10:"lowerlimit";i:0;s:12:"showinthread";s:1:"1";}i:6;a:6:{s:5:"title";s:0:"";s:4:"unit";s:0:"";s:5:"ratio";i:0;s:9:"available";N;s:10:"lowerlimit";i:0;s:12:"showinthread";N;}i:7;a:6:{s:5:"title";s:0:"";s:4:"unit";s:0:"";s:5:"ratio";i:0;s:9:"available";N;s:10:"lowerlimit";i:0;s:12:"showinthread";N;}i:8;a:6:{s:5:"title";s:0:"";s:4:"unit";s:0:"";s:5:"ratio";i:0;s:9:"available";N;s:10:"lowerlimit";i:0;s:12:"showinthread";N;}}';
- mysqlquery("UPDATE {$discuz_tablepre}settings SET value='$extcredits' WHERE variable='extcredits'");
- }
- $sql = "SELECT * FROM {$source_tablepre}user WHERE (userid BETWEEN $start AND $end)";
- $rs = $dbc->execute($sql);
- $fieldarray = array('userid', 'username', 'userpassword', 'useremail', 'userpost', 'usertopic', 'usersign', 'usersex', 'userface', 'userwidth', 'userheight', 'userim', 'joindate', 'lastlogin', 'userviews', 'userclass', 'userwealth', 'userep', 'usercp', 'userpower', 'userbirthday', 'userlastip', 'userinfo');
- while (!$rs->EOF) {
- foreach($fieldarray AS $field) {
- $user[$field] = $rs->fields[$field]->value;
- }
- $uid = $user['userid'];
- $username = trim($user['username']);
- if(!$username || $username != htmlspecialchars(daddslashes($username))) {
- reportlog("非法用户名 <b><font color='red'>$username</font></b> 不能被转换,uid = $uid ;<br>\r\n");
- } elseif(strlen($username) > 15) {
- reportlog("用户名 <b><font color='orange'>$username</font></b> 长度大于 15,不能被转换,uid = $uid ;<br>\r\n");
- } elseif(getuid($username)) {
- reportlog("重复用户名 <b><font color='blue'>$username</font></b> 不能被转换,uid = $uid ;<br>\r\n");
- } else {
- $user = daddslashes($user);
- $password = strtolower($user['userpassword']);
- $gender = $user['usersex']==1 ? 1 : 2;
- $groupexpiry = 0;
- $regip = $user['userlastip'];
- $regdate = accesstimetounix($user['joindate']);
- $lastip = $user['userlastip'];
- $lastvisit = accesstimetounix($user['lastlogin']);
- $lastactivity = $lastvisit;
- $lastpost = $lastvisit;
- $posts = isset($user['userpost']) ? $user['userpost'] : 0;
- $credits = $user['userep']; //积分
- $extcredits1 = $user['userep']; //经验值
- $extcredits2 = $user['userpower']; //威望
- $extcredits3 = $user['userwealth']; //金钱
- $extcredits4 = $user['usercp']; //魅力
- $extcredits5 = $user['userticket']; //点券
- if(in_array($user['usergroupid'], array('1', '2', '3'))) {
- $adminid = $groupid = $user['usergroupid'];
- } else {
- $adminid = 0;
- $groupid = 10;
- }
- $extcredits7 = 0;
- $extcredits8 = 0;
- $email = cutstr($user['useremail'],50);
- $bday = $user['userbirthday'] ? $user['userbirthday'] : '0000-00-00';
- $tpp = 0;
- $ppp = 0;
- $styleid = 0;
- $dateformat = '';
- $timeformat = 0;
- $pmsound = 0;
- $showemail = 0;
- $newsletter = '1';
- $invisible = 0;
- $timeoffset = '9999';
- $site = $userfinfo[0] ? (htmlspecialchars(trim(str_replace('http://', '', $userfinfo[0])))) : '';;
- $icq = '';
- $qq = parseqqicq($userfinfo[1]);
- $yahoo = '';
- $msn = $userfinfo[3] ? htmlspecialchars($userfinfo[3]) : '';
- $location = '';
- $customstatus = $user['usertitle'] ? cutstr(@strip_tags($user['usertitle']),30) : '';
- $bio = '';
- $signature = @strip_tags($user['usersign']);
- $sigstatus = $signature ? 1 : 0;
- $sightml = parsesign($user['usersign']);
- $nickname = '';
- $authstr = '';
- $secques = '';
- $ignorepm = '';
- $groupterms = '';
- $biasArray = explode('|', $user['userface']);
- $user['userface'] = count($biasArray) == 2 ? $biasArray[1] : $user['userface'];
- if($user['userface'] && $user['userface'] != 'http://') {
- $user['userface'] = trim($user['userface']);
- if(substr($user['userface'], 0, 7) == 'http://') {
- $avatar = $user['userface'];
- } else {
- if(strtolower(substr($user['userface'], 0, 16)) == 'images/userface/') {
- $avatar = 'images/avatars/dvbbs/'.substr($user['userface'], 16);
- } elseif(strtolower(substr($user['userface'], 0, 11)) == 'uploadface/') {
- $avatar = 'customavatars/dvbbs/'.substr($user['userface'], 11);
- }
- }
- $avatarwidth = $user['userwidth'] > 0 && $user['userwidth'] <= 120 ? $user['userwidth'] : 83;
- $avatarheight = $user['userheight'] > 0 && $user['userheight'] <= 120 ? $user['userheight'] : 94;
- } else {
- $avatar = '';
- $avatarwidth = 0;
- $avatarheight = 0;
- }
- $query1 = "INSERT INTO {$discuz_tablepre}members (uid,username, password, secques, gender, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, extcredits1, extcredits2, extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, email, bday, sigstatus, tpp, ppp, styleid, dateformat, timeformat, pmsound, showemail, newsletter, invisible, timeoffset, lastpost, lastip)
- VALUES ('$uid','$username', '$password', '$secques', '$gender', '$adminid', '$groupid', '$regip', '$regdate', '$lastvisit', '$lastactivity', '$posts', '$credits','$extcredits1', '$extcredits2', '$extcredits3', '$extcredits4', '$extcredits5', '$extcredits6', '$extcredits7', '$extcredits8', '$email', '$bday', '$sigstatus', '$tpp', '$ppp', '$styleid', '$dateformat', '$timeformat', '$pmsound', '$showemail', '$newsletter', '$invisible', '$timeoffset','$lastpost','$lastip');";
- $query2 = "INSERT INTO `{$discuz_tablepre}memberfields`(uid, nickname, site, icq, qq, yahoo, msn, taobao, location, customstatus, medals, avatar, avatarwidth, avatarheight, bio, signature, sightml,ignorepm, groupterms,authstr)
- VALUES ('$uid', '$nickname', '$site', '$icq', '$qq', '$yahoo', '$msn', '' ,'$location', '$customstatus', '', '$avatar', '$avatarwidth', '$avatarheight','$bio', '$signature', '$sightml', '$ignorepm','$groupterms', '$authstr');";
- if (mysqlquery($query1)) {
- if (mysqlquery($query2)) {
- $convertedrows ++;
- } else {
- mysqlquery("DELETE FROM `{$discuz_tablepre}members` WHERE `uid`='$uid' LIMIT 1;");
- reportlog("插入会员扩展信息数据出错 uid = $uid username = $username");
- }
- } else {
- reportlog("插入会员基本数据出错 uid = $uid username = $username");
- }
- }
- $converted = 1;
- $totalrows ++;
- $rs->movenext();
- }
- $rs->close();
- if($converted || $end < $maxid) {
- continue_redirect();
- } else {
- altertable('members', 'uid');
- altertable('memberfields', 'uid');
- report('会员');
- stay_redirect();
- }
复制代码
改成- } elseif($step == 1) { // 会员
- if($start <= 1) {
- validid('userid', 'user');
- }
- $sql = "SELECT * FROM {$source_tablepre}user WHERE (userid BETWEEN $start AND $end)";
- $rs = $dbc->execute($sql);
- $fieldarray = array('userid', 'joindate');
- while (!$rs->EOF) {
- foreach($fieldarray AS $field) {
- $user[$field] = $rs->fields[$field]->value;
- }
- $uid = $user['userid'];
- $regdate = accesstimetounix($user['joindate']);
- $query1 = "UPDATE {$discuz_tablepre}members SET regdate='$regdate' WHERE uid='$uid'";
- if (mysqlquery($query1)) {
- $convertedrows ++;
- } else {
- reportlog("插入会员基本数据出错 uid = $uid");
- }
- $converted = 1;
- $totalrows ++;
- $rs->movenext();
- }
- $rs->close();
- if($converted || $end < $maxid) {
- continue_redirect();
- } else {
- report('会员');
- stay_redirect();
- }
复制代码
[ 本帖最后由 Arice 于 2006-10-30 23:55 编辑 ] |