Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Topic started by: DNAPANDA on January 20, 2009, 06:34:06 AM

Title: Censored Words
Post by: DNAPANDA on January 20, 2009, 06:34:06 AM
Hi,

I have a question about the function "Censored Words", is it possible to only censor words in the posts? I dont want to have this function in the topic subject.  ::)

Hope someone can help me with this, thanks.

Forum version: SMF 1.1.7
Title: Re: Censored Words
Post by: JimM on January 20, 2009, 11:02:52 PM
Welcome to SMF

I am not aware of any options other than allow users to turn off word censoring.  If the word is in the censor list, it is censored throughout the forum.
Title: Re: Censored Words
Post by: DNAPANDA on January 21, 2009, 12:50:21 PM
Ah ok, because i want to use it as a url link function, example when u write "google" it automatic "censores" to google link (http://www.google.com).

But when someone writes "google" in a topic subject the bbcode shows up instead of the link. Does anybody know any other functions that can help me with this problem then, if its not possible to do with censored words function?

Please!  ;)
Title: Re: Censored Words
Post by: DNAPANDA on January 25, 2009, 10:17:20 PM
Nobody knows how to do this? I have seen some other forums that got this function, but they aint using SMF. Please help  :(
Title: Re: Censored Words
Post by: evolution88 on January 25, 2009, 10:19:26 PM
is the word censoring some kind of additional mod or included in smf? sorry to be off topic but I can't help you :(
Title: Re: Censored Words
Post by: DNAPANDA on January 25, 2009, 10:22:14 PM
Quote from: evolution88 on January 25, 2009, 10:19:26 PM
is the word censoring some kind of additional mod or included in smf? sorry to be off topic but I can't help you :(
it is included.

Admin panel -> Posts and Topics -> Censored Words
Title: Re: Censored Words
Post by: evolution88 on January 25, 2009, 10:36:27 PM
Quote from: DNAPANDA on January 25, 2009, 10:22:14 PM
Quote from: evolution88 on January 25, 2009, 10:19:26 PM
is the word censoring some kind of additional mod or included in smf? sorry to be off topic but I can't help you :(
it is included.

Admin panel -> Posts and Topics -> Censored Words

ooh, thanks a bunch ! i'm so blind -.-
Title: Re: Censored Words
Post by: greyknight17 on February 01, 2009, 03:31:35 PM
If you want, we can move this topic over to the Mod Request board for you. There is currently no mod that I'm aware of that will do this. It's for the entire forum as mentioned earlier...
Title: Re: Censored Words
Post by: kat on February 01, 2009, 03:44:52 PM
Can't you just substitute the word "Google" with the words "http://google.com", out of curiosity?
Title: Re: Censored Words
Post by: DNAPANDA on February 02, 2009, 12:04:25 PM
Quote from: greyknight17 on February 01, 2009, 03:31:35 PM
If you want, we can move this topic over to the Mod Request board for you. There is currently no mod that I'm aware of that will do this. It's for the entire forum as mentioned earlier...
That would be good, hopefully someone could make a mod that fixes this.

Quote from: Kat on February 01, 2009, 03:44:52 PM
Can't you just substitute the word "Google" with the words "http://google.com", out of curiosity?
Thats right, but the problem is that I dont want the word (ex. google) to show "http://google.com" in the topic subject, only in replys.

If a topic subject says "Google buys Youtube" it will show up "http://google.com buys Youtube".

Understand?  :P
Title: Re: Censored Words
Post by: kat on February 02, 2009, 02:16:48 PM
Ah, yeah!

I'm with ya!
Title: Re: Censored Words
Post by: DNAPANDA on February 16, 2009, 09:56:26 AM
Is it somebody who can help with this?  :o
Title: Re: Censored Words
Post by: Alan G on February 17, 2009, 05:53:32 AM
I'm looking for a similar but different mod, one that would allow censored words to be removed from the title / subject only.

I'm using ssi to include latest posts in my main site and i'd like to have swearing filtered from those titles. I don't however mind swearing in the main message body.

Both these requests could be included in the same mod. Something to decide what section of posts are censored.

IE. Apply filter to:
1. All content (smf default)
2. Message body only
3. Topic / message subjects only.

Thanks guys.
Title: Re: Censored Words
Post by: Alan G on February 17, 2009, 07:35:52 AM
Having had a quick look at what this would entail it would seem changes to a lot of files would be required for this mod.

See the attached image of files that reference censorText and number of occurences within each of those files.

Is that generally a bad thing for a mod?
Title: Re: Censored Words
Post by: fwitt on February 17, 2009, 11:06:38 AM
Quote from: DNAPANDA on January 20, 2009, 06:34:06 AM
Hi,

I have a question about the function "Censored Words", is it possible to only censor words in the posts? I dont want to have this function in the topic subject.  ::)

Hope someone can help me with this, thanks.

Forum version: SMF 1.1.7

just had a look and this is surprisingly easy to do.

in Sources/Display.php

comment out the lines


censorText($topicinfo['subject']);


and


censorText($message['subject']);


making them


//censorText($topicinfo['subject']);


and


//censorText($message['subject']);
Title: Re: Censored Words
Post by: fwitt on February 17, 2009, 11:25:14 AM
Alan G: I suspect your request would be similar but that you would need to go through each instance of CensorText you found and comment out all the ones you didnt want to be censored.
Title: Re: Censored Words
Post by: Alan G on February 17, 2009, 12:04:48 PM
Yeah that's what i figured, just seems like a lot of changes to make, and would effect updates a fair bit.
Title: Re: Censored Words
Post by: DNAPANDA on February 17, 2009, 02:19:58 PM
Quote from: fwitt on February 17, 2009, 11:06:38 AM
Quote from: DNAPANDA on January 20, 2009, 06:34:06 AM
Hi,

I have a question about the function "Censored Words", is it possible to only censor words in the posts? I dont want to have this function in the topic subject.  ::)

Hope someone can help me with this, thanks.

Forum version: SMF 1.1.7

just had a look and this is surprisingly easy to do.

in Sources/Display.php

comment out the lines


censorText($topicinfo['subject']);


and


censorText($message['subject']);


making them


//censorText($topicinfo['subject']);


and


//censorText($message['subject']);

Great, its getting close now!  :D

It shows the right subject text when you are inside the current subject, but when you are looking at the topic inside the boards and on the forumindex it still shows links in the subject. Where can I change these codes?
Title: Re: Censored Words
Post by: Alan G on February 17, 2009, 02:24:36 PM
I'd take a look at the list of files i attached previously, it will be one or multiple of those. Gping purely on name you might want to try messageindex.php
Title: Re: Censored Words
Post by: fwitt on February 17, 2009, 05:51:46 PM
Subs-BoardIndex.php I think will be the main one to look in but there may be other occurances. They should all be very similar to the two posted earlier.
Title: Re: Censored Words
Post by: DNAPANDA on February 17, 2009, 05:55:59 PM
I have searched, but cant find it in messageindex.php or subs-boardindex.php  :-\
Title: Re: Censored Words
Post by: fwitt on February 18, 2009, 04:08:09 PM
BoardIndex.php


censorText($row_board['subject']);
Title: Re: Censored Words
Post by: DNAPANDA on February 18, 2009, 07:31:01 PM
Works like a dream, thanks a bunch guys!! :D
Title: Censored Words (New)
Post by: apostaideal on December 23, 2009, 12:36:29 AM
Quote from: DNAPANDA on February 17, 2009, 02:19:58 PM
Quote from: fwitt on February 17, 2009, 11:06:38 AM
Quote from: DNAPANDA on January 20, 2009, 06:34:06 AM
Hi,

I have a question about the function "Censored Words", is it possible to only censor words in the posts? I dont want to have this function in the topic subject.  ::)

Hope someone can help me with this, thanks.

Forum version: SMF 1.1.7

just had a look and this is surprisingly easy to do.

in Sources/Display.php

comment out the lines


censorText($topicinfo['subject']);


and


censorText($message['subject']);


making them


//censorText($topicinfo['subject']);


