PDA

View Full Version : Suggestion: More censor options


SilverArrow
Wed 19th Sep '01, 8:03pm
Having the censor is cool and everything, but it would be more useful if the script converted words to other words, except for putting the specified symbol in place.

BUT... changing the words would be more effective. It wouldn't confuse some people with the symbols there, and it would leave the person's message making more sense than it would if it had the *all over it.

Say you censored the word house.
If a person posted a message with the word house it would show as *****, but with my system you could add a line in the admin CP to replace house with home, maybe like house=home. Just a simple line like that.

So if a person posted: "I live in a house." it would show on the BB as "I live in a home."

Does anyone think this would be effective, and better than a normal censor?

JamesUS
Thu 20th Sep '01, 2:35am
I believe you can actually do this with the Replacement Variables feature :)

SilverArrow
Thu 20th Sep '01, 5:07pm
Well, you could make it easier for some of the newbies and stuff... BTW, thx for telling about it :D

Jet
Thu 6th Dec '01, 6:23am
How could I convert house to hou*e AND NOT to ***** ?
Thanks

JamesUS
Thu 6th Dec '01, 12:15pm
Add a replacement variable, replacing 'house' with 'hou*e'. See the control panel for more info.

Jet
Sun 9th Dec '01, 6:50pm
Thanks a lot; two questions about:
1) is this a workaround to censor options (too few words) ?
2) does the replacement act at writing time or later ad showing time ? I.e., if I already have a lot of posts and apply NOW a replacement variable, all the words in previous posts are affected ?

Thanks again

tubedogg
Mon 10th Dec '01, 3:44am
1) It can be. :)
2) Replacement variables are applied (act) at showing time.

Jet
Mon 10th Dec '01, 5:43am
Thanks. Excuse, Tubedogg.... forgot step three... ;)

3) I saw the two 'replacement' concerned tables (itself and 'set' one)... :)
Well, I would make a new set as a container of all my custom words without messing the 'default' one.
If so, could I unpredictly override the replicements in the default set or all the different sets are valid at the same time ?
I fear could do that without realize.
Because the key replacementsetid in the replacementset table is '1' for default instead the foreign key in the other table is '-1'. This lead me to think about some program 'manipulation' of the defaults (even of the default and active values, as is for templates).

What's the schema ? :)
Thanks again.

Jet
Mon 10th Dec '01, 6:16am
Post trying addon: nothing works ! :)

I created a new replacementset. I added some custom words within and/or without '{}' .... Tried to post something with those words, but none of them, later, has been replaced ....

:confused:

Thanks again.

tubedogg
Mon 10th Dec '01, 6:19am
You should add any custom replacement variables to the Default Replacement Set. Only one set (in this case #1) can be active at a time, just like with Templates. -1 is used in the case that there is no value for the set (currently in use) for an item.

Example: I have the following replacement variables:
<body>
{categorytextcolor}
{tableheadbgcolor}
{firstaltcolor}

And I have customized these two:
{categorytextcolor}
{tableheadbgcolor}

So <body> and {firstaltcolor} are what they are when I first installed vBulletin. So, when vBulletin looks at them, it uses set #1 for these two:
{categorytextcolor}
{tableheadbgcolor}

and set #-1 for these two:
<body>
{firstaltcolor}

See?

No matter what set you are using, it uses set #-1 for any non-customized templates.

Jet
Mon 10th Dec '01, 6:51am
Ok. Thanks.
Now it works... and is, as said elsewhere <grin>, case-sensitive.... ;) So I tried to to create multiple lines for each word to replace, but actually the keyword is NOT case sensitive when added to the table; instead, the word replaced is it. :confused:

Again, what's the exact meaning of '{}' ? I guessed it was the same specified in censor options (i.e. a way to specify a whole word not a string to replace everywhere..), but it isn't right...
Then ?

Thanks again.

tubedogg
Mon 10th Dec '01, 11:07pm
The use of { } is actually kind of arbritrary, I believe. You could use anything - or nothing, it doesn't matter. :)

Jet
Tue 11th Dec '01, 6:38am
Anyway, I can't create more than one DB entry for each word, as it isn't case-sensitive in MySql as table key; instead, in the replacements, it is
:( :confused:
Thnx

Jet
Tue 11th Dec '01, 6:45am
(reply here... ;) )
Originally posted by tubedogg
Hmm...As I mentioned this needs to be changed so replacement variables are not case-sensitive. Until then there's not much that can be done. :(

Well. What do you think: could we move to vb.org and try to build a hack to make the replacement search case insensitive ?
:)
Thnx again

raspy
Thu 10th Jan '02, 12:59am
YES please!

kinda pointless to have replacements as a censoring option.. if it's NOT case sensitive!

Mas*Mind
Thu 10th Jan '02, 3:24am
Personally I think it's bad design that your replacement variables are also applied within posts. There should be a distinction between template-replacement vars and post-replacement vars imo

for example when I use { imagesfolder} (without the spaces) it will be parsed: images

Jet
Thu 10th Jan '02, 6:16am
Yes, but I think is a LARGER bug that I can't specify different-case replacement variables because DB accepts them as the same value to replace, instead php can't search and replace as it is case-sensitive.
Otherwise I should hack the code and use regular-expression php replace functions like eregi_replace() or preg_replace() with a server overload of about 1000 percent than the other function (see php.net).

I think should be better to have the standard replacements managed by str_replace() as is now, and an array of enhanced/custom replacements managed by preg_replace(), for example...

IMOO, of course...


What do you think about ?

Note: I think it shouldn't be an hack matter, but a bugfix/new release one, should it ?

Thanks