Advertisement:

Author Topic: Disable word censoring for a board(s)  (Read 28974 times)

Offline quake101

  • Jr. Member
  • **
  • Posts: 189
  • Gender: Male
    • Badass Mustangs
Disable word censoring for a board(s)
« on: October 08, 2004, 11:23:01 AM »
Is it possable to disable word filters for 1 board?  ???

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Disable word censoring for a board(s)
« Reply #1 on: October 08, 2004, 06:26:59 PM »
I don't think you can as it is, but you could mod it to work that way, I guess.
Cristián Lávaque http://cristianlavaque.com

Offline quake101

  • Jr. Member
  • **
  • Posts: 189
  • Gender: Male
    • Badass Mustangs
Re: Disable word censoring for a board(s)
« Reply #2 on: October 08, 2004, 06:39:17 PM »
I want to setup a board where members can "vent" about something. I want no word filters on that board. btw, this was requested by members. :D

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Disable word censoring for a board(s)
« Reply #3 on: October 08, 2004, 06:48:15 PM »
Code: [Select]
<edit file>
Sources/Load.php
</edit file>

<search for>
// Replace all vulgar words with respective proper words. (substring or whole words..)
function &censorText(&$text)
{
global $modSettings, $options, $settings;
static $censor_vulgar = null, $censor_proper;
</search for>

<add after>

// Uncensored board.
global $board;
if (!empty($board) && $board == 1)
return $text;
</add after>

Replace the 1 with the ID of the board you want uncensored. If you want to forgive more than one board, you'd change that line to this:

Code: [Select]
if (!empty($board) && ($board == 1 || $board == 2))

That'd not censor boards 1 and 2, you can add more. Again, you use the correct board IDs, this is just an example.

Hope it helps. ;)
Cristián Lávaque http://cristianlavaque.com

Offline quake101

  • Jr. Member
  • **
  • Posts: 189
  • Gender: Male
    • Badass Mustangs
Re: Disable word censoring for a board(s)
« Reply #4 on: October 08, 2004, 06:54:15 PM »
Sweet, I'll give that a shot

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Disable word censoring for a board(s)
« Reply #5 on: October 08, 2004, 08:14:09 PM »
Sweet, I'll give that a shot

Cool. Let me know if it worked for you.


Note: This could probably go in Tips and Tricks?
Cristián Lávaque http://cristianlavaque.com

Offline quake101

  • Jr. Member
  • **
  • Posts: 189
  • Gender: Male
    • Badass Mustangs
Re: Disable word censoring for a board(s)
« Reply #6 on: October 08, 2004, 10:48:28 PM »
Hey, That worked great! Thank!!!!!  ;D

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Disable word censoring for a board(s)
« Reply #7 on: October 08, 2004, 11:20:52 PM »
Cristián Lávaque http://cristianlavaque.com

Offline Stumpy

  • Semi-Newbie
  • *
  • Posts: 44
Re: Disable word censoring for a board(s)
« Reply #8 on: August 28, 2007, 05:06:26 PM »
Anguz,

I got this to work beautifully on my site (it's something I've been trying to figure out for some time), but can you explain to me WHY it works?  I'd been experimenting with putting the entire CensorText() function in an if statement that said

if $board != 14 {censortext}

but $board was not being recognized.  How come when you added

   // Uncensored board.
   global $board;
   if (!empty($board) && $board == 1)
      return $text;

$board is suddenly recognized by the code?  Did the simple fact of declaring it make it visible, whereas not declaring it makes it invisible?

Just curious - and thanks VERY MUCH for the code snippet.


Coldfx

  • Guest
Re: Disable word censoring for a board(s)
« Reply #9 on: September 01, 2007, 03:15:28 PM »
Anguz,

I got this to work beautifully on my site (it's something I've been trying to figure out for some time), but can you explain to me WHY it works?  I'd been experimenting with putting the entire CensorText() function in an if statement that said

if $board != 14 {censortext}

but $board was not being recognized.  How come when you added

   // Uncensored board.
   global $board;
   if (!empty($board) && $board == 1)
      return $text;

$board is suddenly recognized by the code?  Did the simple fact of declaring it make it visible, whereas not declaring it makes it invisible?

Just curious - and thanks VERY MUCH for the code snippet.



It's because it was defined on "global $board;"; line 2.

Offline qtime

  • Full Member
  • ***
  • Posts: 501
Re: Disable word censoring for a board(s)
« Reply #10 on: October 31, 2009, 11:21:36 AM »
thanks, this is a great future!!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,035
    • Arantor on GitHub
Re: Disable word censoring for a board(s)
« Reply #11 on: October 31, 2009, 01:15:08 PM »
I even wrote a mod for this for SMF 2.0 - Uncensored Boards
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,035
    • Arantor on GitHub
Re: Disable word censoring for a board(s)
« Reply #13 on: November 15, 2009, 08:35:13 PM »
I'm not moving this to Now Available since this thread covers it for 1.1, my mod is 2.0 only.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Stumpy

  • Semi-Newbie
  • *
  • Posts: 44
Re: Disable word censoring for a board(s)
« Reply #14 on: January 19, 2010, 04:14:25 PM »
I even wrote a mod for this for SMF 2.0 - Uncensored Boards

An excellent mod, Arantor.  I love it.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,035
    • Arantor on GitHub
Re: Disable word censoring for a board(s)
« Reply #15 on: January 19, 2010, 04:34:53 PM »
Note that I don't maintain it any longer.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.