📄 staff.php
字号:
<?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\/staff.php)/i",$PHP_SELF)) { header("location:../admin.php"); exit;}updateadminlog(iif($id,"id = $id",""));switch ($action) {case "staff": echohtmlheader(); echotableheader("编辑管理员",1); echotabledescription("下面显示当前所有的管理员, 编辑他们请点击你想编辑的名字的连接",1); echotabledescription(returnlinkcode("添加管理员","admin.php?action=staff_search_form"),1); $tablerows = returnminitablerow("<b>姓名</b>","<b>新闻编号</b>","<b>选项</b>"); $getdata = query("SELECT news_staff.id,news_staff.userid,news_staff.newsposts,".$foruminfo[user_table].".".$foruminfo[username_field]." AS username FROM news_staff LEFT JOIN ".$foruminfo[user_table]." ON news_staff.userid = ".$foruminfo[user_table].".".$foruminfo[userid_field]." ORDER BY ".$foruminfo[user_table].".".$foruminfo[username_field]); while ($data_arr = fetch_array($getdata)) { $tablerows .= returnminitablerow(htmlspecialchars($data_arr[username]),"$data_arr[newsposts] ",returnlinkcode("编辑","admin.php?action=staff_edit&id=$data_arr[id]")." | ".returnlinkcode("删除","admin.php?action=staff_delete&id=$data_arr[id]")); } echotabledescription("\n".returnminitable($tablerows,0,100)." ",1); echotablefooter(); echohtmlfooter();break;case "staff_edit": settype($id,"integer"); if ($data_arr = query_first("SELECT news_staff.*,".$foruminfo[user_table].".".$foruminfo[username_field]." AS username FROM news_staff LEFT JOIN $foruminfo[user_table] ON news_staff.userid = ".$foruminfo[user_table].".".$foruminfo[userid_field]." WHERE news_staff.id = $id")) { echohtmlheader("adminjs"); echoformheader("staff_update","编辑管理员"); updatehiddenvar("id",$id); echotabledescription(returnlinkcode("选择全部","javascript:ca()")." | ".returnlinkcode("取消全部选择","javascript:cn()")); echotablerow("姓名:",htmlspecialchars($data_arr[username])); echoinputcode("工作:","job",$data_arr[job]); foreach ($cat_arr AS $key => $val) { if ($val[parentid] == 0) { echoyesnocode("Able to post $val[name] news?","canpost_$key",$data_arr[canpost_.$key]); } } echoyesnocode("编辑所有分类的评论?","caneditallcomments",$data_arr[caneditallcomments]); echoyesnocode("维护数据库?","canmaintaindb",$data_arr[canmaintaindb]); echoyesnocode("编辑所有新闻?","caneditallnews",$data_arr[caneditallnews]); echoyesnocode("把新闻置顶?","canmakesticky",$data_arr[canmakesticky]); echoyesnocode("编辑删除新闻日志?","candeletelogos",$data_arr[candeletelogos]); echoyesnocode("查看管理日志?","canviewlog",$data_arr[canviewlog]); echoyesnocode("编辑管理员?","caneditstaff",$data_arr[caneditstaff]); echoyesnocode("编辑投票?","caneditpolls",$data_arr[caneditpolls]); echoyesnocode("编辑新闻分类?","caneditcategories",$data_arr[caneditcategories]); echoyesnocode("编辑文章?","caneditarticles",$data_arr[caneditarticles]); echoyesnocode("编辑站点设置?","caneditoptions",$data_arr[caneditoptions]); echoyesnocode("编辑表情?","caneditsmilies",$data_arr[caneditsmilies]); echoyesnocode("编辑文件区域?","caneditprofilefields",$data_arr[caneditprofilefields]); echoyesnocode("编辑用户?","caneditusers",$data_arr[caneditusers]); echoyesnocode("编辑风格?","caneditthemes",$data_arr[caneditthemes]); echoyesnocode("编辑模块?","caneditmodules",$data_arr[caneditmodules]); $getmods = query("SELECT name,text FROM news_module"); while ($mod_arr = fetch_array($getmods)) { echoyesnocode("编辑模块 $mod_arr[text]?","caneditmod_$mod_arr[name]",$data_arr[caneditmod_.$mod_arr[name]]); } echoformfooter(); echohtmlfooter(); } else { adminerror("无效ID","你指定了一个id."); }break;case "staff_update": verifyid("news_staff",$id); if ($job == "") { adminerror("空白区域","所有区域必须填写, 只有一个 <span class=\"red\">(可选)</span> 可以留空"); } $getfields = query("SHOW FIELDS FROM news_staff"); while ($field_arr = fetch_array($getfields)) { if (($field_arr[Field] != "id") & ($field_arr[Field] != "userid") & ($field_arr[Field] != "job") & ($field_arr[Field] != "新闻帖子")) { $sql .= ",\n $field_arr[Field] = '".${$field_arr[Field]}."'"; } } query(" UPDATE news_staff SET job = '$job'$sql WHERE id = $id"); writeallpages(); echoadminredirect("admin.php?action=staff"); exit;break;case "staff_delete": verifyid("news_staff",$id); echodeleteconfirm("管理员成员","staff_kill",$id);break;case "staff_kill": verifyid("news_staff",$id); query("DELETE FROM news_staff WHERE id = $id"); writeallpages(); echoadminredirect("admin.php?action=staff"); exit;break;case "staff_search_form": echohtmlheader(); echoformheader("staff_search","添加管理员"); echotabledescription("在会员中搜索"); echoinputcode("姓名:","searchname"); echoyesnocode("搜索类型:","searchtype",1,"精确查找","<br />关键字 搜索"); echoformfooter(); echohtmlfooter();break;case "staff_search": $condition = iif($searchtype == 1,"= '$searchname'","LIKE '%$searchname%'"); $getdata = query("SELECT ".$foruminfo[user_table].".".$foruminfo[username_field]." AS username,".$foruminfo[user_table].".".$foruminfo[userid_field]." AS userid,".$foruminfo[user_table].".".$foruminfo[email_field]." AS email,news_staff.id FROM $foruminfo[user_table] LEFT JOIN news_staff ON ".$foruminfo[user_table].".".$foruminfo[userid_field]." = news_staff.userid WHERE ".$foruminfo[user_table].".".$foruminfo[username_field]." $condition ORDER BY ".$foruminfo[user_table].".".$foruminfo[username_field]); $num_found = countrows($getdata); $users_found = returnminitablerow("<b>姓名</b>","<b>信箱</b>","<b>会员id</b>","<b>选项</b>"); while ($data_arr = fetch_array($getdata)) { if ($data_arr[id]) { $num_found --; } else { $users_found .= returnminitablerow(htmlspecialchars($data_arr[username]),returnlinkcode($data_arr[email],"mailto:$data_arr[email]"),$data_arr[userid],returnlinkcode("添加","admin.php?action=staff_add&id=$data_arr[userid]")); } } echohtmlheader(); echotableheader("添加管理员",1); echotabledescription("你搜索完成 $num_found result(s) (注意,你查找的用户名可能已经被添加,没有被找到。)",1); echotabledescription("\n".returnminitable($users_found,0,100)." ",1); echotabledescription("点 ".returnlinkcode("这","javascript:history.back(1)")." 返回并精确搜索",1); echotablefooter(); echohtmlfooter();break;case "staff_add": verifyid($foruminfo[user_table],$id,$foruminfo[userid_field]); if ($staff_presant = query_first("SELECT userid FROM news_staff WHERE userid = $id")) { adminerror("成员已经添加","这个成员已经添加到数据库"); } $data_arr = query_first("SELECT $foruminfo[username_field] AS username FROM $foruminfo[user_table] WHERE $foruminfo[userid_field] = $id"); echohtmlheader("adminjs"); echoformheader("staff_new","添加管理员"); updatehiddenvar("id",$id); echotabledescription(returnlinkcode("选择全部","javascript:ca()")." | ".returnlinkcode("取消选定","javascript:cn()")); echotablerow("姓名:",htmlspecialchars($data_arr[username])); echoinputcode("工作:","job"); foreach ($cat_arr AS $key => $val) { if ($val[parentid] == 0) { echoyesnocode("Able to post $val[name] news?","canpost_$key",1); } } echoyesnocode("编辑所有分类的评论?","caneditallcomments",0); echoyesnocode("维护数据库?","canmaintaindb",0); echoyesnocode("编辑所有新闻?","caneditallnews",0); echoyesnocode("把新闻置顶?","canmakesticky",0); echoyesnocode("编辑删除新闻日志?","candeletelogos",0); echoyesnocode("查看管理日志?","canviewlog",0); echoyesnocode("编辑管理员?","caneditstaff",0); echoyesnocode("编辑投票?","caneditpolls",0); echoyesnocode("编辑新闻分类?","caneditcategories",0); echoyesnocode("编辑文章?","caneditarticles",0); echoyesnocode("编辑站点设置?","caneditoptions",0); echoyesnocode("编辑表情?","caneditsmilies",0); echoyesnocode("编辑文件区域?","caneditprofilefields",0); echoyesnocode("编辑用户?","caneditusers",0); echoyesnocode("编辑风格?","caneditthemes",0); echoyesnocode("编辑模块?","caneditmodules",0); $getmods = query("SELECT name,text FROM news_module"); while ($mod_arr = fetch_array($getmods)) { echoyesnocode("Able to edit module $mod_arr[text]?","caneditmod_$mod_arr[name]",0); } echoformfooter(); echohtmlfooter();break;case "staff_new": verifyid($foruminfo[user_table],$id,$foruminfo[userid_field]); if ($job == "") { adminerror("空白区域","所有区域必须填写, 只有一个 <span class=\"red\">(可选)</span> 可以留空"); } if ($staff_presant = query_first("SELECT userid FROM news_staff WHERE userid = $id")) { adminerror("成员已经添加","这个成员已经添加到数据库"); } $getfields = query("SHOW FIELDS FROM news_staff"); while ($field_arr = fetch_array($getfields)) { if (($field_arr[Field] != "id") & ($field_arr[Field] != "userid") & ($field_arr[Field] != "job") & ($field_arr[Field] != "newsposts")) { $sql .= ",\n '".${$field_arr[Field]}."'"; } } query(" INSERT INTO news_staff VALUES ( NULL, '$id', '$job', '0'$sql)"); writeallpages(); echoadminredirect("admin.php?action=staff"); exit;break;default: adminerror("无效连接","你跳转到一个无效的连接");}/*======================================================================*\|| ####################################################################|| # VirtuaNews is not free software|| # Downloaded: [WDYL-WTN]|| # File: admin/staff.php|| ####################################################################\*======================================================================*/?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -