vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Word Replacement (https://vborg.vbsupport.ru/showthread.php?t=93758)

applehat 08-05-2005 10:00 PM

Word Replacement
 
This is just a simple plug-in that will let you replace words in posts. This could be used for "AdWords" or Replacing curse words insted of just censoring.

Just thought I would share :-P

*cough* https://vborg.vbsupport.ru/ *cough*

I am a dumb novice, so this has no admin panel options or anything of that sort. If anyone ever wants to take this and make it all fancy, go ahead and just post.

Note: This should work on any 3.5 version that has the hook postbit_display_complete

This is the code...See how google is replaced with a link to google...make sence?
PHP Code:

$word = array(
'google',
'yahoo'
);

$link = array(
'<a href="http://google.com">google</a>',
'<a href="http://yahoo.com">yahoo</a>'
);


$this->post['message'] = str_replace($word$link$this->post['message']); 


ThePimp 08-06-2005 09:24 PM

Nice one. Been looking for something like this... It would be nice to have this added to the admincp, with a CP module/plugin, where you can add a word + it's replacement value, possibly in the Forum Manager, and each forum can have different censors. Just a suggestion.

chanzero 08-07-2005 01:12 AM

thanks! this fun. i used my to replace curse words with mytzlplk lol

BamaStangGuy 08-07-2005 02:00 AM

umm is it just me or does this work exactly like the Replacement Variable Manager already in vBulletin?

TCM 08-07-2005 08:04 AM

Quote:

Originally Posted by BrentWilson
umm is it just me or does this work exactly like the Replacement Variable Manager already in vBulletin?

Except less powerful? Yea, it does. Very much so.

dwh 08-07-2005 08:53 AM

If I understood both systems correctly, the replacement variable manager affects everything in the post AND everything in templates. So if you replace "<td>" with "NO HTML", then all your templates with "<td>" in it would be broken, whereas this hack only affects data in a post.

I could be wrong, but that's my impression.

Logikos 08-07-2005 09:36 AM

This does almost the same thing as my hack ..https://vborg.vbsupport.ru/showthrea...threadid=71191

Boofo 08-07-2005 09:48 AM

Quote:

Originally Posted by Live Wire
This does almost the same thing as my hack ..https://vborg.vbsupport.ru/showthrea...threadid=71191

R U going to update yours for 3.5? ;)

Rhoads 08-07-2005 10:00 AM

Nice hack, thnx ;)

Logikos 08-07-2005 10:23 AM

Quote:

Originally Posted by Boofo
R U going to update yours for 3.5? ;)

Of course I am. I'm going for that Master Coder tile. :p

akanevsky 08-07-2005 12:48 PM

I was actually thinking of doing it myself, but since Live Wire is going to port the 3.0 version, I won't.

applehat 08-07-2005 07:03 PM

I actualy used your had on vb3.0.7! I just needed something untille you updated yours. This was simple yo write and on our site we sell replacement words as advertisement...so I needed something quick. Once yours is releaced ill start using it again.

Thats why I have not worried about any admin cp stuff. Im to lazy to write all that since I knew you would port it :-P

Logikos 08-07-2005 07:21 PM

Quote:

Originally Posted by applehat
I actualy used your had on vb3.0.7! I just needed something untille you updated yours. This was simple yo write and on our site we sell replacement words as advertisement...so I needed something quick. Once yours is releaced ill start using it again.

Thats why I have not worried about any admin cp stuff. Im to lazy to write all that since I knew you would port it :-P

I'm sorry to keep you waiting :p. have you deleted the database fields that my original hack creates? Cause if you didn't then when you upgrade my ported version, all your original data will still be available. :)

applehat 08-07-2005 08:10 PM

actualy we went back to are heavy modded phpbb1.3 :-P

Its realy a long story...but yeah we have all the info.

The main features we are worried about right now is journals...that need to be ported eventualy XD..../me whonders who wrote that...*goes and looks*

Logikos 08-07-2005 08:12 PM

Quote:

Originally Posted by applehat
actualy we went back to are heavy modded phpbb1.3 :-P

