PDA

View Full Version : Replace censored text with an image


Gary King
05-31-2003, 10:00 PM
Replace censored text with an image

What does this hack do?

Instead of replacing censored text with a character (like censor with ******), it will instead replace the text with one user-defineable image instead.

How do I install this?

Simply read the instructions in the attached file.


Notes

This hack will...
only work for forums where either HTML code and/or image BB code is enabled
not censor properly in thread topics

If there is enough demand for the above features to be included, then I will include them.

Dan
06-01-2003, 02:05 AM
Nice one Gary.... If i can find an interesting image I'll use it

Christine
06-01-2003, 02:05 AM
Wow -- that was quick! :classic:

I am having a problem with it though -- It is pulling through the path to the image path on the post, not the image itself.

What am I missing?

Cheers!

Gary King
06-01-2003, 02:17 AM
Today at 11:05 PM Oricon said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=402692#post402692)
Nice one Gary.... If i can find an interesting image I'll use it

An image is now attached to the first post of this thread. Check it out ;)

Gary King
06-01-2003, 02:18 AM
Today at 11:05 PM Christine said this in Post #3 (https://vborg.vbsupport.ru/showthread.php?postid=402693#post402693)
Wow -- that was quick! :classic:

I am having a problem with it though -- It is pulling through the path to the image path on the post, not the image itself.

What am I missing?

Cheers!

Please copy and paste the code where you have included the image's path, and maybe 2-3 lines above and below it.

Christine
06-01-2003, 02:25 AM
Here ya go! while (list($key,$val)=each($censorword)) {
if ($val!="") {
if (substr($val,0,2)=="\\{") {
$val=substr($val,2,-2);

$text=trim(preg_replace("/([^A-Za-z])".$val."(?=[^A-Za-z])/si","\\1".repeatchar($censorchar,strlen($val))," $text "));
} else {
$censorimage="http://www.sitename.com/images/attach/censored.gif";
$text=trim(preg_replace("/$val/si","<img src='$censorimage'>"," $text "));
}
}

Cheers!

Christine
06-01-2003, 02:30 AM
Here is another image to look at as well.

Cheers!

Boofo
06-01-2003, 02:34 AM
I'm having the same problem as Christine. No image, just the path shows.

Gary King
06-01-2003, 02:41 AM
Mind posting a URL to a post containing a censored word so I can see the output?

This hack works for me, so I am not too sure on what the problem might be at this point.

Boofo
06-01-2003, 02:43 AM
I have html and image tags turned off, could that have anything to do with it?

Gary King
06-01-2003, 02:53 AM
Please read the update instructions file.

Boofo
06-01-2003, 03:01 AM
So that was the problem then. Ok, can't use it. ;)

Christine
06-01-2003, 03:36 AM
Gary, I am sorry -- I am confused here. I don't see anything in the instructions that I didn't do. I attached the file I am working from.

Boofo
06-01-2003, 03:39 AM
There's an updated file attached to the first post. ;)

gmarik
06-01-2003, 04:24 AM
Christine, nice.

Christine
06-01-2003, 04:45 AM
*slinks off to get new file*

Christine
06-01-2003, 05:18 AM
Gary, can you double check the code for instruction set #2?

Those three lines of code are making me white screen.

Cheers!

Breaker
06-01-2003, 10:41 AM
what is the difference between part 1 and part 2 of the instructions..........

nice hack though, may use for something other than censoring

grog6
06-01-2003, 10:51 AM
Or you could use this smilie too :D

EDIT : Oupss, havn't seen your smilie before Gary W , sorry for this stupid post :p

Tubbie
06-01-2003, 11:40 AM
very funny hack!
it works.

*install*

Gary King
06-01-2003, 01:07 PM
Today at 07:41 AM Breaker said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=402823#post402823)
what is the difference between part 1 and part 2 of the instructions..........

nice hack though, may use for something other than censoring

Quoted from the installation file:THERE ARE TWO PARTS TO THE INSTALLATION.
PART 1) USE THIS IF YOU HAVE HTML CODE ENABLED IN YOUR FORUMS
PART 2) USE THIS IF YOU HAVE IMAGE BB CODE ENABLED IN YOUR FORUMS

Gary King
06-01-2003, 01:25 PM
Today at 02:18 AM Christine said this in Post #17 (https://vborg.vbsupport.ru/showthread.php?postid=402741#post402741)
Gary, can you double check the code for instruction set #2?

