MyBB Central

Full Version: [r] Advanced Badword Filter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
MyBB Version: MyBB 1.2.*
New Settings: 3 [ BadwordFilter Settings ]
New Templates: 1 [ usercp_bwfub ]
DB Changes: 1 [ new column in users table ]
File Changes: 2
Files: 1
  • ./inc/plugins/bwfub.php
Images: 0
Install:
  • Upload ./inc/plugins/bwfub.php into your ./inc/plugins/ folder
  • Go to your PluginManager and Activate the "BadwordFilter" Plugin.
  • File Change: open ./inc/functions_post.php
    Find
    PHP Code:
        if($post['smilieoff'] == "yes")
        {
            
    $parser_options['allow_smilies'] = "no";
        } 
    Add Below
    PHP Code:
        // GROUPS
        
    $groups explode(","$mybb->settings['bwfub_groups']);
        
    // FIDS
        
    $fids explode(","$mybb->settings['bwfub_fids']);
        
    // CHECK 
        
    $filter true;
        
    // CONTROL
        
    if($mybb->settings['bwfub_over'] == "yes")
        {
            if(
    $mybb->user['filterbadwords'] == "no")
            {
                
    $filter false;
            }
        }
        else if((
    in_array($fid$fids) && $fids) || (in_array($mybb->user['usergroup'], $groups) && $groups))
        {
            
    $filter false;
        }
        if(!
    $filter)
        {
            
    $parser_options['filter_badwords'] = "no";
        } 
  • File Change: open xmlhttp.php
    Find
    PHP Code:
            $post['message'] = $parser->parse_message($message$parser_options); 
    Add Above
    PHP Code:
                        // GROUPS
        
    $groups explode(","$mybb->settings['bwfub_groups']);
        
    // FIDS
        
    $fids explode(","$mybb->settings['bwfub_fids']);
        
    // CHECK 
        
    $filter true;
        
    // CONTROL
        
    if($mybb->settings['bwfub_over'] == "yes")
        {
            if(
    $mybb->user['filterbadwords'] == "no")
            {
                
    $filter false;
            }
        }
        else if((
    in_array($post['fid'], $fids) && $fids) || (in_array($mybb->user['usergroup'], $groups) && $groups))
        {
            
    $filter false;
        }
        if(!
    $filter)
        {
            
    $parser_options['filter_badwords'] = "no";
        } 
Settings:
  • Usergroups
    > Disable BadwordFilter For What Groups?
  • ForumSections
    > Disable BadwordFilter For What ForumSections?
  • Allow Users To Choose The BadwordFilter Option In Their UCP?
    > Overrides the 2 settings above.
What:
* You can decide where badwords in posts gets filtered and for who ( based on their usergroup ). Or you can the user himself choose whether they want to see badwords or not; but you have to change the setting in your ACP to let them choose else they wont see the option in their UCP - Edit Options.

Tested On: MyBB 1.2.13

Update:14/06/08 [[ If the overwrite setting doesn't work properly; redo the filechanges; they're changed a lil' ]]
Oh wow, I must have missed the change in xmlhttp.php the first time. Maybe that's why it only worked half the time. LOL Tongue
That's for the 'QuickEdit' part; so it would change when you press 'Save Changes'; else you need to refresh before it 'filters' =P
That's why I had to refresh before to see the filter. It all makes sense now. Thanks, Lex! LOL
For the ones who have this installed and have problems with the 'overwrite' setting not working properly; i suggest redo the manual file changes or download the files for MyBB 1.2.13( first post ) and overwrite them. ( xmlhttp.php ( root ) ; functions_post.php ( ./inc/ folder ) )