您现在的位置是:网站首页>建站学院织梦CMS
DEDE整合资料 注册部分脚本 可独立使用
2021-07-16来源: 【织梦CMS】 人已围观
简介 DEDE 5.5 的注册部分拿来用,可以用来对接其他系统和 DEDE整合
<?php
/*
只需要准备好 $userinfo = array (
"username" => "XXXX",
"password" =>"YYYYY",
"email"=> "KKKKKK",
"mtype&quo
DEDE 5.5 的注册部分拿来用,可以用来对接其他系统和 DEDE整合
<?php
/*
只需要准备好 $userinfo = array (
"username" => "XXXX",
"password" =>"YYYYY",
"email"=> "KKKKKK",
"mtype" => "企业" ,
);
*/
$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');
//会员的默认金币
$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();
//写入默认会员详细资料
if($DEDE_mtype=='个人')
{
$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=='企业')
{
$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';
}
/** 此处增加不同类别会员的特殊数据处理sql语句 **/
// echo $infosquery;
mysql_query($infosquery,$link2);
//写入默认统计数据
$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);
//写入默认空间配置数据
$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);
}
如果是整合discuz可以参靠
<?php
/*
只需要准备好 $userinfo = array (
"username" => "XXXX",
"password" =>"YYYYY",
"email"=> "KKKKKK",
"mtype" => "企业" ,
);
*/
$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');
//会员的默认金币
$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();
//写入默认会员详细资料
if($DEDE_mtype=='个人')
{
$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=='企业')
{
$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';
}
/** 此处增加不同类别会员的特殊数据处理sql语句 **/
// echo $infosquery;
mysql_query($infosquery,$link2);
//写入默认统计数据
$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);
//写入默认空间配置数据
$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);
}
如果是整合discuz可以参靠
很赞哦! ()
上一篇:手把手教你制作织梦自定义公告模板
猜您喜欢
相关文章
付费说明
1、安装cms后台,费用是200,基础费用200包括后台调试以及部分页面模板修改.
2、请加我个人微信 634626966,或者扫一扫微信二维码。备注“网站”
3、系统安装只限定于帝国cms,并且支持php,虚拟主机,请选择linux系统
4、【收费说明】制作企业网站,我是这么收费的!