搜索
首页CMS教程帝国CMS帝国cms怎么添加vip

帝国cms怎么添加vip

Jul 19, 2019 pm 01:47 PM
帝国cms

帝国cms怎么添加vip

推案教程:帝国cms教程

由于帝国CMS后台没有增加会员的功能,所以做了此教程!请有需要的小伙伴备份文件然后测试修改!

后台手动增加会员的功能

具体修改了两个文件,AddMember.phpListMember.php在e/admin/member/目录

一、修改方法:

1、在ListMember.php添加代码

  ①、查找" //修改会员 " 在其上面添加以下代码:

//增加会员函数    
    
   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)");     
       }     
    }

  ②、查找" //删除会员 " 在其上面添加以下代码:    

//增加会员    
   if($enews=="AddMember")    
   {      
   $add=$_POST['add'];    
   admin_AddMember($add,$logininid,$loginin);    
   }

  ③、查找" 位置 " ,找到后继续向下看有"注册会员"或"前台会员列表"

<input type="button" name="Submit5" value="注册会员" onclick="window.open(&#39;../../member/register/&#39;);">

<input type="button" name="Submit5" value="前台会员列表" onclick="window.open(&#39;../../member/list/&#39;);">

在"注册会员"或"前台会员列表",他两个的任意一个上面添加以下代码:

<input type="button" name="Submit5" value="增加会员"onclick="self.location.href=&#39;AddMember.php?enews=AddMember&#39;;">

2、在AddMember.php添加代码

  ①、查找" //取得表单 " 在其上面添加以下代码

    
  <?php    
   if($enews=="EditMember")    
   {    ?>

  ②、在最下面查找"

<?php     
   }       
   elseif($enews=="AddMember")    
  {    
   ?>    
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">    
   <html>    
   <head>    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">    
  <title>增加会员</title>    
       <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet"type="text/css">    
    </head>    
    <body>    
   <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">    
    <tr>    
       <td>位置:<?=$url?></td>    
     </tr>    
    </table>    
    <form name="form1" method="post" action="ListMember.php" enctype="multipart/form-data">    
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1"class="tableborder">    
      <tr class="header">    
        <td height="25" colspan="2">增加会员    
           <input name="enews" type="hidden" id="enews" value="<?=$enews?>">    
          </td>    
       </tr>    
      <tr bgcolor="#FFFFFF">    
       <td width="25%" height="25">用户名</td>    
          <td width="75%" height="25"><input name="add[username]" type=text id="add[username]"></td>    
        </tr>    
        <tr bgcolor="#FFFFFF">    
          <td height="25">密码</td>    
          <td height="25"><input name="add[password]" type="password" id="add[password]">    
          </td>    
       </tr>    
        <tr bgcolor="#FFFFFF">    
          <td height="25" valign="top">所属会员组<br> <br> <input type="button" name="Submit3"value="管理会员组" onclick="window.open(&#39;ListMemberGroup.php&#39;);">    
          </td>    
          <td height="25"><select name="add[groupid]" size="6" id="add[groupid]"onchange="self.location.href=&#39;AddMember.php?enews=AddMember&changegroupid=&#39;+this.options[this.selectedIndex].value;">    
              <?=$group?>    
            </select></td>    
        </tr>    
        <tr bgcolor="#FFFFFF">    
          <td height="25">邮箱</td>    
          <td height="25"><input name="add[email]" type="text" id="add[email]" size="35"></td>    
        </tr>    
        <tr bgcolor="#FFFFFF">    
          <td height="25"> </td>    
          <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset"name="Submit2" value="重置"></td>    
        </tr>    
      </table>    
    </form>    
    </body>    
    </html>    
    <?php    
    }    
    ?>

二、使用方法:

    后台--用户--会员管理--管理会员--增加会员

以上是帝国cms怎么添加vip的详细内容。更多信息请关注PHP中文网其他相关文章!

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

WebStorm Mac版

WebStorm Mac版

好用的JavaScript开发工具