From 89267777d29f9fd7b2e3fcbee70d7bf0473380e8 Mon Sep 17 00:00:00 2001 From: Ruan Date: Fri, 3 Jul 2015 17:47:30 +0200 Subject: [PATCH] Add support for banner UUIDs --- bans.php | 2 +- includes/page.php | 11 ++++++++++- mutes.php | 2 +- warnings.php | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bans.php b/bans.php index f5214be..f61883b 100644 --- a/bans.php +++ b/bans.php @@ -65,7 +65,7 @@ ?> - + diff --git a/includes/page.php b/includes/page.php index cf65d2e..45afbb6 100644 --- a/includes/page.php +++ b/includes/page.php @@ -25,7 +25,16 @@ function get_avatar($name) { return "" . $name; } -function get_banner_name($banner) { +function get_banner_name($row) { + global $conn, $table_history; + $uuid = $row['banned_by_uuid']; + $stmt = $conn->prepare("SELECT name FROM " . $table_history . " WHERE uuid=? ORDER BY date DESC LIMIT 1"); + if ($stmt->execute(array($uuid)) && $r = $stmt->fetch()) { + $banner = $r['name']; + return $banner; + } + //return "null"; + $banner = $row['banned_by_name']; return clean($banner); } diff --git a/mutes.php b/mutes.php index dcd9f18..9e0461e 100644 --- a/mutes.php +++ b/mutes.php @@ -32,7 +32,7 @@ ?> - + diff --git a/warnings.php b/warnings.php index 33e5c70..c609a6c 100644 --- a/warnings.php +++ b/warnings.php @@ -41,7 +41,7 @@ ?> - +