Home>Article>CMS Tutorial> How to add VIP to Empire CMS
Proposal tutorial:Empire cms tutorial
Because of the Empire CMS background There is no function to add members, so I made this tutorial! Friends who need it, please back up the files and test the modifications!
The function of manually adding members in the background
Specifically modified two files,AddMember.php
andListMember.php
(in e /admin/member/directory)
1. Modification method:
1. In ListMember. PHP add code
①、Look for " //Modify member" and add the following code above it:
//增加会员函数 function admin_AddMember($add,$logininid,$loginin){ global $empire,$dbtbpre; if(!trim($add[username])) { printerror("用户名不能为空","history.go(-1)",1,0,1); }else{ $num=$empire->gettotal("select count(*) as total from ".eReturnMemberTable()." where ".egetmf('username')."='$add[username]' limit 1"); if($num) { printerror("ReUsername","history.go(-1)"); } } if(!trim($add[password])) { printerror("密码不能为空","history.go(-1)",1,0,1); } else { $salt=eReturnMemberSalt(); $add[password]=eDoMemberPw($add[password],$salt); } if(!trim($add[email])) { printerror("邮箱不能为空","history.go(-1)",1,0,1); } CheckLevel($logininid,$loginin,$classid,"member");//验证权限 $checked=1; //变量 $add[groupid]=(int)$add[groupid]; //$registertime=time(); $registertime=eReturnAddMemberRegtime(); $rnd=make_password(20);//产生随机密码 $userkey=eReturnMemberUserKey(); //写入数据库 $sql=$empire->query("insert into {$dbtbpre}enewsmember(userid,username,password,rnd,email,registertime,groupid,checked,salt,userkey) values(NULL,'".addslashes($add[username])."','".addslashes($add[password])."','$rnd','".addslashes($add[email])."','$registertime','".addslashes($add[groupid])."','$checked','$salt','$userkey');"); if($sql) { insert_dolog("添加会员".$add[username]);//操作日志 printerror("添加会员成功","ListMember.php",1,0,1); }else { printerror("DbError","history.go(-1)"); } }
②、Find " //Delete member" Add the following code above it:
//增加会员 if($enews=="AddMember") { $add=$_POST['add']; admin_AddMember($add,$logininid,$loginin); }
③. Search for "Location". After finding it, continue to look down to see "Registered Member" or "Front Desk Member List"
or
Add the following code to either of the "Registered Members" or "Front Desk Member List":
2. Add the code in AddMember.php
①Find "//Get the form" and add the following code
②. Look for "
增加会员
位置:=$url?>
二, Usage:
Backend--User--Member Management--Manage Member--Add Member
The above is the detailed content of How to add VIP to Empire CMS. For more information, please follow other related articles on the PHP Chinese website!