search
HomeCMS TutorialEmpire CMSHow to add VIP to Empire CMS

How to add VIP to Empire CMS

Jul 19, 2019 pm 01:47 PM
Empire cms

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 and ListMember.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"

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

or

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

Add the following code to either of the "Registered Members" or "Front Desk Member List":

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

2. Add the code in AddMember.php

 ①Find "//Get the form" and add the following code

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

 ②. Look for "

<?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    
    }    
    ?>

二, 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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)