Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2002, 10:45 PM
Nupraptor's Avatar
Nupraptor Nupraptor is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
Reply With Quote
  #2  
Old 10-30-2002, 10:21 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 10-30-2002, 05:22 PM
Nupraptor's Avatar
Nupraptor Nupraptor is offline
 
Join Date: Nov 2001
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome! Thanks.

Would these settings carry over to sub-forums, or would I need to add each forumid?
Reply With Quote
  #4  
Old 10-30-2002, 05:45 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 10-30-2002, 07:10 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 10-30-2002, 08:11 PM
SWFans.net's Avatar
SWFans.net SWFans.net is offline
 
Join Date: Oct 2001
Posts: 243
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 10-30-2002, 08:43 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #8  
Old 10-30-2002, 08:53 PM
SWFans.net's Avatar
SWFans.net SWFans.net is offline
 
Join Date: Oct 2001
Posts: 243
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, that works correctly.
Reply With Quote
  #9  
Old 10-30-2002, 09:05 PM
SWFans.net's Avatar
SWFans.net SWFans.net is offline
 
Join Date: Oct 2001
Posts: 243
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 10-30-2002, 09:38 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;} 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04334 seconds
  • Memory Usage 2,268KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete