vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   User-Selectable Optional Language Replacement Censor (https://vborg.vbsupport.ru/showthread.php?t=53640)

007 05-30-2003 10:00 PM

User-Selectable Optional Language Replacement Censor
 
User-Selectable Optional Language Replacement Censor by 006

What this hack does:

This will give your users the option whether or not they want to have certain words censored or not. Also instead of the standard *** for censored words, this lets you substitute different words that will be used to replace words.

For example, if the user has language filter turned on, and the word "dog" is censored, and you have chosen to have the word "cat" be used as a replacement, then this user will see the word "cat" in every post where the word "dog" is used. If the user does not choose to enable censoring, they will see the word "dog."

(No use censoring that word lol, it's just for the example) ;)

Benefits of this hack:

People will no longer try to cheat to get their words in by typing "[b][/b]" in the middle of certain censored words to fool the word filter. If they want to see all words, they choose to not use the censor and are happy. If they are offended by certain words, they can use the censor and be happy. Everybody wins. :pirate:

User-Selectable Optional Language Replacement Censor

by 006

INSTALLATION TIME:

About 20 - 30 minutes. (6 steps, 4 file edits, 3 template edits, and 1 query)

It has been tested and works fine in 2.2.9

Any questions? Feel free to ask in this thread. ;)

If you use this hack, please click "INSTALL." Thanks

:)

Updated install file to .php so it doesn't parse replacements.

Dan 05-31-2003 05:12 PM

Oh this is so useful... some of my members are offended by the words i censored and some don't care and want to see them so great hack and I'll install it in a few.

/me clicks install

007 05-31-2003 05:13 PM

Cool. Let me know how it goes for you.

:)

assassingod 05-31-2003 05:17 PM

Very cool;) I'll install this on locally later

007 05-31-2003 05:21 PM

Cool. I just updated the installation file so censoring is turned on by default for guests.

The only change is in functions.php

Change
PHP Code:

if ($bbuserinfo[usecensor]!=0

to
PHP Code:

if ($bbuserinfo[usecensor]!=or $bbuserinfo[userid]==0


Koutaru 05-31-2003 05:35 PM

this is excellent :) thanks 006 -- I'll check it out when I get home

Chris M 05-31-2003 06:05 PM

Nice idea:)

Satan

007 05-31-2003 06:06 PM

Thanks. Let me know how it goes everyone. :)

Chris M 05-31-2003 06:11 PM

Ok a quick question:

admin/functions.php, we are told to add:

Code:

// User-Selectable Optional Language Replacement Censor by 006
if ($bbuserinfo[usecensor]!=0 or $bbuserinfo[userid]==0) {
$bbcode=eregi_replace("wordtocensor","replacewith", $bbcode);
$bbcode=eregi_replace("wordtocensor","replacewith", $bbcode);
} else {}
// User-Selectable Optional Language Replacement Censor by 006

But there is nothing in the "} else {" statement...

Also :

registeradult template:

Code:

<tr>
        <td bgcolor="{firstaltcolor}"><normalfont><b>Pop up a box when you receive a Private Message?</b></normalfont><br>
        <smallfont>This will pop up a small warning box when you receive a Private Message asking whether you want to view the message.</smallfont></td>
        <td bgcolor="{firstaltcolor}"><normalfont>
                <input type="radio" name="pmpopup" value="yes"> yes
                <input type="radio" name="pmpopup" value="no" checked> no
        </normalfont></td>
</tr>


-----------------------FIND-------------------------------------


and underneath it, add
---------------------------------ADD----------------------------


<tr>
        <td bgcolor="{secondaltcolor}"><normalfont><b>Pop up a box when you receive a Private Message?</b></normalfont><br>
        <smallfont>This will pop up a small warning box when you receive a Private Message asking whether you want to view the message.</smallfont></td>
        <td bgcolor="{secondaltcolor}"><normalfont>
                <input type="radio" name="usecensor" value="yes" checked> yes
                <input type="radio" name="usecensor" value="no"> no
        </normalfont></td>
</tr>

Forgot to change something?:D

Satan

007 05-31-2003 06:13 PM

MY BAD! (Will change that now) :)


and..

There's not supposed to be. That just leaves censoring totally off for people who selected to turn it off.

Chris M 05-31-2003 06:17 PM

Well surely you would just have:

Code:

// User-Selectable Optional Language Replacement Censor by 006
if ($bbuserinfo[usecensor]!=0 or $bbuserinfo[userid]==0) {
$bbcode=eregi_replace("wordtocensor","replacewith", $bbcode);
$bbcode=eregi_replace("wordtocensor","replacewith", $bbcode);
}
// User-Selectable Optional Language Replacement Censor by 006

I have a few suggestions for the next version if I may?:)
  • List of censored words
  • User can add their own words
OR
  • List of censored words
  • User can suggest words to be censored

:)

Satan

007 05-31-2003 06:20 PM

Fixed. I also noticed that vb.org was parsing the replacement values, so I changed the install file to .php.

To answer your question before. The else isn't really necessary... (edited. I took it out. My bad!) :)

Chris M 05-31-2003 06:21 PM

Ok, but IMO having an }else{ statement for nothing seems wasted;)

Luckily, in the .txt file I downloaded, the replacements were OK, it was just because I copied them from the .txt file into my post;):)

Satan

007 05-31-2003 06:23 PM

I took it out now. I originally had something in there but decided it wasn't needed. I see what you meant. lol

*Wonders what he was thinking*

007 05-31-2003 06:28 PM

Quote:

Today at 02:17 PM hellsatan said this in Post #11
I have a few suggestions for the next version if I may?:)...

As much as I hate to hardcode variables it was my only choice because I don't know any other way to do it. If you want to do that feel free and PM me and I will update the install file.

You'd get credit of course. :)

Chris M 05-31-2003 06:29 PM

Not to be a pest, but you made another typo;)

in registeradult:
Code:

<normalfont><b>se language filter?</b></normalfont>
=
Code:

<normalfont><b>Use language filter?</b></normalfont>
:)

Satan

Chris M 05-31-2003 06:30 PM

Quote:

Today at 08:28 PM 006 said this in Post #15
As much as I hate to hardcode variables it was my only choice because I don't know any other way to do it. If you want to do that feel free and PM me and I will update the install file.

You'd get credit of course. :)

Ok sure:) I'll have a tamper around and see what I can come up with:)

Satan

007 05-31-2003 06:38 PM

Fixed the typo.. lol

You're killing me man.. j/k lol :)

Thanks! :p

Chris M 05-31-2003 06:49 PM

It works very well:)

Maybe thread titles could do with it as well;)

And i'm working on the list thing;):)

Satan

007 05-31-2003 07:25 PM

Quote:

Today at 02:49 PM hellsatan said this in Post #19
Maybe thread titles could do with it as well;)
Satan

I see what you mean.. Which file are thread titles censored? I' sure there is a way to make this also work with the standard censoring feature to, but for now you just have to turn it off...

I will look into that. Good idea.

Chris M 05-31-2003 08:09 PM

I think they are censored in forumdisplay.php and showthread.php:)

Satan

007 05-31-2003 10:05 PM

I looked in both of those earlier today with no luck.

Koutaru 06-01-2003 04:58 AM

i believe

$subject=censortext($subject);

in editpost, newthread, newreply
;) then again I may be wrong

007 06-01-2003 05:22 AM

Mine didn't have that... I'll look again tomorrow. It's late. :)

Chris M 06-01-2003 10:23 AM

Aha -

In newreply.php:
Code:

    $title=censortext($title);
    $message=censortext($message);

    // sort attachement

In newthread.php:
Code:

    $subject=censortext($subject);
    $message=censortext($message);

    // remove all caps subjects

In editpost.php:
Code:

  $title=censortext($title);
  $message=censortext($message);

  // remove all caps subjects

:)

Satan

Tony G 06-01-2003 10:26 AM

Convienient mod, thanks for this. May just use. :)

Mike11212 06-01-2003 06:38 PM

question does the word filter in the admin cp have to be enabled or disabled for this to work correctly?

007 06-01-2003 07:26 PM

Well I just updated the install file now.

Changed step 6. With the update, you DO (yes) need to have censoring enabled in admincp.

Thread titles will now be censored as well, but will be censored regardless of the users preferences. If anyone knows how to use the replacement system for the thread titles based on if the user has selected to use censoring or not please let me know.

Thanks.

If you don't see a different step 6 then clear your cache and then try downloading again.

:)

Chris M 06-01-2003 08:40 PM

Quick Q:

Which step 6?

The first one, second one or third one?;):p

Satan

007 06-01-2003 08:48 PM

Everything in step 6 is new. :)

The old step 6 was just disabling the censor option from admincp... but now you need it enabled, at least if you use the new step 6.

~006 :)

Chris M 06-02-2003 07:12 PM

I will wait and see if a way is found to do it via your method for titles - If one is not found, I will see if I can find some way to make it do it:)

Satan

007 06-02-2003 11:38 PM

Cool. And I just found out that the censoring option needs to be turned OFF in your admin CP for this hack to work.

I am still trying to get this to work with titles... I found some censoring code in the functions.php a few scrolls under the edit this hack makes that I am looking into..

Chris M 06-03-2003 09:10 AM

Okies cool;)

Satan

Andrew111888 06-05-2003 07:59 PM

Umm.... everytime I try to click "Yes" to use language filter in my user cp and click edit options, it's set to No again?

Some help!

Andrew111888 06-05-2003 11:33 PM

Anybody?

Andrew111888 06-06-2003 09:50 PM

??????????????

007 06-06-2003 09:53 PM

Huh?

Andrew111888 06-07-2003 01:01 AM

Okay, I do everything I'm told to do. I have the filter in the admin cp set to off. I go to user CP and turn my filter on. I then re-enter my user cp options, and it's set to "no" again. I.E.: The filter doesn't stay on. My other users have noticed this too.

Any ideas?

Andrew111888 06-07-2003 02:55 PM

Jeez, within 11 hours a thread is bumpped back to halfway down on the second page...

007 06-07-2003 08:34 PM

Sounds like you may have missed a step in member.php

There are defining variables that determine whether or not the Yes or No radio buttons will be checked or not.

Try going back and making sure you did everything. It should definately work if you followed all of the directions.

You did run the query right?

Can you edit a users options in the admin cp? Does your selection stay there? If so then go back and redo the edits in member.php.


All times are GMT. The time now is 04:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01325 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete