📄 banlist.php
字号:
<?php
include_once('init.php');
if(!inSession()) {
include('login.php');
exit;
}
$req = array_merge($_GET, $_POST);
if(isset($_REQUEST['unbanid'])) {
$stmt = new Statement("DELETE FROM {$GLOBALS['fc_config']['db']['pref']}bans WHERE banneduserid=?");
$stmt->process($_REQUEST['unbanid']);
$notice = 'ban removed';}
if(!isset($_REQUEST['sort']) || isset($_REQUEST['clear'])) $_REQUEST['sort'] = 'none';
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}bans ORDER BY userid");
$rs = $stmt->process();
$bannedlist = array();
while($rec = $rs->next()) {
$temp_ban = array();
$user = ChatServer::getUser($rec['userid']);
$buser = ChatServer::getUser($rec['banneduserid']);
$temp_ban['user'] = $user['login'];
$temp_ban['buser'] = $buser['login'];
$temp_ban['userid'] = $rec['userid'];
$temp_ban['banneduserid'] = $rec['banneduserid'];
$temp_ban['roomid'] = $rec['roomid'];
$temp_ban['banlevel'] = "chat";
if ($rec['roomid']) {$temp_ban['banlevel'] = "room";}
if ($rec['ip']) {$temp_ban['banlevel'] = "ip";}
$temp_ban['created'] = $rec['created'];
$temp_ban['roomid'] = $rec['roomid'];
$temp_ban['ip'] = $rec['ip'];
array_push($bannedlist, $temp_ban);
}
if ($_REQUEST['sort'] != 'none') {
sort_table($_REQUEST['sort'], $bannedlist);
}
//Assign Smarty variables and load the admin template
$smarty->assign('error',$error);
$smarty->assign('notice',$notice);
$smarty->assign('bannedlist',$bannedlist);
$smarty->display('banlist.tpl');
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -