帝国论坛帝国网站管理系统交流区帝国CMS使用交流帝国CMS整合DiscuzX3.0通行证发布(2013-05-28) 【本版专题贴子】  
 4/27    |‹ ‹‹ 2 3 4 5 6 7 8 9 10 11 ›› ›|
主题:帝国CMS整合DiscuzX3.0通行证发布(2013-05-28) [加入收藏夹]   

kkdesk
用户头衔:举人

精华贴   :0
发贴数   :375
经验值   :1437
注册时间:2006-05-18
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 31 楼]
整合成这样子
是什么原因?

$user_tablename="discuz.cdb_members"; //用户表 $user_userid="uid"; //用户ID字段 $user_username="username"; //用户名字段 $user_password="password"; //密码字段 $user_dopass=0; //密码保存形式,0为md5,1为明码,2为双重加密 $user_rnd="enewsrnd"; //随机密码 $user_email="email"; //邮箱字段 $user_registertime="regdate"; //注册时间字段 $user_register=1; //注册时间保存形式,0为正常时间,1为数值型 $user_group="enewsgroupid"; //会员组字段 $user_userfen="enewsuserfen"; //点数字段 $user_userdate="enewsuserdate"; //包月字段 $user_money="enewsmoney"; //帐户余额 $user_todaydate="enewstodaydate"; //下载日期 $user_todaydown="enewstodaydown"; //当天下载次数 $user_groupid=$public_r[defaultgroupid]; //注册时会员组ID(ecms的会员组) //其他设置 $user_seting="discuz.cdb_settings"; //设置表 $forumgroupid=9; //论坛的普通会员组id值 //会员注册地址 $registerurl="http://localhost/discuz/register.php"; //特殊设置(如vbb,molyx) $user_salt="salt"; //salt $user_saltnum=3; //salt随机码字符数 $utfdata=0; //数据是否是utf-8编码,0为正常数据,1为utfdata编码 //-----------------------编码转换 function doUtfAndGbk($str,$phome=0) {global $utfdata; //正常编码 if(empty($utfdata)) { return $str; } //是否支持iconv if(!function_exists("iconv")) { echo"Iconv is not install!"; exit(); } //gbk转utf if(empty($phome)) { $str=iconv("gbk","UTF-8",$str); } //utf转gbk else { $str=iconv("UTF-8","gbk",$str); } return $str; } //-----------------------登录附加cookie function AddLoginCookie($r) { } //-----------------------后台修改资料 function admin_EditMember($add,$logininid,$loginin) {global $empire,$user_tablename,$user_username,$user_userid,$user_password,$user_dopass,$user_group,$user_email,$user_userfen,$user_money,$user_userdate,$user_saltnum,$user_salt; if(!trim($add[userid])||!trim($add[email])||!trim($add[username])||!$add[groupid]) {printerror("EmptyEmail","history.go(-1)");} //验证权限 CheckLevel($logininid,$loginin,$classid,"member"); //变量 $add[userid]=(int)$add[userid]; //编码转换 $dousername=$add[username]; $add[username]=doUtfAndGbk($add[username],0); $add[oldusername]=doUtfAndGbk($add[oldusername],0); $add[password]=doUtfAndGbk($add[password],0); $add[email]=doUtfAndGbk($add[email],0); //修改密码 if($add[password]) { //单重md5 if(empty($user_dopass)) { $add[password]=md5($add[password]); } elseif($user_dopass==2)//双重md5 { $salt=make_password($user_saltnum); $add[password]=md5(md5($add[password]).$salt); $sa=",".$user_salt."='$salt'"; } else {} $add1=",".$user_password."='".$add[password]."'".$sa; } //修改用户名 if($add[oldusername]<>$add[username]) { $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$add[username]' and ".$user_userid."<>'$add[userid]' limit 1"); $add1.=",".$user_username."='$add[username]'"; if($num) { printerror("ReUsername","history.go(-1)"); } } //包月 if($add[userdate]>0) { $userdate=time()+$add[userdate]*24*3600; } //变量 $add[groupid]=(int)$add[groupid]; $add[userfen]=(int)$add[userfen]; $userdate=(int)$userdate; $add[money]=(float)$add[money]; $sql=$empire->query("update ".$user_tablename." set ".$user_email."='$add[email]',".$user_group."=$add[groupid],".$user_userfen."=$add[userfen],".$user_money."=$add[money],".$user_userdate."=$userdate".$add1." where ".$user_userid."='$add[userid]'"); //附加表 $addnum=$empire->gettotal("select count(*) as total from phome_enewsmemberadd where userid='$add[userid]'"); if(empty($addnum)) { $sql1=$empire->query("insert into phome_enewsmemberadd(userid,truename,oicq,msn,`call`,phone,address,zip) values($add[userid],'$add[truename]','$add[oicq]','$add[msn]','$add[call]','$add[phone]','$add[address]','$add[zip]');"); } else { $sql1=$empire->query("update phome_enewsmemberadd set truename='$add[truename]',oicq='$add[oicq]',msn='$add[msn]',`call`='$add[call]',phone='$add[phone]',address='$add[address]',zip='$add[zip]' where userid='$add[userid]'"); } if($sql) { //操作日志 insert_dolog("userid=".$add[userid]."
username=".$dousername); printerror("EditMemberSuccess","ListMember.php"); } else { printerror("DbError","history.go(-1)"); } } //---------------------后台删除会员 function admin_DelMember($userid,$loginuserid,$loginusername) {global $empire,$user_tablename,$user_username,$user_userid; $userid=(int)$userid; if(empty($userid)) {printerror("NotDelMemberid","history.go(-1)");} //验证权限 CheckLevel($loginuserid,$loginusername,$classid,"member"); $r=$empire->fetch1("select ".$user_username." from ".$user_tablename." where ".$user_userid."='$userid'"); $sql=$empire->query("delete from ".$user_tablename." where ".$user_userid."='$userid'"); //删除附加表 $sql1=$empire->query("delete from phome_enewsmemberadd where userid='$userid'"); //删除收藏 $del=$empire->query("delete from phome_enewsfava where userid='$userid'"); $del=$empire->query("delete from phome_enewsfavaclass where userid='$userid'"); if($sql) { $dousername=doUtfAndGbk($r[$user_username],1); //操作日志 insert_dolog("userid=".$userid."
username=".$dousername); printerror("DelMemberSuccess","ListMember.php"); } else { printerror("DbError","history.go(-1)"); } } //--------------------后台批量删除会员 function admin_DelMember_all($userid,$logininid,$loginin) {global $empire,$user_tablename,$user_username,$user_userid; //验证权限 CheckLevel($logininid,$loginin,$classid,"member"); $count=count($userid); if(!$count) { printerror("NotDelMemberid","history.go(-1)"); } $j=0; for($i=0;$i<$count;$i++) { $add.=" ".$user_userid."='$userid[$i]' or"; $adda.=" userid='$userid[$i]' or"; $j++; } $add=substr($add,0,strlen($add)-3); $sql=$empire->query("delete from ".$user_tablename." where".$add); //删除附加表 $sql1=$empire->query("delete from phome_enewsmemberadd where".$adda); //删除收藏 $del=$empire->query("delete from phome_enewsfava where".$add); $del=$empire->query("delete from phome_enewsfavaclass where".$add); if($sql) { //操作日志 insert_dolog(""); printerror("DelMemberSuccess","ListMember.php"); } else { printerror("DbError","history.go(-1)"); } } //---------------取得邮件地址 function GetUserEmail($userid,$username) {global $empire,$user_tablename,$user_email,$user_userid; $r=$empire->fetch1("select ".$user_email." from ".$user_tablename." where ".$user_userid."='$userid' limit 1"); return doUtfAndGbk($r[$user_email],1); } //-------------返回修改资料 function ReturnUserInfo($userid) {global $empire,$user_tablename,$user_userid,$user_username,$user_email,$user_group,$user_userfen,$user_money,$user_userdate,$user_todaydown; $r=$empire->fetch1("select ".$user_username.",".$user_email.",".$user_group.",".$user_userfen.",".$user_money.",".$user_userdate.",".$user_todaydown." from ".$user_tablename." where ".$user_userid."='$userid' limit 1"); $re[username]=doUtfAndGbk($r[$user_username],1); $re[email]=doUtfAndGbk($r[$user_email],1); $re[userfen]=$r[$user_userfen]; $re[money]=$r[$user_money]; $re[groupid]=$r[$user_group]; $re[userdate]=$r[$user_userdate]; $re[todaydown]=$r[$user_todaydown]; return $re; } //--------------取得会员投稿数 function TotalUserNews($userid) {global $empire,$user_tablename; $r=$empire->fetch1("select count(*) as total from phome_enewsnews where userid='$userid' and ismember=1"); return $r[total]; } //------------------用户注册 function register($username,$password,$repassword,$email) {global $empire,$user_tablename,$public_r,$user_groupid,$user_username,$user_userid,$user_email,$user_password,$user_dopass,$user_rnd,$user_registertime,$user_register,$user_group,$user_saltnum,$user_salt,$user_seting,$forumgroupid,$registerurl; //关闭 if($public_r[register_ok]) {printerror("CloseRegister","history.go(-1)");} if(!empty($registerurl)) { Header("Location:$registerurl"); exit(); } $username=trim($username); $password=trim($password); $username=RepPostVar1($username); $password=RepPostVar1($password); if(!$username||!$password||!$email) {printerror("EmptyMember","history.go(-1)");} //用户字数 $pr=$empire->fetch1("select min_userlen,max_userlen,min_passlen,max_passlen from phome_enewspublic limit 1"); $userlen=strlen($username); if($userlen<$pr[min_userlen]||$userlen>$pr[max_userlen]) {printerror("FaiUserlen","history.go(-1)");} //密码字数 $passlen=strlen($password); if($passlen<$pr[min_passlen]||$passlen>$pr[max_passlen]) {printerror("FailPasslen","history.go(-1)");} if($repassword!=$password) {printerror("NotRepassword","history.go(-1)");} if(!chemail($email)) {printerror("EmailFail","history.go(-1)");} $check_r=explode("|",$username); if(count($check_r)!=1) {printerror("NotSpeWord","history.go(-1)");} $username=htmlspecialchars($username); $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$username' limit 1"); if($num) {printerror("ReUsername","history.go(-1)");} if($user_register) { $registertime=time(); $dyh=""; } else { $registertime=date("Y-m-d H:i:s"); $dyh="'"; } $birthday=$y.$m.$d; $rnd=make_password(12);//产生随机密码 $password=str_replace(" ","",$password); //单重md5 if(empty($user_dopass)) { $password=md5($password); } elseif($user_dopass==2) { $salt=make_password($user_saltnum); $password=md5(md5($password).$salt); } $user_groupid=(int)$user_groupid; $email=htmlspecialchars(addslashes($email)); $sql=$empire->query("insert into ".$user_tablename."(".$user_username.",".$user_password.",".$user_email.",".$user_registertime.",".$user_group.",".$user_rnd.") values('$username','$password','$email',".$dyh."$registertime".$dyh.",$user_groupid,'$rnd');"); //取得userid $userid=$empire->lastid(); if($sql) { $set1=setcookie("mloginusername",$username,0,"/",""); $set2=setcookie("mloginuserid",$userid,0,"/",""); $set3=setcookie("mlogingroupid",$user_groupid,0,"/",""); $set4=setcookie("mloginrnd",$rnd,0,"/",""); printerror("RegisterSuccess","../../"); } else {printerror("DbError","history.go(-1)");} } //---------------------信息修改 function EditInfo($password,$repassword,$oldpassword,$email) {global $empire,$user_tablename,$public_r,$user_userid,$user_username,$user_password,$user_dopass,$user_email,$user_salt,$user_saltnum; //是否登陆 $user_r=islogin(); $userid=$user_r[userid]; $username=$user_r[username]; $rnd=$user_r[rnd]; $groupid=$user_r[groupid]; if(!$userid||!$username||!trim($email)) {printerror("NotEmpty","history.go(-1)");} if(!chemail($email)) {printerror("EmailFail","history.go(-1)");} $email=htmlspecialchars(addslashes($email)); $post=$_POST; //编码转换 $username=doUtfAndGbk($username,0); $email=doUtfAndGbk($email,0); //修改密码 if($password) { if($password!=$repassword) {printerror("NotRepassword","history.go(-1)");} $password=doUtfAndGbk($password,0); $oldpassword=doUtfAndGbk($oldpassword,0); //单重加密 if(empty($user_dopass)) { $password=md5($password); $oldpassword=md5($oldpassword); } //双重加密 elseif($user_dopass==2) { $salt=make_password($user_saltnum); $password=md5(md5($password).$salt); $sa=",".$user_salt."='$salt'"; } else {} $num=0; //双重md5 if($user_dopass==2) { $ur=$empire->fetch1("select ".$user_userid.",".$user_salt.",".$user_password." from ".$user_tablename." where ".$user_username."='$username'"); $oldpassword=md5(md5($oldpassword).$ur[$user_salt]); $num=0; if($oldpassword==$ur[$user_password]) {$num=1;} if(empty($ur[$user_userid])) {$num=0;} } else { $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$username' and ".$user_password."='".$oldpassword."'"); } if(!$num) {printerror("FailOldPassword","history.go(-1)");} $add=",".$user_password."='".$password."'".$sa; } $sql=$empire->query("update ".$user_tablename." set ".$user_email."='$email'".$add." where ".$user_userid."='$userid'"); //附加表 $addnum=$empire->gettotal("select count(*) as total from phome_enewsmemberadd where userid='$userid'"); if(empty($addnum)) { $sql1=$empire->query("insert into phome_enewsmemberadd(userid,truename,oicq,msn,`call`,phone,address,zip) values($userid,'$post[truename]','$post[oicq]','$post[msn]','$post[call]','$post[phone]','$post[address]','$post[zip]');"); } else { $sql1=$empire->query("update phome_enewsmemberadd set truename='$post[truename]',oicq='$post[oicq]',msn='$post[msn]',`call`='$post[call]',phone='$post[phone]',address='$post[address]',zip='$post[zip]' where userid='$userid'"); } if($sql) {printerror("EditInfoSuccess","../member/EditInfo");} else {printerror("DbError","history.go(-1)");} } //----------------------------------是否登陆 function islogin() {global $empire,$editor,$user_tablename,$user_userid,$user_group,$user_groupid,$user_rnd; if($editor==2) {$a="../";} $r[userid]=(int)$_COOKIE['mloginuserid']; $r[username]=RepPostVar1($_COOKIE['mloginusername']); $r[rnd]=RepPostVar1($_COOKIE['mloginrnd']); $r[groupid]=RepPostVar1($_COOKIE['mlogingroupid']); if(!$r[userid]||!$r[username]) { $set3=setcookie("return_url",$_SERVER['HTTP_REFERER'],0,"/",""); //printerror("NotLogin",$a."../login"); printerror("NotLogin","history.go(-1)"); } return $r; } //-------------------------------------退出登陆 function loginout1($userid,$username,$rnd) {global $empire,$public_r; //是否登陆 $user_r=islogin(); $set1=setcookie("mloginusername","",0,"/",""); $set2=setcookie("mloginuserid","",0,"/",""); $set4=setcookie("mloginrnd","",0,"/",""); $set3=setcookie("mlogingroupid","",0,"/",""); printerror("ExitSuccess","../../"); } //----------------------------------------登陆 function login1($username,$password,$lifetime,$key,$location) {global $empire,$user_tablename,$user_userid,$user_username,$user_password,$user_dopass,$user_group,$user_groupid,$user_rnd,$public_r,$user_salt,$user_saltnum; if(!trim($username)||!trim($password)) {printerror("EmptyLogin","history.go(-1)");} //验证码 if($public_r[loginkey_ok]) { if($key<>$_COOKIE['checkplkey']||empty($_COOKIE['checkplkey'])) {printerror("FailKey","history.go(-1)");} } $username=RepPostVar1($username); $password=RepPostVar1($password); //编码转换 $utfusername=doUtfAndGbk($username,0); $password=doUtfAndGbk($password,0); if(empty($user_dopass)) {$password=md5($password);} //双重md5 $num=0; if($user_dopass==2) { $ur=$empire->fetch1("select ".$user_userid.",".$user_salt.",".$user_password." from ".$user_tablename." where ".$user_username."='$utfusername'"); $password=md5(md5($password).$ur[$user_salt]); $num=0; if($password==$ur[$user_password]) {$num=1;} if(empty($ur[$user_userid])) {$num=0;} } else { $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$utfusername' and ".$user_password."='".$password."' limit 1"); } if(!$num) { printerror("FailPassword","history.go(-1)"); } $r=$empire->fetch1("select * from ".$user_tablename." where ".$user_username. "='$utfusername' limit 1"); $time=date("Y-m-d H:i:s"); $rnd=make_password(12);//取得随机密码 if(empty($r[$user_group])) {$r[$user_group]=$user_groupid;} $r[$user_group]=(int)$r[$user_group]; $usql=$empire->query("update ".$user_tablename." set ".$user_rnd."='$rnd',".$user_group."=".$r[$user_group]." where ".$user_userid."='$r[$user_userid]'"); $set1=setcookie("mloginusername",$username,0,"/",""); $set2=setcookie("mloginuserid",$r[$user_userid],0,"/",""); $set3=setcookie("mlogingroupid",$r[$user_group],0,"/",""); $set4=setcookie("mloginrnd",$rnd,0,"/",""); //登录附加cookie AddLoginCookie($r); $location=$_COOKIE['return_url']; if(empty($location)) {$location="../../";} if(strstr($_SERVER['HTTP_REFERER'],"e/member/iframe")) {$location="../member/iframe";} $set5=setcookie("checkplkey","",0,"/",""); if($set1&&$set2) { printerror("LoginSuccess",$location); } else { printerror("NotCookie","history.go(-1)"); } } //----------------------------------批量赠送点数 function GetFen_all($cardfen,$userid,$username) {global $empire,$user_tablename,$user_userfen; $cardfen=(int)$cardfen; if(!$cardfen) {printerror("EmptyGetFen","history.go(-1)");} //验证权限 CheckLevel($userid,$username,$classid,"card"); $sql=$empire->query("update ".$user_tablename." set ".$user_userfen."=".$user_userfen."+$cardfen"); if($sql) { //操作日志 insert_dolog("cardfen=$cardfen"); printerror("GetFenSuccess","GetFen.php");} else {printerror("DbError","history.go(-1)");} } //----------------------------------增加点数 function AddInfoFen($cardfen,$userid) {global $empire,$user_tablename,$user_userfen; $cardfen=(int)$cardfen; $sql=$empire->query("update ".$user_tablename." set ".$user_userfen."=".$user_userfen."+".$cardfen." where userid='$userid'"); } ?>
Warning: Cannot modify header information - headers already sent by (output started at F:wwwtesteclassuser.php:6) in F:wwwtesteclassfunctions.php on line 3970
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') as total from' at line 1
select count() as total from




2006-10-27 19:42:25 已设置保密 顶部 回复 引用 报告 编辑 删除

kkdesk
用户头衔:举人

精华贴   :0
发贴数   :375
经验值   :1437
注册时间:2006-05-18
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 32 楼]
整合成这样子
是什么原因?

$user_tablename="discuz.cdb_members"; //用户表 $user_userid="uid"; //用户ID字段 $user_username="username"; //用户名字段 $user_password="password"; //密码字段 $user_dopass=0; //密码保存形式,0为md5,1为明码,2为双重加密 $user_rnd="enewsrnd"; //随机密码 $user_email="email"; //邮箱字段 $user_registertime="regdate"; //注册时间字段 $user_register=1; //注册时间保存形式,0为正常时间,1为数值型 $user_group="enewsgroupid"; //会员组字段 $user_userfen="enewsuserfen"; //点数字段 $user_userdate="enewsuserdate"; //包月字段 $user_money="enewsmoney"; //帐户余额 $user_todaydate="enewstodaydate"; //下载日期 $user_todaydown="enewstodaydown"; //当天下载次数 $user_groupid=$public_r[defaultgroupid]; //注册时会员组ID(ecms的会员组) //其他设置 $user_seting="discuz.cdb_settings"; //设置表 $forumgroupid=9; //论坛的普通会员组id值 //会员注册地址 $registerurl="http://localhost/discuz/register.php"; //特殊设置(如vbb,molyx) $user_salt="salt"; //salt $user_saltnum=3; //salt随机码字符数 $utfdata=0; //数据是否是utf-8编码,0为正常数据,1为utfdata编码 //-----------------------编码转换 function doUtfAndGbk($str,$phome=0) {global $utfdata; //正常编码 if(empty($utfdata)) { return $str; } //是否支持iconv if(!function_exists("iconv")) { echo"Iconv is not install!"; exit(); } //gbk转utf if(empty($phome)) { $str=iconv("gbk","UTF-8",$str); } //utf转gbk else { $str=iconv("UTF-8","gbk",$str); } return $str; } //-----------------------登录附加cookie function AddLoginCookie($r) { } //-----------------------后台修改资料 function admin_EditMember($add,$logininid,$loginin) {global $empire,$user_tablename,$user_username,$user_userid,$user_password,$user_dopass,$user_group,$user_email,$user_userfen,$user_money,$user_userdate,$user_saltnum,$user_salt; if(!trim($add[userid])||!trim($add[email])||!trim($add[username])||!$add[groupid]) {printerror("EmptyEmail","history.go(-1)");} //验证权限 CheckLevel($logininid,$loginin,$classid,"member"); //变量 $add[userid]=(int)$add[userid]; //编码转换 $dousername=$add[username]; $add[username]=doUtfAndGbk($add[username],0); $add[oldusername]=doUtfAndGbk($add[oldusername],0); $add[password]=doUtfAndGbk($add[password],0); $add[email]=doUtfAndGbk($add[email],0); //修改密码 if($add[password]) { //单重md5 if(empty($user_dopass)) { $add[password]=md5($add[password]); } elseif($user_dopass==2)//双重md5 { $salt=make_password($user_saltnum); $add[password]=md5(md5($add[password]).$salt); $sa=",".$user_salt."='$salt'"; } else {} $add1=",".$user_password."='".$add[password]."'".$sa; } //修改用户名 if($add[oldusername]<>$add[username]) { $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$add[username]' and ".$user_userid."<>'$add[userid]' limit 1"); $add1.=",".$user_username."='$add[username]'"; if($num) { printerror("ReUsername","history.go(-1)"); } } //包月 if($add[userdate]>0) { $userdate=time()+$add[userdate]*24*3600; } //变量 $add[groupid]=(int)$add[groupid]; $add[userfen]=(int)$add[userfen]; $userdate=(int)$userdate; $add[money]=(float)$add[money]; $sql=$empire->query("update ".$user_tablename." set ".$user_email."='$add[email]',".$user_group."=$add[groupid],".$user_userfen."=$add[userfen],".$user_money."=$add[money],".$user_userdate."=$userdate".$add1." where ".$user_userid."='$add[userid]'"); //附加表 $addnum=$empire->gettotal("select count(*) as total from phome_enewsmemberadd where userid='$add[userid]'"); if(empty($addnum)) { $sql1=$empire->query("insert into phome_enewsmemberadd(userid,truename,oicq,msn,`call`,phone,address,zip) values($add[userid],'$add[truename]','$add[oicq]','$add[msn]','$add[call]','$add[phone]','$add[address]','$add[zip]');"); } else { $sql1=$empire->query("update phome_enewsmemberadd set truename='$add[truename]',oicq='$add[oicq]',msn='$add[msn]',`call`='$add[call]',phone='$add[phone]',address='$add[address]',zip='$add[zip]' where userid='$add[userid]'"); } if($sql) { //操作日志 insert_dolog("userid=".$add[userid]."
username=".$dousername); printerror("EditMemberSuccess","ListMember.php"); } else { printerror("DbError","history.go(-1)"); } } //---------------------后台删除会员 function admin_DelMember($userid,$loginuserid,$loginusername) {global $empire,$user_tablename,$user_username,$user_userid; $userid=(int)$userid; if(empty($userid)) {printerror("NotDelMemberid","history.go(-1)");} //验证权限 CheckLevel($loginuserid,$loginusername,$classid,"member"); $r=$empire->fetch1("select ".$user_username." from ".$user_tablename." where ".$user_userid."='$userid'"); $sql=$empire->query("delete from ".$user_tablename." where ".$user_userid."='$userid'"); //删除附加表 $sql1=$empire->query("delete from phome_enewsmemberadd where userid='$userid'"); //删除收藏 $del=$empire->query("delete from phome_enewsfava where userid='$userid'"); $del=$empire->query("delete from phome_enewsfavaclass where userid='$userid'"); if($sql) { $dousername=doUtfAndGbk($r[$user_username],1); //操作日志 insert_dolog("userid=".$userid."
username=".$dousername); printerror("DelMemberSuccess","ListMember.php"); } else { printerror("DbError","history.go(-1)"); } } //--------------------后台批量删除会员 function admin_DelMember_all($userid,$logininid,$loginin) {global $empire,$user_tablename,$user_username,$user_userid; //验证权限 CheckLevel($logininid,$loginin,$classid,"member"); $count=count($userid); if(!$count) { printerror("NotDelMemberid","history.go(-1)"); } $j=0; for($i=0;$i<$count;$i++) { $add.=" ".$user_userid."='$userid[$i]' or"; $adda.=" userid='$userid[$i]' or"; $j++; } $add=substr($add,0,strlen($add)-3); $sql=$empire->query("delete from ".$user_tablename." where".$add); //删除附加表 $sql1=$empire->query("delete from phome_enewsmemberadd where".$adda); //删除收藏 $del=$empire->query("delete from phome_enewsfava where".$add); $del=$empire->query("delete from phome_enewsfavaclass where".$add); if($sql) { //操作日志 insert_dolog(""); printerror("DelMemberSuccess","ListMember.php"); } else { printerror("DbError","history.go(-1)"); } } //---------------取得邮件地址 function GetUserEmail($userid,$username) {global $empire,$user_tablename,$user_email,$user_userid; $r=$empire->fetch1("select ".$user_email." from ".$user_tablename." where ".$user_userid."='$userid' limit 1"); return doUtfAndGbk($r[$user_email],1); } //-------------返回修改资料 function ReturnUserInfo($userid) {global $empire,$user_tablename,$user_userid,$user_username,$user_email,$user_group,$user_userfen,$user_money,$user_userdate,$user_todaydown; $r=$empire->fetch1("select ".$user_username.",".$user_email.",".$user_group.",".$user_userfen.",".$user_money.",".$user_userdate.",".$user_todaydown." from ".$user_tablename." where ".$user_userid."='$userid' limit 1"); $re[username]=doUtfAndGbk($r[$user_username],1); $re[email]=doUtfAndGbk($r[$user_email],1); $re[userfen]=$r[$user_userfen]; $re[money]=$r[$user_money]; $re[groupid]=$r[$user_group]; $re[userdate]=$r[$user_userdate]; $re[todaydown]=$r[$user_todaydown]; return $re; } //--------------取得会员投稿数 function TotalUserNews($userid) {global $empire,$user_tablename; $r=$empire->fetch1("select count(*) as total from phome_enewsnews where userid='$userid' and ismember=1"); return $r[total]; } //------------------用户注册 function register($username,$password,$repassword,$email) {global $empire,$user_tablename,$public_r,$user_groupid,$user_username,$user_userid,$user_email,$user_password,$user_dopass,$user_rnd,$user_registertime,$user_register,$user_group,$user_saltnum,$user_salt,$user_seting,$forumgroupid,$registerurl; //关闭 if($public_r[register_ok]) {printerror("CloseRegister","history.go(-1)");} if(!empty($registerurl)) { Header("Location:$registerurl"); exit(); } $username=trim($username); $password=trim($password); $username=RepPostVar1($username); $password=RepPostVar1($password); if(!$username||!$password||!$email) {printerror("EmptyMember","history.go(-1)");} //用户字数 $pr=$empire->fetch1("select min_userlen,max_userlen,min_passlen,max_passlen from phome_enewspublic limit 1"); $userlen=strlen($username); if($userlen<$pr[min_userlen]||$userlen>$pr[max_userlen]) {printerror("FaiUserlen","history.go(-1)");} //密码字数 $passlen=strlen($password); if($passlen<$pr[min_passlen]||$passlen>$pr[max_passlen]) {printerror("FailPasslen","history.go(-1)");} if($repassword!=$password) {printerror("NotRepassword","history.go(-1)");} if(!chemail($email)) {printerror("EmailFail","history.go(-1)");} $check_r=explode("|",$username); if(count($check_r)!=1) {printerror("NotSpeWord","history.go(-1)");} $username=htmlspecialchars($username); $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$username' limit 1"); if($num) {printerror("ReUsername","history.go(-1)");} if($user_register) { $registertime=time(); $dyh=""; } else { $registertime=date("Y-m-d H:i:s"); $dyh="'"; } $birthday=$y.$m.$d; $rnd=make_password(12);//产生随机密码 $password=str_replace(" ","",$password); //单重md5 if(empty($user_dopass)) { $password=md5($password); } elseif($user_dopass==2) { $salt=make_password($user_saltnum); $password=md5(md5($password).$salt); } $user_groupid=(int)$user_groupid; $email=htmlspecialchars(addslashes($email)); $sql=$empire->query("insert into ".$user_tablename."(".$user_username.",".$user_password.",".$user_email.",".$user_registertime.",".$user_group.",".$user_rnd.") values('$username','$password','$email',".$dyh."$registertime".$dyh.",$user_groupid,'$rnd');"); //取得userid $userid=$empire->lastid(); if($sql) { $set1=setcookie("mloginusername",$username,0,"/",""); $set2=setcookie("mloginuserid",$userid,0,"/",""); $set3=setcookie("mlogingroupid",$user_groupid,0,"/",""); $set4=setcookie("mloginrnd",$rnd,0,"/",""); printerror("RegisterSuccess","../../"); } else {printerror("DbError","history.go(-1)");} } //---------------------信息修改 function EditInfo($password,$repassword,$oldpassword,$email) {global $empire,$user_tablename,$public_r,$user_userid,$user_username,$user_password,$user_dopass,$user_email,$user_salt,$user_saltnum; //是否登陆 $user_r=islogin(); $userid=$user_r[userid]; $username=$user_r[username]; $rnd=$user_r[rnd]; $groupid=$user_r[groupid]; if(!$userid||!$username||!trim($email)) {printerror("NotEmpty","history.go(-1)");} if(!chemail($email)) {printerror("EmailFail","history.go(-1)");} $email=htmlspecialchars(addslashes($email)); $post=$_POST; //编码转换 $username=doUtfAndGbk($username,0); $email=doUtfAndGbk($email,0); //修改密码 if($password) { if($password!=$repassword) {printerror("NotRepassword","history.go(-1)");} $password=doUtfAndGbk($password,0); $oldpassword=doUtfAndGbk($oldpassword,0); //单重加密 if(empty($user_dopass)) { $password=md5($password); $oldpassword=md5($oldpassword); } //双重加密 elseif($user_dopass==2) { $salt=make_password($user_saltnum); $password=md5(md5($password).$salt); $sa=",".$user_salt."='$salt'"; } else {} $num=0; //双重md5 if($user_dopass==2) { $ur=$empire->fetch1("select ".$user_userid.",".$user_salt.",".$user_password." from ".$user_tablename." where ".$user_username."='$username'"); $oldpassword=md5(md5($oldpassword).$ur[$user_salt]); $num=0; if($oldpassword==$ur[$user_password]) {$num=1;} if(empty($ur[$user_userid])) {$num=0;} } else { $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$username' and ".$user_password."='".$oldpassword."'"); } if(!$num) {printerror("FailOldPassword","history.go(-1)");} $add=",".$user_password."='".$password."'".$sa; } $sql=$empire->query("update ".$user_tablename." set ".$user_email."='$email'".$add." where ".$user_userid."='$userid'"); //附加表 $addnum=$empire->gettotal("select count(*) as total from phome_enewsmemberadd where userid='$userid'"); if(empty($addnum)) { $sql1=$empire->query("insert into phome_enewsmemberadd(userid,truename,oicq,msn,`call`,phone,address,zip) values($userid,'$post[truename]','$post[oicq]','$post[msn]','$post[call]','$post[phone]','$post[address]','$post[zip]');"); } else { $sql1=$empire->query("update phome_enewsmemberadd set truename='$post[truename]',oicq='$post[oicq]',msn='$post[msn]',`call`='$post[call]',phone='$post[phone]',address='$post[address]',zip='$post[zip]' where userid='$userid'"); } if($sql) {printerror("EditInfoSuccess","../member/EditInfo");} else {printerror("DbError","history.go(-1)");} } //----------------------------------是否登陆 function islogin() {global $empire,$editor,$user_tablename,$user_userid,$user_group,$user_groupid,$user_rnd; if($editor==2) {$a="../";} $r[userid]=(int)$_COOKIE['mloginuserid']; $r[username]=RepPostVar1($_COOKIE['mloginusername']); $r[rnd]=RepPostVar1($_COOKIE['mloginrnd']); $r[groupid]=RepPostVar1($_COOKIE['mlogingroupid']); if(!$r[userid]||!$r[username]) { $set3=setcookie("return_url",$_SERVER['HTTP_REFERER'],0,"/",""); //printerror("NotLogin",$a."../login"); printerror("NotLogin","history.go(-1)"); } return $r; } //-------------------------------------退出登陆 function loginout1($userid,$username,$rnd) {global $empire,$public_r; //是否登陆 $user_r=islogin(); $set1=setcookie("mloginusername","",0,"/",""); $set2=setcookie("mloginuserid","",0,"/",""); $set4=setcookie("mloginrnd","",0,"/",""); $set3=setcookie("mlogingroupid","",0,"/",""); printerror("ExitSuccess","../../"); } //----------------------------------------登陆 function login1($username,$password,$lifetime,$key,$location) {global $empire,$user_tablename,$user_userid,$user_username,$user_password,$user_dopass,$user_group,$user_groupid,$user_rnd,$public_r,$user_salt,$user_saltnum; if(!trim($username)||!trim($password)) {printerror("EmptyLogin","history.go(-1)");} //验证码 if($public_r[loginkey_ok]) { if($key<>$_COOKIE['checkplkey']||empty($_COOKIE['checkplkey'])) {printerror("FailKey","history.go(-1)");} } $username=RepPostVar1($username); $password=RepPostVar1($password); //编码转换 $utfusername=doUtfAndGbk($username,0); $password=doUtfAndGbk($password,0); if(empty($user_dopass)) {$password=md5($password);} //双重md5 $num=0; if($user_dopass==2) { $ur=$empire->fetch1("select ".$user_userid.",".$user_salt.",".$user_password." from ".$user_tablename." where ".$user_username."='$utfusername'"); $password=md5(md5($password).$ur[$user_salt]); $num=0; if($password==$ur[$user_password]) {$num=1;} if(empty($ur[$user_userid])) {$num=0;} } else { $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$utfusername' and ".$user_password."='".$password."' limit 1"); } if(!$num) { printerror("FailPassword","history.go(-1)"); } $r=$empire->fetch1("select * from ".$user_tablename." where ".$user_username. "='$utfusername' limit 1"); $time=date("Y-m-d H:i:s"); $rnd=make_password(12);//取得随机密码 if(empty($r[$user_group])) {$r[$user_group]=$user_groupid;} $r[$user_group]=(int)$r[$user_group]; $usql=$empire->query("update ".$user_tablename." set ".$user_rnd."='$rnd',".$user_group."=".$r[$user_group]." where ".$user_userid."='$r[$user_userid]'"); $set1=setcookie("mloginusername",$username,0,"/",""); $set2=setcookie("mloginuserid",$r[$user_userid],0,"/",""); $set3=setcookie("mlogingroupid",$r[$user_group],0,"/",""); $set4=setcookie("mloginrnd",$rnd,0,"/",""); //登录附加cookie AddLoginCookie($r); $location=$_COOKIE['return_url']; if(empty($location)) {$location="../../";} if(strstr($_SERVER['HTTP_REFERER'],"e/member/iframe")) {$location="../member/iframe";} $set5=setcookie("checkplkey","",0,"/",""); if($set1&&$set2) { printerror("LoginSuccess",$location); } else { printerror("NotCookie","history.go(-1)"); } } //----------------------------------批量赠送点数 function GetFen_all($cardfen,$userid,$username) {global $empire,$user_tablename,$user_userfen; $cardfen=(int)$cardfen; if(!$cardfen) {printerror("EmptyGetFen","history.go(-1)");} //验证权限 CheckLevel($userid,$username,$classid,"card"); $sql=$empire->query("update ".$user_tablename." set ".$user_userfen."=".$user_userfen."+$cardfen"); if($sql) { //操作日志 insert_dolog("cardfen=$cardfen"); printerror("GetFenSuccess","GetFen.php");} else {printerror("DbError","history.go(-1)");} } //----------------------------------增加点数 function AddInfoFen($cardfen,$userid) {global $empire,$user_tablename,$user_userfen; $cardfen=(int)$cardfen; $sql=$empire->query("update ".$user_tablename." set ".$user_userfen."=".$user_userfen."+".$cardfen." where userid='$userid'"); } ?>
Warning: Cannot modify header information - headers already sent by (output started at F:wwwtesteclassuser.php:6) in F:wwwtesteclassfunctions.php on line 3970
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') as total from' at line 1
select count() as total from




