diff --git a/core/sys_config.inc.php b/core/sys_config.inc.php index c70acb93..2a3f302e 100644 --- a/core/sys_config.inc.php +++ b/core/sys_config.inc.php @@ -36,7 +36,7 @@ _d("WH_SPLITS", 1); // int how many levels of subfolders to put in _d("VERSION", 'trunk'); // string shimmie version _d("TIMEZONE", null); // string timezone _d("MIN_FREE_SPACE",100*1024*1024); // int disable uploading if there's less than MIN_FREE_SPACE bytes free space -_d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor"); // extensions to always enable +_d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor,hellban"); // extensions to always enable _d("EXTRA_EXTS", ""); // optional extra extensions diff --git a/core/userclass.class.php b/core/userclass.class.php index c9368d83..a8bec4e5 100644 --- a/core/userclass.class.php +++ b/core/userclass.class.php @@ -99,6 +99,9 @@ new UserClass("base", null, array( "edit_other_vote" => False, "view_sysinfo" => False, + "hellbanned" => False, + "view_hellbanned" => False, + "protected" => False, # only admins can modify protected users (stops a moderator changing an admin's password) )); @@ -152,8 +155,13 @@ new UserClass("admin", "base", array( "bulk_edit_vote" => True, "edit_other_vote" => True, "view_sysinfo" => True, + "view_hellbanned" => True, "protected" => True, )); +new UserClass("hellbanned", "user", array( + "hellbanned" => True, +)); + @include_once "data/config/user-classes.conf.php"; ?> diff --git a/ext/comment/main.php b/ext/comment/main.php index 3fc24124..1cc05c2a 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -42,6 +42,7 @@ class Comment { $this->owner_id = $row['user_id']; $this->owner_name = $row['user_name']; $this->owner_email = $row['user_email']; // deprecated + $this->owner_class = $row['user_class']; $this->comment = $row['comment']; $this->comment_id = $row['comment_id']; $this->image_id = $row['image_id']; @@ -335,7 +336,7 @@ class CommentList extends Extension { global $database; $rows = $database->get_all(" SELECT - users.id as user_id, users.name as user_name, users.email as user_email, + users.id as user_id, users.name as user_name, users.email as user_email, users.class as user_class, comments.comment as comment, comments.id as comment_id, comments.image_id as image_id, comments.owner_ip as poster_ip, comments.posted as posted @@ -356,7 +357,7 @@ class CommentList extends Extension { global $database; $rows = $database->get_all(" SELECT - users.id as user_id, users.name as user_name, users.email as user_email, + users.id as user_id, users.name as user_name, users.email as user_email, users.class as user_class, comments.comment as comment, comments.id as comment_id, comments.image_id as image_id, comments.owner_ip as poster_ip, comments.posted as posted @@ -379,7 +380,7 @@ class CommentList extends Extension { $i_image_id = int_escape($image_id); $rows = $database->get_all(" SELECT - users.id as user_id, users.name as user_name, users.email as user_email, + users.id as user_id, users.name as user_name, users.email as user_email, users.class as user_class, comments.comment as comment, comments.id as comment_id, comments.image_id as image_id, comments.owner_ip as poster_ip, comments.posted as posted diff --git a/ext/comment/theme.php b/ext/comment/theme.php index 5bcc1fc6..ba4d12b4 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -242,13 +242,14 @@ class CommentListTheme extends Themelet { $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50)); $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl); + $hb = ($comment->owner_class == "hellbanned" ? "hb" : ""); if($trim) { - return ' -
- '.$h_userlink.': '.$h_comment.' - >>> + return " +
+ $h_userlink: $h_comment + >>>
- '; + "; } else { $h_avatar = ""; @@ -262,15 +263,15 @@ class CommentListTheme extends Themelet { $h_del = $user->can("delete_comment") ? ' - Del' : ''; - return ' -
-
- '.$h_avatar.' - '.$h_timestamp.$h_reply.$h_ip.$h_del.' + return " +
+
+ $h_avatar + $h_timestamp$h_reply$h_ip$h_del
- '.$h_userlink.': '.$h_comment.' + $h_userlink: $h_comment
- '; + "; } return ""; } diff --git a/ext/hellban/main.php b/ext/hellban/main.php new file mode 100644 index 00000000..5ae50771 --- /dev/null +++ b/ext/hellban/main.php @@ -0,0 +1,21 @@ +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(""); + } + } +} +?> diff --git a/ext/user/main.php b/ext/user/main.php index b1fd420f..b8750502 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -212,8 +212,15 @@ class UserPage extends Extension { global $page, $user, $config; $h_join_date = autodate($event->display_user->join_date); + if($event->display_user->can("hellbanned")) { + $h_class = $event->display_user->class->parent->name; + } + else { + $h_class = $event->display_user->class->name; + } + $event->add_stats("Joined: $h_join_date", 10); - $event->add_stats("Class: {$event->display_user->class->name}", 90); + $event->add_stats("Class: $h_class", 90); $av = $event->display_user->get_avatar_html(); if($av) {