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)
-   -   Replace censored text with an image (https://vborg.vbsupport.ru/showthread.php?t=53665)

Gary King 05-31-2003 10:00 PM

Replace censored text with an image
 
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

Quote:

Today at 11:05 PM Oricon said this in Post #2
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

Quote:

Today at 11:05 PM Christine said this in Post #3
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!
PHP Code:

    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

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

Tubbie 06-01-2003 11:40 AM

very funny hack!
it works.

*install*

Gary King 06-01-2003 01:07 PM

Quote:

Today at 07:41 AM Breaker said this in Post #18
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:
Quote:

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

Quote:

Today at 02:18 AM Christine said this in Post #17
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

Quote:

Yesterday at 11:30 PM Christine said this in Post #7
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

Quote:

Today at 10:03 PM X-Fan said this in Post #27
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

Quote:

Today at 09:50 PM Nebby said this in Post #26
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

Quote:

Today at 08:46 AM Areku said this in Post #30
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

Quote:

Originally Posted by Mellow
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
Quote:

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

Quote:

Originally Posted by Silverstangs
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 :)


All times are GMT. The time now is 04:05 AM.

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.01408 seconds
  • Memory Usage 1,817KB
  • 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
  • (1)bbcode_php_printable
  • (12)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