2006-10-27 19:42:26 已设置保密 顶部 回复 引用 报告 编辑 删除

lyerx
用户头衔:进士

精华贴   :0
发贴数   :824
经验值   :2479
注册时间:2006-07-03
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 33 楼]

我的dz超级管理员和ecms的超级管理员是一样的用户名,但是密码不一样,整合之后会有问题么??????整合后到底用哪个登陆啊?




2006-10-28 17:54:12 已设置保密 顶部 回复 引用 报告 编辑 删除

bujigeng
用户头衔:书生

精华贴   :0
发贴数   :4
经验值   :24
注册时间:2006-10-14
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 34 楼]

这个过后看一下




2006-10-28 21:36:52 已设置保密 顶部 回复 引用 报告 编辑 删除

wj3650
用户头衔:举人

精华贴   :0
发贴数   :255
经验值   :773
注册时间:2006-07-17
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 35 楼]

这个好东西呀,要支持啊!



非常迷你

http://www.verymini.com/
2006-10-28 22:42:18 已设置保密 顶部 回复 引用 报告 编辑 删除

chinacc227
用户头衔:进士

精华贴   :0
发贴数   :1113
经验值   :2266
注册时间:2005-11-15
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 36 楼]

什么时候有EBB的,为什么用EBB论坛?因为用帝国的CMS,
为什么会这样?因为这样的话相对帝国的CMS支持就容易一些......



