Neuigkeiten:

Join the Facebook Fan Page.

Hauptmenü
Advertisement:

Disable word censoring for a board(s)

Begonnen von quake101, Oktober 08, 2004, 11:23:01 VORMITTAG

Vorheriges Thema - Nächstes Thema

quake101

Is it possable to disable word filters for 1 board?  ???

Anguz

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

quake101

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

Anguz

<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. ;)
Cristián Lávaque http://cristianlavaque.com

quake101


Anguz

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?
Cristián Lávaque http://cristianlavaque.com

quake101



Stumpy

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

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.

qtime


Arantor

Holder of controversial views, all of which my own.



Arantor

I'm not moving this to Now Available since this thread covers it for 1.1, my mod is 2.0 only.
Holder of controversial views, all of which my own.


Stumpy


Arantor

Holder of controversial views, all of which my own.


Advertisement: