在帝国CMS后台增加手动添加会员功能

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

后台手动增加会员的功能

具体修改了两个文件,AddMember.php和ListMember.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,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("密码不能为空",1); 

}

else
{

   $salt=eReturnMemberSalt();

   $add[password]=eDoMemberPw($add[password],$salt);  

}

if(!trim($add[email]))

{

printerror("邮箱不能为空",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);

}
    else

{

printerror("DbError","history.go(-1)");

}

}

---------------------------------------------------------------------

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

//增加会员

if($enews=="AddMember")

{

$add=$_POST['add'];

admin_AddMember($add,$loginin);

}

-------------------------------------------------------------------------

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

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

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

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

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

=======================================================================

2、在AddMember.php添加代码

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

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

------------------------------------------------------------------------

②、在最下面查找" <?php " 或 " db_close() " 在其上面添加以下代码:

<?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('ListMemberGroup.php');"> 

      </td>

      <td height="25"><select name="add[groupid]" size="6" id="add[groupid]" onchange="self.location.href='AddMember.php?enews=AddMember&changegroupid='+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">&nbsp;</td>

      <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>

    </tr>

  </table>

</form>

</body>

</html>

<?php

}

?>

二、使用方法:

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


1、想好字段名! 这里取一个test 商品发布模板:post_trade.htm 在商品发布模板贴内新建一个文本框!
一、后台 → 全局 → 关闭站点(为了不影响数据库备份) 二、数据备份
<?php /** [Discuz!] (C) 2001-2099 Comsenz Inc. config_global.php Build at 2012-07-06 10:16:22 */
今天给大家讲讲 如何把已经切割好的html页面或者模仿的页面转换成可供DIY的页面
打开网站根目录下/template/default/common header_common.htm文件找到 <title><!--{if !empty($navtitle)}-->$navtitle - <!--{/if}--><!--{if empty($nobbname)}--> $_G['se
打开网站根目录/source/module/portal/portal_list.php搜 category_get_list 在里面加入以下代码:添加一下代码
请问discuz的右侧工具栏(有回到顶部,返回板块),但是我想再添加点东西,可是我百度了,也从源码里找了好久,都没找到解决方法,请问可以教一下吗?
这里建议直接使用163邮箱,因为 我测试了 qq邮箱,yeah邮箱 均不能用。 第一步 去163注册一个邮箱,具体怎么注册 想必大家都会。注册好进入163 看下图
这些天百度和google了不知道多少遍,发现discuz的官方文档和二次开发资料少得可怜。调用个编辑器这样采用的功能官方文档居然没有,网友的分享多少也有些不完整;中途差点放弃。最后实在没办法兼不甘心,自己啃源码去
UPDATE `表名称` SET `click` = click+ROUND(RAND() * 6666+ 666) WHERE `click` <5000 复制代码
discuz在数据库批量更新(替换)板块id(fid/gid) UPDATE `fx_forum_thread` SET `fid` = replace(fid,'2','52') WHERE `fid` =2
想在自己的写上置顶的帖子    <div class="announcement_con"> <ul>
进入网站目录:/source/include/post 找到:post_newthread.php备份:post_newthread.php编辑:post_newthread.php搜索:
C::t('forum_attachment')->fetch_all_by_id('aid',$v['tid'] ); 执行上面的代码,会返回对应帖子的附件信息!
版本 dx 3.3 估计3.4一样有这个问题,ie内核的浏览器下在上传后,缩略图都是显示xx。这个问题主要还是https下,对图片输出的时候 不能使用
论坛人气弱?想改阅读数的站长可以围观! 找到:source/module/forum/forum_viewthread.php文件搜索代码:
<!--{if $allowpostreply && !$_G['forum_thread']['archiveid']}--> <a id="post_reply" onclick="showWindow('reply','forum.php?mod=post
SQL语句 UPDATE 表名称 SET 字段名 = REPLACE( 字段名,  '旧字符串',  '新的字符串' )
discuz 帖子内容页面的,上一篇,下一篇代码 上一篇: <a href="forum.php?mod=redirect&goto=nextoldset&tid=$_G[tid]" title="{lang last_thread}"><img src=&quo
1.php文件内判断 if(!$_G['uid']) {                         showmessage('to_login','',arra