Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: quake101 in Oktober 08, 2004, 11:23:01 VORMITTAG

Titel: Disable word censoring for a board(s)
Beitrag von: quake101 in Oktober 08, 2004, 11:23:01 VORMITTAG
Is it possable to disable word filters for 1 board?  ???
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Anguz in Oktober 08, 2004, 06:26:59 NACHMITTAGS
I don't think you can as it is, but you could mod it to work that way, I guess.
Titel: Re: Disable word censoring for a board(s)
Beitrag von: quake101 in Oktober 08, 2004, 06:39:17 NACHMITTAGS
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
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Anguz in Oktober 08, 2004, 06:48:15 NACHMITTAGS
<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:

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. ;)
Titel: Re: Disable word censoring for a board(s)
Beitrag von: quake101 in Oktober 08, 2004, 06:54:15 NACHMITTAGS
Sweet, I'll give that a shot
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Anguz in Oktober 08, 2004, 08:14:09 NACHMITTAGS
Zitat von: quake101 in Oktober 08, 2004, 06:54:15 NACHMITTAGS
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?
Titel: Re: Disable word censoring for a board(s)
Beitrag von: quake101 in Oktober 08, 2004, 10:48:28 NACHMITTAGS
Hey, That worked great! Thank!!!!!  ;D
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Anguz in Oktober 08, 2004, 11:20:52 NACHMITTAGS
Zitat von: quake101 in Oktober 08, 2004, 10:48:28 NACHMITTAGS
Hey, That worked great! Thank!!!!! ;D

;)
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Stumpy in August 28, 2007, 05:06:26 NACHMITTAGS
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.

Titel: Re: Disable word censoring for a board(s)
Beitrag von: Coldfx in September 01, 2007, 03:15:28 NACHMITTAGS
Zitat von: Stumpy in August 28, 2007, 05:06:26 NACHMITTAGS
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.
Titel: Re: Disable word censoring for a board(s)
Beitrag von: qtime in Oktober 31, 2009, 11:21:36 VORMITTAG
thanks, this is a great future!!
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Arantor in Oktober 31, 2009, 01:15:08 NACHMITTAGS
I even wrote a mod for this for SMF 2.0 - Uncensored Boards (http://custom.simplemachines.org/mods/index.php?mod=2176)
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Nibogo in November 09, 2009, 06:08:03 NACHMITTAGS
This should be moved to the Now Available board.

btw Nice mod Arantor
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Arantor in November 15, 2009, 08:35:13 NACHMITTAGS
I'm not moving this to Now Available since this thread covers it for 1.1, my mod is 2.0 only.
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Stumpy in Januar 19, 2010, 04:14:25 NACHMITTAGS
Zitat von: Arantor in Oktober 31, 2009, 01:15:08 NACHMITTAGS
I even wrote a mod for this for SMF 2.0 - Uncensored Boards (http://custom.simplemachines.org/mods/index.php?mod=2176)

An excellent mod, Arantor.  I love it.
Titel: Re: Disable word censoring for a board(s)
Beitrag von: Arantor in Januar 19, 2010, 04:34:53 NACHMITTAGS
Note that I don't maintain it any longer.