$query = DB::query("SELECT uid FROM ".DB::table(‘ucenter_members‘)." WHERE username = ‘$_cookie_userName‘ limit 1");
if(!DB::num_rows($query)) {
// 插入用户中心数据
DB::query( "INSERT INTO ".DB::table(‘ucenter_members‘)." (uid,username,password,email) VALUES (‘$discuz_uid‘,‘$_cookie_userName‘,‘$_cookie_userPassWord‘,‘‘)");
DB::query("commit;");
$query = DB::query("SELECT uid FROM ".DB::table(‘ucenter_members‘)." WHERE username = ‘$_cookie_userName‘ limit 1");
$discuz_uid = DB::result($query, 0);
DB::query( "INSERT INTO ".DB::table(‘ucenter_memberfields‘)."(uid) VALUES (‘$discuz_uid‘)");
DB::query("commit;");
/* 这个取得公用主键ID 创建UCENTER中用户,在DIS中再检索处理 */
/* 取得论坛用户UID */
$query = DB::query("SELECT uid FROM ".DB::table("common_member")." WHERE username = ‘$_cookie_userName‘ limit 1");
if(DB::num_rows($query)) {
$discuz_uid = DB::result($query, 0);
} else {
// 同步插入论坛数据
DB::query( "INSERT INTO ".DB::table(‘common_member‘)." (uid,username,password,adminid,groupid,regdate,email) VALUES (‘$discuz_uid‘,‘$_cookie_userName‘,‘$_cookie_userPassWord‘,‘0‘,‘10‘,‘1307062876‘,‘‘)");
DB::query( "INSERT INTO ".DB::table(‘common_member_status‘)." (uid) VALUES (‘$discuz_uid‘)");
DB::query( "INSERT INTO ".DB::table(‘common_member_profile‘)."(uid)value(‘$discuz_uid‘)");
DB::query( "INSERT INTO ".DB::table(‘common_member_field_forum‘)."(uid)value(‘$discuz_uid‘)");
DB::query( "INSERT INTO ".DB::table(‘common_member_field_home‘)."(uid)VALUE(‘$discuz_uid‘)");
DB::query( "INSERT INTO ".DB::table(‘common_member_count‘)."(uid,extcredits1,extcredits2,extcredits3,extcredits4,extcredits5,extcredits6,extcredits7,extcredits8)VALUE(‘$discuz_uid‘,‘0‘,‘0‘,‘0‘,‘0‘,‘0‘,‘0‘,‘0‘,‘0‘)");
DB::query("commit;");
$query = DB::query("SELECT uid FROM ".DB::table("common_member")." WHERE username = ‘$_cookie_userName‘ limit 1");
$condition .= " OR (uid=‘0‘ AND ip1=‘{$this->var[‘ip1‘]}‘ AND ip2=‘{$this->var[‘ip2‘]}‘ AND ip3=‘{$this->var[‘ip3‘]}‘ AND ip4=‘{$this->var[‘ip4‘]}‘ AND lastactivity>$guestspan) ";
$condition .= $this->var[‘uid‘] ? " OR (uid=‘{$this->var[‘uid‘]}‘) " : ‘‘;