TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,144
  • Total Topics: 21,346
  • Online today: 633
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 503
  • Total: 503

[Hack] Censor TP Shoutbox

Started by Thurnok, February 03, 2007, 09:05:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thurnok

This hack will let you provide a "censorable" shoutbox experience.  This allows you to apply the SMF built-in censor mechanism to the TP Shoutbox both in the regular shoutbox, as well as the "view shouts" of a specific member from that member's profile.  It works the same way the "post" censoring works.  In otherwords, if a member elects to view uncensored posts (from their profile settings), then they also get uncensored shouts.  If they do not bypass the "post" censoring, then shouts are also censored.

Note: The ACP area is not censored.  This means as an Admin, if you look at the Shoutbox settings where you can remove shouts, it is never censored there so you will always see the uncensored version (i.e. what is actually stored in the database) regardless if you are bypassing censoring or not.

First, edit the /Sources/TPortal.php file:
[FIND]

$shouts .= doUBBC($myshout);


[REPLACE WITH]

$shouts .= doUBBC(censorText($myshout));



Next, edit the /Sources/TPmodules.php file:
[FIND]

'shout' => doUBBC($row['value1']),


[REPLACE WITH]

'shout' => doUBBC(censorText($row['value1'])),


Thurnok
The one, the only!

Zetan

This hack works a treat..
"Does exactly what it says on the tin" (UK commercial if you have no clue what that meant) ;)
Keeps the ever dutiful company firewall quiet.


Thanks Thurnok




ZTN

TWD

Hey, Thurnok!

Since you're apparently pretty familiar with the workings of SMF's censoring function (and since I've pretty much been ignored on the SMF boards), can you point me to the spots in the code where it is invoked for displaying posts?  I want to disable it an a specific forum.  Was able to accomplish this when I ran a snitz forum with a simple "if forumid<>{specific forum} then {use the cuss filter}

I've discovered that if I give certain of my more "colorful" members access to a hidden forum where they can spew all the profanity they want to, they don't feel the need to do it in the open forums.

Thanks for any help.

Thurnok

Sorry.. been out with a back injury all week - still am actually, but I figured I better catch up on some posts at TP.net... heh

Ok, so you basically want to disable the censor for a certain board?  Or did you want it to be more versatile so you can "flag" certain boards to not run thru the censor?  In other words, are you looking for a block that you can manage boards' censorship settings?  Or do you just want to hard code it for a specific board number?
Thurnok
The one, the only!

TWD

I guess ideally it'd be cool to be able to edit a board's settings and disable censorship from there - much like setting permissions, I guess.  In a pinch, however, I'm not against just hard-coding to exclude a specific board.

RoarinRow


SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Thurnok

Ok... I'll look into this as soon as I'm able to sit in my chair for more than 30 minutes at a time.  LOL
Thurnok
The one, the only!

bloc

This is actually a great way of censoring the shoutbox. If paired with a on/off setting it can be really useful.

Zetan

I made a request for this in another thread... and Thurnok went off and came up with this.
It's excellent... My company firewall had blocked my site because a member was using offensive language in the shoutbox.
I had to beg the webmaster to unblock the site again.

One of my other members likes to use the word "p***k".. he got a shock when he read back his post and it read "member name is a p***k".
That'll learn ya ;)

RvG

Quote from: Bloc on March 11, 2007, 01:44:27 PM
This is actually a great way of censoring the shoutbox. If paired with a on/off setting it can be really useful.

could be added to default installation perhaps :)

This website is proudly hosted on Crocweb Cloud Website Hosting.