⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user.php

📁 软件类别: PHP源码 / 文章管理 软件语言: 简体中文 授权方式: 商业版 文件大小: 308K
💻 PHP
📖 第 1 页 / 共 3 页
字号:
<?php/*======================================================================*\|| #################################################################### |||| # VirtuaNews - 1.0.4 Pro   License ID - [WDYL-WTN]|| # ---------------------------------------------------------------- # |||| # All code in this file is ?2002 VirtuaSystems    .               # |||| # This file may not be redistributed in whole or significant part. # |||| # --------------- VIRTUANEWS IS NOT FREE SOFTWARE ---------------- # |||| # http://www.virtuanews.co.uk                                      # |||| # http://www.virtuanews.co.uk/license.php                         # |||| #################################################################### ||\*======================================================================*/if (preg_match("/(admin\/user.php)/i",$PHP_SELF)) {  header("location:../admin.php");  exit;}if ($use_forum) {  adminerror("Not Using VirtuaNews User Tables","This site is currently set to use the user tables from the forums on this site.  To edit the users you must use the administration panel for the forums.");}updateadminlog(iif($id,"id = $id",""));switch ($action) {case "user":  echohtmlheader("adminjs");  $data_arr = query_first("SELECT count(userid) AS count FROM news_user WHERE moderated = 0");  if ($data_arr[count]) {    echotableheader("Moderate Users",1);    echotabledescription("There are currently $data_arr[count] users awaiting moderated.  To moderate them please go <a href=\"admin.php?action=user_mod\">here</a>.",1);    echotablefooter();    echo "<br />\n";  }  echoformheader("user_dosearch","编辑用户");  echotabledescription("你能使用这页搜索用户并进行编辑他们的帐号信息.  输入搜索条件并按submit键 (栏目空白将不受理).");  echoinputcode("姓名:","name","",40,1,40);  echoinputcode("信箱地址:","email","",40,1);  echoinputcode("主页:","homepage","",40,1);  echoinputcode("OICQ:","oicq","",40,1);  echoinputcode("AOL:","aim","",40,1);  echoinputcode("Yahoo:","yahoo","",40,1);  echoinputcode("帖子小于:","posts_max","",40,1);  echoinputcode("帖子大于:","posts_min","",40,1);  echo "  <tr>    <td>禁止:</td>    <td>      <select name=\"isbanned\" class=\"form\">        <option value=\"any\">--- Any ---</option>        <option value=\"1\">Yes</option>        <option value=\"0\">No</option>      </select>    </td>  </tr>  <tr>    <td>Is Moderated:</td>    <td>      <select name=\"ismoderated\" class=\"form\">        <option value=\"any\">--- Any ---</option>        <option value=\"1\">Yes</option>        <option value=\"0\">No</option>      </select>    </td>  </tr>  <tr>    <td>激活信箱:</td>    <td>      <select name=\"activatedemail\" class=\"form\">        <option value=\"any\">--- Any ---</option>        <option value=\"1\">Yes</option>        <option value=\"0\">No</option>      </select>    </td>  </tr>\n";  $getdata = query("SELECT id,title FROM news_profilefield ORDER BY displayorder");  while ($field = fetch_array($getdata)) {    echoinputcode($field[title]." contains:","customfield[$field[id]]","",40,1);  }  echoformfooter();  echohtmlfooter();break;case "user_dosearch":  unset($sql_arr);  unset($sqlcondition);  if ($name != "") {    $sql_arr[] = "(news_user.username LIKE '%$name%')";  }  if ($email != "") {    $sql_arr[] = "(news_user.email LIKE '%$email%')";  }  if ($homepage != "") {    $sql_arr[] = "(news_user.homepage LIKE '%$homepage%')";  }  if ($oicq != "") {    $sql_arr[] = "(news_user.oicq LIKE '%$oicq%')";  }  if ($aim != "") {    $sql_arr[] = "(news_user.aim LIKE '%$aim%')";  }  if ($yahoo != "") {    $sql_arr[] = "(news_user.yahoo LIKE '%$yahoo%')";  }  if ($posts_min != "") {    $sql_arr[] = "(news_user.posts > ".intval($posts_min).")";  }  if ($posts_max != "") {    $sql_arr[] = "(news_user.posts < ".intval($posts_max).")";  }  if ($isbanned != "any") {    $sql_arr[] = "(news_user.isbanned = $isbanned)";  }  if ($ismoderated != "any") {    $sql_arr[] = "(news_user.moderated = $ismoderated)";  }  if ($activatedemail != "any") {    $sql_arr[] = "(news_user.activated = $activatedemail)";  }  $getdata = query("SELECT id,title FROM news_profilefield ORDER BY displayorder");  while ($field = fetch_array($getdata)) {    if ($customfield[$field[id]] != "") {      $sql_arr[] = "(news_userfield.field$field[id] LIKE '%".$customfield[$field[id]]."%')";    }  }  if ($sql_arr) {    $sqlcondition = " WHERE ".join(" AND ",$sql_arr);  }  $getdata = query("SELECT news_user.userid,news_user.username,news_user.activated,news_staff.id FROM news_user LEFT JOIN news_staff USING(userid) LEFT JOIN news_userfield USING(userid)$sqlcondition ORDER BY news_user.username");  echohtmlheader();  echotableheader("编辑用户",1);  echotabledescription("你的搜索返回 ".countrows($getdata)." result(s).  To continue please click the appropriate link next to the user you wish to edit.",1);  echotabledescription(returnlinkcode("再次搜索","admin.php?action=user"),1);  $tablerows = returnminitablerow("<b>姓名</b>","<b>选项</b>");  while ($data_arr = fetch_array($getdata)) {    $tablerows .= returnminitablerow(htmlspecialchars($data_arr[username]),returnlinkcode("编辑","admin.php?action=user_edit&id=$data_arr[userid]")." |".returnlinkcode("用户信箱","admin.php?action=user_email&id=$data_arr[userid]")." |".returnlinkcode("显示短消息","admin.php?action=user_pmuserlist&id=$data_arr[userid]").iif($data_arr[userid] != $userid," |".returnlinkcode("删除","admin.php?action=user_delete&id=$data_arr[userid]"))." |".returnlinkcode("信箱密码","user.php?action=pwd_email&name=".urlencode($data_arr[username]),1).iif($data_arr[activated] == 0," |".returnlinkcode("信箱激活资料","admin.php?action=user_emailactivate&id=$data_arr[userid]")).iif(!$data_arr[id] & $userinfo[caneditstaff]," |".returnlinkcode("添加管理员","admin.php?action=staff_add&id=$data_arr[userid]")).iif($userinfo[canmaintaindb]," |".returnlinkcode("剪除用户简介","admin.php?action=maintain_user_c&id=$data_arr[userid]")));  }  echotabledescription("\n".returnminitable($tablerows,0,100)."    ",1);  echotablefooter();  echohtmlfooter();break;case "user_mod":  $getdata = query("SELECT userid,username,email FROM news_user WHERE moderated = 0 ORDER BY username");  $javascript = "  <script type=\"text/javascript\">  function ca(theform) {    var i=0;    for (var i=0;i<theform.elements.length;i++) {      if ((theform.elements[i].name != 'checkall') && (theform.elements[i].type=='checkbox')) {        theform.elements[i].checked = theform.checkall.checked;      }    }  }  </script>";  echohtmlheader($javascript);  if (countrows($getdata)) {    echoformheader("user_domod","Moderate Users");    echotabledescription("The list below is a list of new users which have yet to be moderated.  If you wish to moderate a user, then check allow, otherwise check delete to remove the user.  Once you have completed, please click submit to save the changes.");    $tablerows = returnminitablerow("<b>姓名</b>","<b>选项</b>","<input type=\"checkbox\" name=\"checkall\" value=\"1\" onclick=\"ca(this.form)\"> <b>Moderate</b>");    while ($data_arr = fetch_array($getdata)) {      $tablerows .= returnminitablerow(htmlspecialchars($data_arr[username]),returnlinkcode("Edit Profile","admin.php?action=user_edit&id=$data_arr[userid]",1)." |".returnlinkcode("删除","admin.php?action=user_delete&id=$data_arr[userid]"),"<input type=\"checkbox\" name=\"users[$data_arr[userid]]\" value=\"1\" />");    }    echotabledescription("\n".returnminitable($tablerows,0,100)."    ");    echotablefooter();    echo "<br />";    echotableheader("发信到有效用户");    echotabledescription("这封信将发送到所有用户请确认.");    echoinputcode("邮件标题:","email_subject","帐号说明\$sitename");    echotextareacode("邮件通知:","email_msg",returnpagebit("register_email_moderated"),10,75);    echoformfooter();  } else {    echotableheader("Moderate Users");    echotabledescription("Currently there are no users awaiting moderation and there is nothing to do here.");    echotablefooter();  }  echohtmlfooter();break;case "user_domod":  unset($user_ids);  if (count($users) > 0) {    foreach ($users AS $key => $val) {      if ($val == 1) {        $user_ids[] = intval($key);      }    }  }  if ($user_ids) {    query("UPDATE news_user SET moderated = 1 WHERE userid IN (".join(",",$user_ids).")");    $getdata = query("SELECT activated,username,email FROM news_user WHERE userid IN (".join(",",$user_ids).")");    while ($data_arr = fetch_array($getdata)) {      if ($data_arr[activated]) {        $name = $data_arr[username];        $email = $data_arr[email];        eval("\$email_subject = \"".$email_subject."\";");        eval("\$email_msg = \"".$email_msg."\";");        mail($email,$email_subject,$email_msg,"来自: $sitename 发信人 <$webmasteremail>");      }    }  }  writeallpages();  echoadminredirect("admin.php?action=user_mod");  exit;break;case "user_add":  echohtmlheader();  echoformheader("user_new","添加用户");  echotabledescription("在你的站通过这页添加用户.  请注意, using this form to create a new user will mean that users are automatically moderated andtheir email address will not need activating (if enabled).");  echoinputcode("姓名:","name");  echoinputcode("密码:","loginpassword");  echoinputcode("信箱地址:","email");  echoinputcode("主页:","homepage","http://",40,1);  echoinputcode("oicq:","oicq","",40,1);  echoinputcode("AOL:","aim","",40,1);  echoinputcode("Yahoo:","yahoo","",40,1);  echotextareacode("签名:","signature","",5,40,1);  echoyesnocode("隐藏信箱:","hideemail",0);  echoyesnocode("默认信箱公开:","emailnotification",$emailreplydefault);  echoyesnocode("查看用户签名:","viewsigs",$allowusersigs);  echoyesnocode("使用短消息系统:","allowpm",iif($allowpms == 2,1,0));  echoyesnocode("信箱和新短消息:","emailpm",$enableemail);  echoyesnocode("评论默认显示:","commentdefault",$commentreplydefault-1,"全部显示","全部隐藏");  echoyesnocode("禁止:","isbanned",0);  $getdata = query("SELECT id,title,description,required,maxlength,size,hidden FROM news_profilefield ORDER BY displayorder");  while ($field = fetch_array($getdata)) {    echoinputcode($field[title].":","customfield[$field[id]]","",$field[size],iif($field[required],0,1));  }  echoyesnocode("添加用户到管理员:","addstaff",0);  echotablefooter();  echo "<br />";  echotableheader("信箱资料 - 发送给新用户");  echoinputcode("标题:","email_subject",returnpagebit("register_email_details_subject"));  echotextareacode("短消息:","email_msg",returnpagebit("register_email_details_msg"),10,50);  echoformfooter();  echohtmlfooter();break;case "user_new":  if (($email == "") | ($emailnotification == "") | ($commentdefault == "") | ($hideemail == "") | ($viewsigs == "") | ($name == "")) {    adminerror("空白栏目","所有栏目必须填写, 只有一个 <span class=\"red\">(可选)</span> 可以留空");  }  if ($requireuniqueemail) {    if (query_first("SELECT userid FROM news_user WHERE email = '$email'")) {      adminerror("信箱存在","这个信箱地址已经存在,你不能使用同一个信箱");    }  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -