PDA

View Full Version : Word Replacement


applehat
06 Aug 2005, 20:57
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* http://www.vbulletin.org/forum/images/smoothblue/buttons/installed.gif (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=93758) *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?


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

ThePimp
06 Aug 2005, 22:24
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
07 Aug 2005, 02:12
thanks! this fun. i used my to replace curse words with mytzlplk lol

BamaStangGuy
07 Aug 2005, 03:00
umm is it just me or does this work exactly like the Replacement Variable Manager already in vBulletin?

TCM
07 Aug 2005, 09:04
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
07 Aug 2005, 09:53
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
07 Aug 2005, 10:36
This does almost the same thing as my hack ..http://www.vbulletin.org/forum/showthread.php?s=&threadid=71191

Boofo
07 Aug 2005, 10:48
This does almost the same thing as my hack ..http://www.vbulletin.org/forum/showthread.php?s=&threadid=71191

R U going to update yours for 3.5? ;)

Rhoads
07 Aug 2005, 11:00
Nice hack, thnx ;)

Logikos
07 Aug 2005, 11:23
R U going to update yours for 3.5? ;)

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

akanevsky
07 Aug 2005, 13:48
I was actually thinking of doing it myself, but since Live Wire is going to port the 3.0 version, I won't.

applehat
07 Aug 2005, 20:03
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
07 Aug 2005, 20:21
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
07 Aug 2005, 21:10
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
07 Aug 2005, 21:12
actualy we went back to are heavy modded phpbb1.3 :-P

/me is ashamed

applehat
08 Aug 2005, 02:51
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
24 Aug 2005, 23:17
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
25 Aug 2005, 00:35
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
25 Aug 2005, 20:54
and how do i go about doing that if you dont mind sharing?

TCM
25 Aug 2005, 22:27
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
25 Aug 2005, 22:30
Also, in the example, a link to google would be broken.

The user posts Google (http://google.com).

Instead of getting


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



They'd get



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



The second google wouldn't even be replaced, beause this isn't even case sensitive.

Audionuts
26 Aug 2005, 03:56
thank you TCM

amykhar
26 Aug 2005, 04:17
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
27 Aug 2005, 13:04
You might need a simple regular expression here..

pyro.699
07 Oct 2005, 22:31
nvm.

G-man
08 Oct 2005, 17:19
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
20 Nov 2005, 07:06
-bump-


...any updates? :)

GamerJunk.net
21 Nov 2005, 07:35
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
08 Feb 2006, 06:12
don't have the postbit_display_complete template.. is there some other way? >_<

kobescoresagain
14 Jul 2006, 01:50
so does this break links?

asasi
14 Jul 2006, 11:00
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
14 Jul 2006, 12:06
Thanks, just installed it! :)

kobescoresagain
15 Jul 2006, 01:49
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
15 Jul 2006, 13:41
greeeeeeeeeeeeeeeat

i was searching for something like that....

thanks alot...

nasko
17 Jul 2006, 20:52
Where should i put this code on v.3.5.4?

BloodRavens
30 Jul 2008, 07:52
Hello. Is this code work on 3.7x?

Anyoldname
15 Feb 2009, 23:47
Anyone know if this will work on 3.8x?

mdawg
02 May 2009, 19:53
Same question, will this work on 3.8.2 ?

Lynne
03 May 2009, 04:16
It's just php string replacement, so yes it will work in 3.8.2.

MrRem
15 Apr 2010, 14:29
And 3.8.5 ?

oedipean
10 Feb 2011, 06:25
Is there something like it for VB 4 ?

prophetmuhammad
21 Nov 2011, 13:05
need something like this for vb4 thanks

Sadie Frost
09 Jan 2012, 04:59
Works on 3.8.6 :D

Saudi Zoom
25 Jun 2012, 09:19
I used it to replace certain words with Google adsense codes that I'm planning to include in my articles in certain places! Worked perfect! Thx!

vikash.sharma
26 Jul 2012, 10:40
Thanks applehat ..

RyanFabbro
01 Dec 2012, 12:09
i know its a big bump but i wanted to point out to people, if you use spaces in your replacement words it shouldnt break the links

example


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



notice in this example google links should be fine, but the yahoo ones probally will still break since they have no spaces

but be sure to include spaces in your replacement also, or it will end up like

let check outGOOGLEits cool

im not sure if you would use &nbsp; for the space or just use a normal space, i havent tested