ECMS新手使用交流群:4149731
原帖由 wm_chief 于 2007-07-26 21:15:26 发表


这个EBB和MJJ正好吻合..........
不要再找了,最低价手机在这里!!!!!
2006-10-29 20:29:19 已设置保密 顶部 回复 引用 报告 编辑 删除

laozeng
用户头衔:书生

精华贴   :0
发贴数   :23
经验值   :95
注册时间:2006-07-11
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 37 楼]

整合后,注册时出现这样的问题,是路径的问题吗?应该怎么安装?


Discuz! info: MySQL Query Error

Time: 2006-10-29 9:46pm
Script: /bbs/register.php

SQL: select userid,username,enewsgroupid from 数据库.表名 where userid='2'
Error: Table '数据库.表名' doesn't exist
Errno.: 1146




2006-10-29 21:53:18 已设置保密 顶部 回复 引用 报告 编辑 删除

西瓜太凉
用户头衔:秀才

精华贴   :0
发贴数   :90
经验值   :371
注册时间:2006-10-30
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 38 楼]
[讨论]DZ论坛10.28日发了安全补丁,对整合有影响么?
RT
ht tp : / / ww w. di s cuz . net/thread-436515-1-1.html (复制到IE 中间加了空格)
10月28日 DZ 出了个安全补丁,据说和整合了登陆的站有点影响,跟ecms 有关系么?

顺便再请问一下 ecms整合了dz后 的注册等资料,其实是注册到了dz的数据库是么?
我假如用两个不同的空间 www.your domain .com 和 bbs.your domain .com 整合,那意思是不是就是注册的时候就是数据在bbs 的那个上面,然后登陆 ecms 是先去dz 验证的?
刚接触到 帝国,一下就被迷住了,当时我就说了一句:“相见恨晚,知道有帝国,再用别的cms那我就是傻了”
准备再开个站了 希望 wc 能解释下 到底 your domain .com/bbs 和 bbs.your domian .com 道理能不能一样的
3Q



别看我发帖不多
这才是真正的高级潜水员
2006-10-30 11:08:39 已设置保密 顶部 回复 引用 报告 编辑 删除

wm_chief
用户头衔:管理员

精华贴   :21
发贴数   :48941
经验值   :114161
注册时间:2002-10-30
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 39 楼]

什么时候有EBB的,为什么用EBB论坛?因为用帝国的CMS,
为什么会这样?因为这样的话相对帝国的CMS支持就容易一些......

过后提供。。。



[零基础入门教程] [模板制作教程] [采集使用教程]
2006-10-30 11:11:43 已设置保密 顶部 回复 引用 报告 编辑 删除

wm_chief
用户头衔:管理员

精华贴   :21
发贴数   :48941
经验值   :114161
注册时间:2002-10-30
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 40 楼]

发布补丁不影响



[零基础入门教程] [模板制作教程] [采集使用教程]
2006-10-30 11:12:09 已设置保密 顶部 回复 引用 报告 编辑 删除
 4/27    |‹ ‹‹ 2 3 4 5 6 7 8 9 10 11 ›› ›|

快速回复
内容

表情
使用EBB代码 使用smile代码 显示签名 自动分析url 自动分析img
     【进入高级模式】   (按 Ctrl+Enter 直接提交)
    顶部  加入收藏夹
关于帝国 | 广告服务 | 联系我们 | 法律声明 | 隐私条款 | 许可协议
Powered by: EBB Version 2.2.1