add hellban support to PMs

This commit is contained in:
Shish 2013-09-09 13:47:42 +01:00
parent 4584bf603a
commit 76c7da0161
2 changed files with 7 additions and 5 deletions

View File

@ -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("<style>.hb { $s }</style>");
$page->add_html_header("<style>$s</style>");
}
}
}

View File

@ -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 = "<b>$h_subject</b>";
$readYN = "N";
}
$html .= "<tr>
$hb = $from->can("hellbanned") ? "hb" : "";
$html .= "<tr class='$hb'>
<td>$readYN</td>
<td><a href='$pm_url'>$h_subject</a></td>
<td><a href='$from_url'>$h_from</a></td><td>$h_date</td>