and


//censorText($message['subject']);

Great, its getting close now!  :D

It shows the right subject text when you are inside the current subject, but when you are looking at the topic inside the boards and on the forumindex it still shows links in the subject. Where can I change these codes?

Hello,

I don´t have Sources/Display.php in my theme, and I can´t find censorText code in Display.template.php...Where I can find this code?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi50.tinypic.com%2F2z9b5na.jpg&hash=a6817970a85b5becafa609db858dc5ec9d94b6b3)

Thank´s
Title: Re: Censored Words
Post by: Arantor on December 23, 2009, 02:10:11 AM
That's because it's not in the template files at all, but the core source files. You're looking at /Themes/yourtheme/Display.template.php, but you have to go up out of the Themes area entirely and into the Sources files, which you cannot directly edit from the web (unless you use the File Management Mod)
Title: Re: Censored Words
Post by: apostaideal on December 23, 2009, 07:42:52 PM
Yeh,

That´s worked...

Thank´s  ;D
Title: Re: Censored Words HELP
Post by: Doug Varrieur on September 10, 2010, 04:09:59 PM
If anyone can help I'd appreciate it. I'm using version 1.1.11 and I'm running into this problem. Ive made the changes suggested on this post and I'm 90% there...but.... the topic name on the board still shows the URL...when inside the topic it's clean (not censored) but the topic name on the board is still being censored and the URL is present.

I've made these changes, but I'm obviously missing something....any advice??

Code: [Select]
//censorText($topicinfo['subject']);

Code: [Select]
//censorText($message['subject']);

//censorText($row_board['subject']);

Title: Re: Censored Words
Post by: kat on September 10, 2010, 04:15:15 PM
Having thought about this, I'd still use the censored words, as-is.

If you censor "Google" and substitute it with

