diff --git a/mod.php b/mod.php
index 3e389986..a5f9a70d 100644
--- a/mod.php
+++ b/mod.php
@@ -1440,7 +1440,7 @@
}
}
if(hasPermission($config['mod']['view_banexpired'])) {
- $query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` INNER JOIN `mods` ON `mod` = `mods`.`id` GROUP BY `ip` ORDER BY (`expires` IS NOT NULL AND `expires` < :time), `set` DESC");
+ $query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` LEFT JOIN `mods` ON `mod` = `mods`.`id` GROUP BY `ip` ORDER BY (`expires` IS NOT NULL AND `expires` < :time), `set` DESC");
$query->bindValue(':time', time(), PDO::PARAM_INT);
$query->execute() or error(db_error($query));
} else {
@@ -1503,17 +1503,21 @@
// Staff
'
' .
- (!hasPermission($config['mod']['view_banstaff']) ?
- ($config['mod']['view_banquestionmark'] ?
- '?'
+ (isset($ban['username']) ?
+ (!hasPermission($config['mod']['view_banstaff']) ?
+ ($config['mod']['view_banquestionmark'] ?
+ '?'
+ :
+ ($ban['type'] == JANITOR ? 'Janitor' :
+ ($ban['type'] == MOD ? 'Mod' :
+ ($ban['type'] == ADMIN ? 'Admin' :
+ '?')))
+ )
:
- ($ban['type'] == JANITOR ? 'Janitor' :
- ($ban['type'] == MOD ? 'Mod' :
- ($ban['type'] == ADMIN ? 'Admin' :
- '?')))
+ utf8tohtml($ban['username'])
)
:
- utf8tohtml($ban['username'])
+ 'deleted?'
) .
' | ' .
@@ -2196,7 +2200,7 @@
}
if(hasPermission($config['mod']['view_ban'])) {
- $query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` INNER JOIN `mods` ON `mod` = `mods`.`id` WHERE `ip` = :ip");
+ $query = prepare("SELECT `bans`.*, `username`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` LEFT JOIN `mods` ON `mod` = `mods`.`id` WHERE `ip` = :ip");
$query->bindValue(':ip', $ip);
$query->execute() or error(db_error($query));
@@ -2219,11 +2223,16 @@
// Board
'Board | ' .
- (isset($ban['uri']) ?
- sprintf($config['board_abbreviation'], $ban['uri'])
+ (isset($ban['board']) ?
+ (isset($ban['uri']) ?
+ sprintf($config['board_abbreviation'], $ban['uri'])
+ :
+ 'deleted?'
+ )
:
'all boards'
- ) . ' |
' .
+ ) .
+ '' .
// Set
'Set | ' . date($config['post_date'], $ban['set']) . ' |
' .
@@ -2239,17 +2248,20 @@
// Staff
'Staff | ' .
- (!hasPermission($config['mod']['view_banstaff']) ?
- ($config['mod']['view_banquestionmark'] ?
- '?'
+ (isset($ban['username']) ?
+ (!hasPermission($config['mod']['view_banstaff']) ?
+ ($config['mod']['view_banquestionmark'] ?
+ '?'
+ :
+ ($ban['type'] == JANITOR ? 'Janitor' :
+ ($ban['type'] == MOD ? 'Mod' :
+ ($ban['type'] == ADMIN ? 'Admin' :
+ '?')))
+ )
:
- ($ban['type'] == JANITOR ? 'Janitor' :
- ($ban['type'] == MOD ? 'Mod' :
- ($ban['type'] == ADMIN ? 'Admin' :
- '?')))
+ utf8tohtml($ban['username'])
)
- :
- utf8tohtml($ban['username'])
+ : 'deleted?'
) .
' |
' .