通過本教程可以實現帝國CMS會員注冊成功后,不同的會員組注冊成功后轉到不同的地址,如,普通會員注冊轉到網站首頁,VIP會員轉到VIP介紹頁面。
第一步:
打開 /e/member/class/member_registerfun.php 文件
約第175行那段代碼,修改成如下代碼:
- //審核
- if($checked==0)
- {
- $location=DoingReturnUrl("../../",$_POST['ecmsfrom']);
- printerror("RegisterSuccessCheck",$location,1);
- }
- $logincookie=0;
- if($ecms_config['member']['regcookietime'])
- {
- $logincookie=time()+$ecms_config['member']['regcookietime'];
- }
- $r=$empire->fetch1("select".eReturnSelectMemberF('*')."from".eReturnMemberTable()."where".egetmf('userid')."='$userid'limit1");
- $set1=esetcookie("mlusername",$username,$logincookie);
- $set2=esetcookie("mluserid",$userid,$logincookie);
- $set3=esetcookie("mlgroupid",$groupid,$logincookie);
- $set4=esetcookie("mlrnd",$rnd,$logincookie);
- //驗證符
- qGetLoginAuthstr($userid,$username,$rnd,$groupid,$logincookie);
- //登錄附加cookie
- AddLoginCookie($r);
- if($groupid==1)
- {
- $location="地址1";
- }
- elseif($groupid==2)
- {
- $location="地址2";
- }
- $returnurl=getcvar('returnurl');
- if($returnurl&&!strstr($returnurl,"e/member/iframe")&&!strstr($returnurl,"e/member/register")&&!strstr($returnurl,"enews=exit"))
- {
- $location=$returnurl;
- }
- $set5=esetcookie("returnurl","");
- //易通行系統
- DoEpassport('reg',$userid,$username,$truepassword,$salt,$email,$groupid,$registertime);
- $location=DoingReturnUrl($location,$_POST['ecmsfrom']);
- printerror("RegisterSuccess",$location,1);
- }
- else
- {printerror("DbError","history.go(-1)",1);}
- }
- ?>
其中的:
- if($groupid==1)
- {
- $location="地址1";
- }
- elseif($groupid==2)
- {
- $location="地址2";
- }