[url=http://www.google.com]Google[/url]

it should do the job.

Google (http://www.google.com)
Title: Re: Censored Words
Post by: Doug Varrieur on September 10, 2010, 04:35:45 PM
It Does Kay....works great in the body of the post BUT if you include the word google in the new topic name without making code changes this is what will show up on the board and the topic title

Google (http://www.google.com)

So lets say you post a new topic and call it search with google today what will show on the topic title and board will be

search with Google (http://www.google.com) today

The changes I've already made in the PHP files have solved the subject censoring however the title of the subject on the board is still effected. I need to know what code to change to stop the title name on the board from being censored. I only want to censor the words within the posts.

Any ideas??
Title: Re: Censored Words
Post by: Doug Varrieur on September 10, 2010, 04:38:20 PM
NOTE- The red [non-active] would be google in this example, not sure why the red came up  :-\
Title: Re: Censored Words
Post by: kat on September 10, 2010, 04:39:55 PM
It's a "Here" thing. ;)

No idea, mate.

That'd need some coding, somewhere. Way out of my league, I'm afraid.

I believe that it'd be quite a difficult thing to achieve, too. Though, I could be wrong.
Title: Re: Censored Words
Post by: Doug Varrieur on September 10, 2010, 04:48:21 PM
It seems from the above posts another member resolved the issue. I'm almost there just need to know which Censor code I'm missing.
Title: Re: Censored Words
Post by: kat on September 10, 2010, 04:55:48 PM
'course!

Doh!

One thing I noticed, if it helps.

//censorText($topicinfo['subject']);

//censorText($message['subject']);

They didn't comment-out this one: //censorText($row_board['subject']);
Title: Re: Censored Words
Post by: Doug Varrieur on September 10, 2010, 05:07:40 PM
No they didn't but I did :)

these are the three I commented out... must be another one somewhere??

//censorText($topicinfo['subject']);

//censorText($message['subject']);

//censorText($row_board['subject']);
Title: Re: Censored Words
Post by: Sciamano on January 02, 2013, 12:38:07 PM
Hi!
I'm trying to do the same thing (on SMF 2.0.2) but I'm stuck...
I 've commented out the three lines as above, but still the thread subject gets "censored".
Any help would be appreciated.
Thanks!
Title: Re: Censored Words
Post by: Sciamano on January 03, 2013, 08:10:16 AM
I think I "almost" managed to make this work!
I need to change some words into links automatically but to do this, I need the CensoredWords "plugin" to only censor the body texts and not the topics's subjects otherwise some subjects would look like:

[url=http://www.google.com]Google[/url] is great!

In addition to the things listed in the above posts, I also modified MessageIndex.php as follows.
I edited this section:
// Censor the subject and message preview.
censorText($row['first_subject']);
censorText($row['first_body']);

// Don't censor them twice!
if ($row['id_first_msg'] == $row['id_last_msg'])
{
$row['last_subject'] = $row['first_subject'];
$row['last_body'] = $row['first_body'];
}
else
{
censorText($row['last_subject']);
censorText($row['last_body']);
}
}
else
{
$row['first_body'] = '';
$row['last_body'] = '';
censorText($row['first_subject']);

if ($row['id_first_msg'] == $row['id_last_msg'])
$row['last_subject'] = $row['first_subject'];
else
censorText($row['last_subject']);
}


as follows:
// Censor the subject and message preview.
//censorText($row['first_subject']);
//censorText($row['first_body']);

// Don't censor them twice!
if ($row['id_first_msg'] == $row['id_last_msg'])
{
//$row['last_subject'] = $row['first_subject'];
$row['last_body'] = $row['first_body'];
}
else
{
//censorText($row['last_subject']);
censorText($row['last_body']);
}
}
else
{
$row['first_body'] = '';
$row['last_body'] = '';
//censorText($row['first_subject']);

if ($row['id_first_msg'] == $row['id_last_msg'])
$row['last_subject'] = $row['first_subject'];
//else
// censorText($row['last_subject']);
}


This kind of works (only the body of the message gets censored, therefore the topics subjects stay uncensored), but problems arise when one edits a censored message (the body gets censored twice, making the automatically created links like this:

[url=http://www.[url=http://www.google.com]Google[/url].com][url=http://www.google.com]Google[/url][/url]

I temporarily fixed this by adding these "Censored Words":

Censor this:
[url=http://www.[url=http://www.google.com]Google[/url].com][url=http://www.google.com]Google[/url][/url]

Into this:
[url=http://www.google.com]Google[/url]

Which actually works because bodies can't be edited more than once at a time, basically.... but this solution does not look very kosher IMHO :)
Any suggestions?
Thanks
Title: Re: Censored Words
Post by: becometa on January 13, 2018, 04:59:21 PM
Quote from: Sciamano on January 03, 2013, 08:10:16 AM
(...)

This kind of works (only the body of the message gets censored, therefore the topics subjects stay uncensored), but problems arise when one edits a censored message (the body gets censored twice, making the automatically created links like this:

[url=http://www.[url=http://www.google.com]Google[/url].com][url=http://www.google.com]Google[/url][/url]

I temporarily fixed this by adding these "Censored Words":

Censor this:
[url=http://www.[url=http://www.google.com]Google[/url].com][url=http://www.google.com]Google[/url][/url]

Into this:
[url=http://www.google.com]Google[/url]

Which actually works because bodies can't be edited more than once at a time, basically.... but this solution does not look very kosher IMHO :)
Any suggestions?
Thanks


It's going to be a 5 years bump, but the problem is still there.
I've lurked the whole forum and search engines and came to the same conclusion as quoted member.

Is there anyone willing to share a way to stop censoring words covered by BBCode tags?

While mentioned method is working it certainly has a great impact on performance..
Title: Re: Censored Words
Post by: Arantor on January 13, 2018, 05:14:48 PM
QuoteIs there anyone willing to share a way to stop censoring words covered by BBCode tags?

There basically isn't one.
Title: Re: Censored Words
Post by: becometa on January 14, 2018, 11:44:27 AM
Quote from: Arantor on January 13, 2018, 05:14:48 PM
QuoteIs there anyone willing to share a way to stop censoring words covered by BBCode tags?

There basically isn't one.

Darn. Sad but true ;)

as a last resort, the solution suggested by Sciamano will be the one that will be used.