Those three lines of code are making me white screen.

Cheers!

Please download the new attached file and try again.

Gary King
06-01-2003, 01:28 PM
Yesterday at 11:30 PM Christine said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=402700#post402700)
Here is another image to look at as well.

Cheers!

Added :)

Cyricx
06-01-2003, 03:04 PM
Jeez dude! Slow down and gimme time to install all these! ;)

J/k!

Awesome work again Gary :)

Thanks!

Gary King
06-01-2003, 08:41 PM
Thanks for the comments! :)

Nebby
06-02-2003, 12:50 AM
Could you just put <img src = or [img] in the replacement field in AdminCP?

X-Fan
06-02-2003, 01:03 AM
What if you've got both HTML and BB IMG code enabled in some forums? Which code set do you use in that case?

Gary King
06-02-2003, 01:04 AM
Today at 10:03 PM X-Fan said this in Post #27 (https://vborg.vbsupport.ru/showthread.php?postid=403207#post403207)
What if you've got both HTML and BB IMG code enabled in some forums? Which code set do you use in that case?

Either one.

Gary King
06-02-2003, 01:10 AM
Today at 09:50 PM Nebby said this in Post #26 (https://vborg.vbsupport.ru/showthread.php?postid=403199#post403199)
Could you just put <img src = or [img] in the replacement field in AdminCP?

You could, but the replacement field is not meant for that. It's generally not a good idea to use it for things besides what it's actually for.

Also, it would mess up some things, like the subject area. Try using the replacement field, use a censored word in the subject, and then edit the subject - the input field gets messed up.

Areku
06-03-2003, 11:46 AM
Any working URL site?

Gary King
06-03-2003, 06:51 PM
Today at 08:46 AM Areku said this in Post #30 (https://vborg.vbsupport.ru/showthread.php?postid=403829#post403829)
Any working URL site?

If you are wondering if this works or not, it does. Just try it out; the installation is very short and simple.

Steve W.
06-03-2003, 09:59 PM
Installed and working at http://rockpop.goldenpie.com/forums for those wanting an example ;)

Brilliant hack, Gary! Well done!!

Mellow
11-20-2003, 02:27 PM
Here's an Image that I'll use for this one, just in case someone want it.

http://mellowwing.com/forum2/images/smilies/misc/y6.gif

Gary King
11-20-2003, 06:41 PM
Here's an Image that I'll use for this one, just in case someone want it.

http://mellowwing.com/forum2/images/smilies/misc/y6.gif
I get Forbidden
You don't have permission to access /forum2/images/smilies/misc/y6.gif on this server.



When I try accessing it.

Silverstangs
12-10-2003, 01:07 PM
Great hack so far, but I did find something I was hoping you can fix. What ever words are in the brackets {censoredword} in the admin cp don't get replaced by the image file. How would I fix that?

Gary King
12-10-2003, 11:14 PM
Great hack so far, but I did find something I was hoping you can fix. What ever words are in the brackets {censoredword} in the admin cp don't get replaced by the image file. How would I fix that?
That is not a default replacement is it?

Silverstangs
12-11-2003, 05:52 AM
no the words that are seperated by spaces are the default replacement, the ones in brackets are more specific to certain way a word is used. for example the word assemble would have the first three assemble charactors censored out. but if you put those three assemble charators in brackets on the censor list, it will only take the first three charactors out if they appear alone.

Gary King
12-11-2003, 11:06 AM
Is this a hack you are using for vBulletin 2? Or is this vBulletin 3?

Roxie
12-11-2003, 07:11 PM
I'm confused. Can't you just use the word for the smilies..?
For instance if I want to censor the word H-e-l-l, I could name the censored smilie h e l l and then when someone types it, they get the image?

Gary King
12-11-2003, 09:18 PM
If you want to, sure then go ahead :)

Silverstangs
12-12-2003, 06:29 AM
Is this a hack you are using for vBulletin 2? Or is this vBulletin 3?
Opps sorry

I am running Version 2.3.3 over at www.stangcountry.com

Gary King
12-12-2003, 07:38 PM
I don't think that what you mentioned is a default function of vBulletin 2.

Silverstangs
12-16-2003, 03:54 AM
I tried using the short letters for the censorword, so instead of astricks I got :cnsr::csnr: repeadiatly, so you will need to use the hack.

streamzone
08-25-2004, 03:30 PM
is there same hack for vBB 3.0.3?