2012-06-19, 09:38 PM
Hello I'll show you how to make a Moderator warning for MyBB except there is a twist!
The script checks for last edit and if there is one it checks who it is. The user id is ran through database and checks the user rank if the person is allowed to post the moderated post.
First open
./inc/class_parser.php
look for
add
then look for
add above that add
The part where YOU get to edit is
usually 3 is Super Moderators and 4 is Administrators
you can also add 6 if you want (Moderators)
Just know that when the user edits their post, the [mod] will not work. You will have to re submit it again.
The script checks for last edit and if there is one it checks who it is. The user id is ran through database and checks the user rank if the person is allowed to post the moderated post.
First open
./inc/class_parser.php
look for
function parse_message($message, $options=array())
and under that there should be globalsadd
$post,$db
make sure it ends with ;then look for
$message = $this->parse_mycode($message, $this->options);
add above that add
// Moderator Warning
$list_allowed_groups = array('3','4');
if($post['edituid']) {
$query = $db->simple_select("users", "*", "uid='".$post['edituid']."'");
$lastedit = $db->fetch_field($query, "usergroup");
if(in_array($lastedit,$list_allowed_groups)) {
$message = preg_replace('#\[mod\](.*?)\[/mod\]#si', "<div style=\"color:#b52135;background-color:#f6ced3;border:2px solid #b52135;padding:10px;margin:10px;\"><u><b>Warning:</b></u> $1</div>", $message);
}
}
The part where YOU get to edit is
$list_allowed_groups = array('3','4');
usually 3 is Super Moderators and 4 is Administrators
you can also add 6 if you want (Moderators)
Just know that when the user edits their post, the [mod] will not work. You will have to re submit it again.