MyBB Community Forums

Full Version: Disabling Word Filter in Thread Subject
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to disable word filter on thread's subject? We use word filters as easter eggs, so when someone type in a word, it will link the word to something funny. However, when someone type in a word in the subject that is filtered, this happens:

[Image: 8N8xwJw.png]
Parsing it via PHP will be the best option.
(2015-08-11, 12:55 PM)ArneVD Wrote: [ -> ]Parsing it via PHP will be the best option.

How do I do that?
(2015-08-11, 07:06 PM)nollidnosnhoj Wrote: [ -> ]
(2015-08-11, 12:55 PM)ArneVD Wrote: [ -> ]Parsing it via PHP will be the best option.

How do I do that?


Search for the parse code of the wordfilter, and there add an exception for the thread subjects.
In line 798 of forumdisplay.php the subject is parsed on bad words. Could it help when you comment this line?
(2015-08-11, 07:24 PM)Ad Bakker Wrote: [ -> ]In line 798 of forumdisplay.php the subject is parsed on bad words. Could it help when you comment this line?

how to comment a php line?
(2015-08-12, 01:05 AM)nollidnosnhoj Wrote: [ -> ]
(2015-08-11, 07:24 PM)Ad Bakker Wrote: [ -> ]In line 798 of forumdisplay.php the subject is parsed on bad words. Could it help when you comment this line?

how to comment a php line?

Here is all information about comments. http://php.net/manual/en/language.basic-...mments.php

Basically you put 2 forward slashes in front of the line you want to comment out.

<?php

// <- This will comment this line out.

// $parseThread = parse($Thread);
(2015-08-12, 01:22 AM)zamight Wrote: [ -> ]
(2015-08-12, 01:05 AM)nollidnosnhoj Wrote: [ -> ]
(2015-08-11, 07:24 PM)Ad Bakker Wrote: [ -> ]In line 798 of forumdisplay.php the subject is parsed on bad words. Could it help when you comment this line?

how to comment a php line?

Here is all information about comments. http://php.net/manual/en/language.basic-...mments.php

Basically you put 2 forward slashes in front of the line you want to comment out.

<?php

// <- This will comment this line out.

// $parseThread = parse($Thread);

Oh that makes since.

(2015-08-11, 07:24 PM)Ad Bakker Wrote: [ -> ]In line 798 of forumdisplay.php the subject is parsed on bad words. Could it help when you comment this line?

I commented it out, and it worked when viewed in forumdisplay.php

but when viewing showthread.php (like the screenshot presented in the first post), it didn't work.

I tried commenting out the lines in showthread.php with the phrase (badwords) and none didn't work.
(2015-08-13, 06:29 AM)nollidnosnhoj Wrote: [ -> ]I commented it out, and it worked when viewed in forumdisplay.php

but when viewing showthread.php (like the screenshot presented in the first post), it didn't work.

I tried commenting out the lines in showthread.php with the phrase (badwords) and none didn't work.

I hope you did not comment out line 82, because then it is better to change lines 82 and 83 into:

$reply_subject = $thread['subject'];
$thread['subject'] = htmlspecialchars_uni($reply_subject);

I left it in this way because the coding is a bit messy there, and the variable $reply_subject is used also elsewhere.

In attition  line 1141 could be commented out, although this is only for similar threads and probably not relevant here. The same yields for line 1554, which is only used for threaded view, whereas I expect you only use linear mode.

I just see now, that for showthread, the subject is parsed on bad words again in inc/functions_post.php line 166, so also this line should be commented out.
(2015-08-13, 08:35 AM)Ad Bakker Wrote: [ -> ]
(2015-08-13, 06:29 AM)nollidnosnhoj Wrote: [ -> ]I commented it out, and it worked when viewed in forumdisplay.php

but when viewing showthread.php (like the screenshot presented in the first post), it didn't work.

I tried commenting out the lines in showthread.php with the phrase (badwords) and none didn't work.

I hope you did not comment out line 82, because then it is better to change lines 82 and 83 into:

$reply_subject = $thread['subject'];
$thread['subject'] = htmlspecialchars_uni($reply_subject);

I left it in this way because the coding is a bit messy there, and the variable $reply_subject is used also elsewhere.

In attition  line 1141 could be commented out, although this is only for similar threads and probably not relevant here. The same yields for line 1554, which is only used for threaded view, whereas I expect you only use linear mode.

I just see now, that for showthread, the subject is parsed on bad words again in inc/functions_post.php line 166, so also this line should be commented out.

Alright! I did everything, and it worked! But now I need to disable word filter on the recent post on index.php
http://i.imgur.com/NyabU5G.png

And possibly on search.php

EDIT: Alright, I think I have fixed it. Thank you so much everyone for helping !