REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[r] Advanced Badword Filter
#1
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' ]]


Attached Files
.php   Less than 1 minute ago">bwfub.php (Size: 4.91 KB / Downloads: 69)
.php   Less than 1 minute ago">functions_post.php (Size: 18.64 KB / Downloads: 53)
.php   Less than 1 minute ago">xmlhttp.php (Size: 15.7 KB / Downloads: 51)
#2
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
#3
That's for the 'QuickEdit' part; so it would change when you press 'Save Changes'; else you need to refresh before it 'filters' =P
#4
That's why I had to refresh before to see the filter. It all makes sense now. Thanks, Lex! LOL
#5
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 ) )


Possibly Related Threads...
Thread Author Replies Views Last Post
  [r] Recent Posts Advanced LeX- 1 3,343 Aug 20, 2008, 10:05 AM
Last Post: pad_kay

Forum Jump:


Users browsing this thread: 1 Guest(s)