[high]* Logikos is ashamed[/high]

applehat 08-08-2005 01:51 AM

lol, we are gonna fully hack out our vb3.5 to what we need THEN...we will convert back.

Oh man, that phpbb is crappy *rolls eyes*

Audionuts 08-24-2005 10:17 PM

is there any way to make this work in the thread title also?
so if a user posted the word in the title it would also be replaced?
thanks in advanced, and great hack!

TCM 08-24-2005 11:35 PM

Quote:

Originally Posted by Audionuts
is there any way to make this work in the thread title also?
so if a user posted the word in the title it would also be replaced?
thanks in advanced, and great hack!

Is there any way? Yea, with replacement variables.

Audionuts 08-25-2005 07:54 PM

and how do i go about doing that if you dont mind sharing?

TCM 08-25-2005 09:27 PM

Quote:

Originally Posted by Audionuts
and how do i go about doing that if you dont mind sharing?

Basicly all this hack is is a weakend verision of replacement variables. I don't even see why this thread still exists.

You can set replacement variables in Admin CP -> Styles & Templates -> Replacement Variables Manager

TCM 08-25-2005 09:30 PM

Also, in the example, a link to google would be broken.

The user posts Google.

Instead of getting
HTML Code:

<a href="http://google.com" target="_blank">Google</a>
They'd get

HTML Code:

<a href="http://<a href="http://google.com">google</a>.com" target="_blank">Google</a>
The second google wouldn't even be replaced, beause this isn't even case sensitive.

Audionuts 08-26-2005 02:56 AM

thank you TCM

amykhar 08-26-2005 03:17 AM

Quote:

Originally Posted by TCM
Basicly all this hack is is a weakend verision of replacement variables. I don't even see why this thread still exists.

You can set replacement variables in Admin CP -> Styles & Templates -> Replacement Variables Manager

A hack like this is necessary BECAUSE it is weaker. If you change a word in the title of a thread to a link, then the replacement would mess up the link to the thread.

It would be ideal if the replacement system had an option. Replace everywhere or just replace in posts.

akanevsky 08-27-2005 12:04 PM

You might need a simple regular expression here..

pyro.699 10-07-2005 09:31 PM

nvm.

G-man 10-08-2005 04:19 PM

This works great but is there a workaround for the fact some people use caps in brand names and others do not? I tried to put in the same brand name twice once with and once without a cap not thinking it would try to apply the link to both. How can we make this where it does not matter if the word has caps in it or not?

zagman76 11-20-2005 06:06 AM

-bump-


...any updates? :)

GamerJunk.net 11-21-2005 06:35 AM

This would be good for ads definatley...if I could find a good ad company that sells items like IGN does with their things

Luggruff 02-08-2006 05:12 AM

don't have the postbit_display_complete template.. is there some other way? >_<

kobescoresagain 07-14-2006 12:50 AM

so does this break links?

asasi 07-14-2006 10:00 AM

great job!!
just a question. in windows XP 2 characters in my board language changed.
i can replace characters with this hack in db?:banana:

Snake 07-14-2006 11:06 AM

Thanks, just installed it! :)

kobescoresagain 07-15-2006 12:49 AM

DarkBlade can you fix this code... so it works correctly... I did some testing, and it breaks all links with one of those words on it.

aLReeMi 07-15-2006 12:41 PM

greeeeeeeeeeeeeeeat

i was searching for something like that....

thanks alot...

nasko 07-17-2006 07:52 PM

Where should i put this code on v.3.5.4?

BloodRavens 07-30-2008 06:52 AM

Hello. Is this code work on 3.7x?

Anyoldname 02-15-2009 10:47 PM

Anyone know if this will work on 3.8x?

mdawg 05-02-2009 06:53 PM

Same question, will this work on 3.8.2 ?

Lynne 05-03-2009 03:16 AM

It's just php string replacement, so yes it will work in 3.8.2.

MrRem 04-15-2010 01:29 PM

And 3.8.5 ?


All times are GMT. The time now is 02:09 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.01227 seconds
  • Memory Usage 1,801KB
  • 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
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (8)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