vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Disable swear filter for certain forums? (https://vborg.vbsupport.ru/showthread.php?t=45178)

Nupraptor 10-29-2002 10:45 PM

Disable swear filter for certain forums?
 
Does anyone think it would be possible to create a hack so as to disable the swear filter on just a few forums? By and large, we don't allow swearing at my board, but I would like to enable it for just a couple of forums. Is it possible? If so, could someone do this for me? :classic:

Logician 10-30-2002 10:21 AM

in newthread.php, newreply.php, editpost.php find:

PHP Code:

 $subject=censortext($subject);
    
$message=censortext($message); 

Replace it as:

PHP Code:

if ($foruminfo[forumid]!=AND $foruminfo[forumid]!=Y)
{
 
$subject=censortext($subject);
    
$message=censortext($message);


X and Y should be replaced with the forumids in which censor would not apply

Nupraptor 10-30-2002 05:22 PM

Awesome! Thanks. :)

Would these settings carry over to sub-forums, or would I need to add each forumid?

Smoothie 10-30-2002 05:45 PM

What if you wanted to have more than one forum included? And if it were just one forum, would x and y be the same number?

Logician 10-30-2002 07:10 PM

Quote:

Originally posted by Nupraptor
Would these settings carry over to sub-forums, or would I need to add each forumid?
You need to add each one's id seperately..

Quote:

What if you wanted to have more than one forum included? And if it were just one forum, would x and y be the same number?
1 forum:

if ($foruminfo[forumid]!=X)

2 forums:

if ($foruminfo[forumid]!=X AND $foruminfo[forumid]!=Y)


3 forums:

if ($foruminfo[forumid]!=X AND $foruminfo[forumid]!=Y AND $foruminfo[forumid]!=Z)

4 Forums:

if ($foruminfo[forumid]!=X AND $foruminfo[forumid]!=Y AND $foruminfo[forumid]!=Z AND $foruminfo[forumid]!=W)

etc.

SWFans.net 10-30-2002 08:11 PM

This modification works for the subject but not the message body. The swear filter is not implemented for the message subject (meaning the subject can contain words in the censoer list in the thread title) but the body text still gets censored. There is a missing piece here somewhere.

Logician 10-30-2002 08:43 PM

Quote:

Originally posted by SWFans.net
This modification works for the subject but not the message body. The swear filter is not implemented for the message subject (meaning the subject can contain words in the censoer list in the thread title) but the body text still gets censored. There is a missing piece here somewhere.
right..

here is the missing part:

edit functions.php, find:
Quote:

global $regexcreated,$searcharray,$replacearray,$phpversi onnum;
REPLACE it AS:

Quote:

global $regexcreated,$searcharray,$replacearray,$phpversi onnum, $thread;
find:

Quote:

return censortext($bbcode);
Replace it as:
Quote:

if ($thread['forumid']!=X AND $thread['forumid']!=Y)
{
return censortext($bbcode);
}
else{ return $bbcode;}
X,Y are forumids as usual..

SWFans.net 10-30-2002 08:53 PM

Thank you, that works correctly. :)

SWFans.net 10-30-2002 09:05 PM

Is there some kind of evaluation I can add to that section in functions.php that could test if it was a private message? As it is this modification allows censored text in Private Message body text but not titles.

Logician 10-30-2002 09:38 PM

yep.. put a variable like "$my_priv_variable=1;" in private message related scripts right before it calls the function bbcodeparse2 and use the same method: Add the variable to the global line of the function and return result accordingly like:

PHP Code:

if ($my_priv_variable!=1)
{
return 
censortext($bbcode);
}
else{ return 
$bbcode;} 

Of course if you want to cancel it in both private messages and some forums, you need to combine 2 lines:

PHP Code:

if ($thread['forumid']!=AND $thread['forumid']!=AND $my_priv_variable!=1)
{
return 
censortext($bbcode);
}
else{ return 
$bbcode;} 



All times are GMT. The time now is 12:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01202 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete