add 'hellbanned' user class, with support from the comments extension

This commit is contained in:
Shish
2013-09-09 13:41:08 +01:00
parent 7c95981319
commit 1b73dd4ddc
6 changed files with 55 additions and 17 deletions

21
ext/hellban/main.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
class HellBan extends Extension {
public function onPageRequest(PageRequestEvent $event) {
global $page, $user;
if($user->can("hellbanned")) {
$s = "";
}
else if($user->can("view_hellbanned")) {
$s = "border: 1px solid red !important;";
}
else {
$s = "display: none !important;";
}
if($s) {
$page->add_html_header("<style>.hb { $s }</style>");
}
}
}
?>