From 76c7da016133a103ec83a5f32cf8ae6dbef49a16 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 9 Sep 2013 13:47:42 +0100 Subject: [PATCH] add hellban support to PMs --- ext/hellban/main.php | 6 +++--- ext/pm/theme.php | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ext/hellban/main.php b/ext/hellban/main.php index 5ae50771..971fd6d4 100644 --- a/ext/hellban/main.php +++ b/ext/hellban/main.php @@ -7,14 +7,14 @@ class HellBan extends Extension { $s = ""; } else if($user->can("view_hellbanned")) { - $s = "border: 1px solid red !important;"; + $s = "DIV.hb, TR.hb TD {border: 1px solid red !important;}"; } else { - $s = "display: none !important;"; + $s = ".hb {display: none !important;}"; } if($s) { - $page->add_html_header(""); + $page->add_html_header(""); } } } diff --git a/ext/pm/theme.php b/ext/pm/theme.php index a248be50..bf30302b 100644 --- a/ext/pm/theme.php +++ b/ext/pm/theme.php @@ -12,7 +12,8 @@ class PrivMsgTheme extends Themelet { foreach($pms as $pm) { $h_subject = html_escape($pm->subject); if(strlen(trim($h_subject)) == 0) $h_subject = "(No subject)"; - $from_name = User::by_id($pm->from_id)->name; + $from = User::by_id($pm->from_id); + $from_name = $from->name; $h_from = html_escape($from_name); $from_url = make_link("user/".url_escape($from_name)); $pm_url = make_link("pm/read/".$pm->id); @@ -23,7 +24,8 @@ class PrivMsgTheme extends Themelet { $h_subject = "$h_subject"; $readYN = "N"; } - $html .= " + $hb = $from->can("hellbanned") ? "hb" : ""; + $html .= " $readYN $h_subject $h_from$h_date