Advertisement:

Author Topic: Censored Words  (Read 19523 times)

Offline DNAPANDA

  • Semi-Newbie
  • *
  • Posts: 11
Re: Censored Words
« Reply #20 on: February 17, 2009, 05:55:59 PM »
I have searched, but cant find it in messageindex.php or subs-boardindex.php  :-\

Offline fwitt

  • Full Member
  • ***
  • Posts: 479
  • Gender: Male
Re: Censored Words
« Reply #21 on: February 18, 2009, 04:08:09 PM »
BoardIndex.php

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

Offline DNAPANDA

  • Semi-Newbie
  • *
  • Posts: 11
Re: Censored Words
« Reply #22 on: February 18, 2009, 07:31:01 PM »
Works like a dream, thanks a bunch guys!! :D

Offline apostaideal

  • Semi-Newbie
  • *
  • Posts: 14
Censored Words (New)
« Reply #23 on: December 23, 2009, 12:36:29 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

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

and

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

making them

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

and

Code: [Select]
//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?



Thank´s

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,313
    • StoryBB/StoryBB on GitHub
Re: Censored Words
« Reply #24 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)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline apostaideal

  • Semi-Newbie
  • *
  • Posts: 14
Re: Censored Words
« Reply #25 on: December 23, 2009, 07:42:52 PM »
Yeh,

That´s worked...

Thank´s  ;D

Offline Doug Varrieur

  • Semi-Newbie
  • *
  • Posts: 72
Re: Censored Words HELP
« Reply #26 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']);


kat

  • Guest
Re: Censored Words
« Reply #27 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

Code: [Select]
[url=http://www.google.com]Google[/url]
it should do the job.

Google

Offline Doug Varrieur

  • Semi-Newbie
  • *
  • Posts: 72
Re: Censored Words
« Reply #28 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

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 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??
 

Offline Doug Varrieur

  • Semi-Newbie
  • *
  • Posts: 72
Re: Censored Words
« Reply #29 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  :-\

kat

  • Guest
Re: Censored Words
« Reply #30 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.

Offline Doug Varrieur

  • Semi-Newbie
  • *
  • Posts: 72
Re: Censored Words
« Reply #31 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.

kat

  • Guest
Re: Censored Words
« Reply #32 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']);

Offline Doug Varrieur

  • Semi-Newbie
  • *
  • Posts: 72
Re: Censored Words
« Reply #33 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']);
 

Offline Sciamano

  • Semi-Newbie
  • *
  • Posts: 16
Re: Censored Words
« Reply #34 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!

Offline Sciamano

  • Semi-Newbie
  • *
  • Posts: 16
Re: Censored Words
« Reply #35 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:

Code: [Select]
[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:
Code: [Select]
// 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:
Code: [Select]
// 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:

Code: [Select]
[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:
Code: [Select]
[url=http://www.[url=http://www.google.com]Google[/url].com][url=http://www.google.com]Google[/url][/url]
Into this:
Code: [Select]
[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

Offline becometa

  • Jr. Member
  • **
  • Posts: 113
Re: Censored Words
« Reply #36 on: January 13, 2018, 04:59:21 PM »
(...)

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:

Code: [Select]
[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:
Code: [Select]
[url=http://www.[url=http://www.google.com]Google[/url].com][url=http://www.google.com]Google[/url][/url]
Into this:
Code: [Select]
[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..

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,313
    • StoryBB/StoryBB on GitHub
Re: Censored Words
« Reply #37 on: January 13, 2018, 05:14:48 PM »
Quote
Is there anyone willing to share a way to stop censoring words covered by BBCode tags?

There basically isn't one.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline becometa

  • Jr. Member
  • **
  • Posts: 113
Re: Censored Words
« Reply #38 on: January 14, 2018, 11:44:27 AM »
Quote
Is 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.