這個(gè)是通用的整合其它的cms都可以用到的代碼。
DEDE 5.5 的注冊(cè)部分拿來(lái)用,可以用來(lái)對(duì)接其他系統(tǒng)和 DEDE整合
<?php
/*
只需要準(zhǔn)備好 $userinfo = array (
"username" => "XXXX",
"password" =>"YYYYY",
"email"=> "KKKKKK",
"mtype" => "企業(yè)" ,
);
*/
$charset2 = "gbk";
$link2 = mysql_connect("host","user","password");
mysql_query("set names $charset2,$link2);
$dedeuser = array(
"mtype"=>$userinfo["mtype"],
"userid"=> $userinfo[username],
"userpwd" => $userinfo[password],
"uname" => $userinfo[username],
"sex" => "0",
"email"=>$userinfo[email],
"safequestion"=>0,
"safeanswer" => '',
);
extract($dedeuser,EXTR_PREFIX_ALL,'DEDE');
//會(huì)員的默認(rèn)金幣
$dfscores = 0;
$dfmoney = 0;
$dfrank = mysql_fetch_assoc(mysql_query("Select money,scores From i_linkmall_cn.dede_arcrank where rank='10' ",$link2));
if(is_array($dfrank))
{
$dfmoney = $dfrank['money'];
$dfscores = $dfrank['scores'];
}
$jointime = time();
$logintime = time();
$joinip = $_SERVER["REMOTE_ADDR";
$loginip =$_SERVER["REMOTE_ADDR";
$pwd = $DEDE_userpwd;
$spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0);
$inQuery = "INSERT INTO i_linkmall_cn.dede_member (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` ,
`matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` )
VALUES ('$DEDE_mtype','$DEDE_userid','$pwd','$DEDE_uname','$DEDE_sex','10','$dfmoney','$DEDE_email','$dfscores',
'0','$spaceSta','','$DEDE_safequestion','$DEDE_safeanswer','$jointime','$joinip','$logintime','$loginip'); ";
//print $inQuery;
if(mysql_query($inQuery,$link2) or die(mysql_error()))
{
$mid = mysql_insert_id();
//寫(xiě)入默認(rèn)會(huì)員詳細(xì)資料
if($DEDE_mtype=='個(gè)人')
{
$infosquery = "INSERT INTO i_linkmall_cn.dede_member_person (`mid` , `onlynet` , `sex` , `uname` , `qq` , `msn` , `tel` , `mobile` , `place` , `oldplace` ,
`birthday` , `star` , `income` , `education` , `height` , `bodytype` , `blood` , `vocation` , `smoke` , `marital` , `house` ,
`drink` , `datingtype` , `language` , `nature` , `lovemsg` , `address`,`uptime`)
VALUES ('$mid', '1', '{$DEDE_sex}', '{$DEDE_uname}', '', '', '', '', '0', '0',
'1980-01-01', '1', '0', '0', '160', '0', '0', '0', '0', '0', '0','0', '0', '', '', '', '','0'); ";
$space='person';
}
else if($DEDE_mtype=='企業(yè)')
{
$infosquery = "INSERT INTO i_linkmall_cn.dede_member_company(`mid`,`company`,`product`,`place`,`vocation`,`cosize`,`tel`,`fax`,`linkman`,`address`,`mobile`,`email`,`url`,`uptime`,`checked`,`introduce`)
VALUES ('{$mid}','{$DEDE_uname}','product','0','0','0','','','','','','{$DEDE_email}','','0','0',''); ";
$space='company';
}
else
{
$infosquery = '';
$space='person';
}
/** 此處增加不同類別會(huì)員的特殊數(shù)據(jù)處理sql語(yǔ)句 **/
// echo $infosquery;
mysql_query($infosquery,$link2);
//寫(xiě)入默認(rèn)統(tǒng)計(jì)數(shù)據(jù)
$membertjquery = "INSERT INTO i_linkmall_cn.`dede_member_tj` (`mid`,`article`,`album`,`archives`,`homecount`,`pagecount`,`feedback`,`friend`,`stow`)
VALUES ('$mid','0','0','0','0','0','0','0','0'); ";
mysql_query($membertjquery,$link2);
//寫(xiě)入默認(rèn)空間配置數(shù)據(jù)
$spacequery = "Insert Into i_linkmall_cn.`dede_member_space`(`mid` ,`pagesize` ,`matt` ,`spacename` ,`spacelogo` ,`spacestyle`, `sign` ,`spacenews`)
Values('{$mid}','10','0','{$DEDE_uname}的空間','','$space','',''); ";
mysql_query($spacequery,$link2);
}
2025國(guó)考·省考課程試聽(tīng)報(bào)名