![]() |
Text Replacement Links 1.1 (Updated!)
Text Replacement Links ==================== Author: Ken 'LiveWire' Iovino Site: www.vBhacks.us Version: 1.1 ==================== Updates
Huge Thanks I have to give a huge thanks to the following members that have helped me get this hack where it is now. Xenon, Kentaurus, nexialys, Geographic2, and lewekleonek. Thank you guys very much! What this does This will allow you to specified any text you add to automatically turn into a link when your members post the word. For example, you go to the ACP and add the word 'google' to the list and then you add the 'url' to googles website, and anytime a member post the word google, it will automatically turn it into a link. See screenshots for example. To do list...
Please read carefully and make all the necessary changes as stated. This is will work if installed properly. PLEASE REMEMBER TO BACKUP BEFORE YOU BEGIN! If you like this hack Click It Help & Support Before asking for support Please make sure you have done all necessary changes! If you still need support please post a reply here. Please post bugs and errors here. Hope you like, feedback welcomed. Special Thanks and Credit to -Xenon -Kentaurus -nexialys -Geographic2 -lewekleonek |
try replacing:
PHP Code:
PHP Code:
Take in consideration that we already have something called "replacement vars" that are configurable per style and that do "almost" the same thing that you are doing, except that they do it in a global way and not only in the post content. For words like google that are not part of any html or titles one might as well use replacement vars. |
This is the second time that I read about replacement vars. Where can I find that?
Ok never mind.... |
@ Kentaurus, Thanks alot i will test that right now.
|
Hi
Is it posible to use this hack to rplace text with deferent text (not a link). Thanks |
Quote:
|
Lol, really nice job ;)
|
case-insensitive is explained in the preg_replace page...:
http://ca.php.net/manual/en/function.preg-replace.php preg_replace ("/myWord/i", "myotherword", $thissentence); ... and is quicker than str-replace in all situations... ... i never used the replacement thing in the templates, i find that really annoying,because it's template based, so filter all the output, not only the text you post.. annoying! this one will be performing good!!! |
Didn't vB2 have this installed by default? I might be thinking Invision...
Either way nice hack! |
I was testing that code mod that Kentaurus did but i was getting a timeout error. I finally got my computer back online so i'll be working on the hack tonight. (after halloween) ^^
|
UPDATES
Query Bug fixed by Kentaurus. First post updated. |
Quote:
PHP Code:
|
Another Update
Fixed the case sensitive bug. Zip updated. Please ignore post # 12. |
@Lime Wire... always the same pattern with PHP:
stuff between "" are to be included without quotes: "$stuff" ... |
[SQL]
CREATE TABLE textlink ( textlinkid SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, text CHAR(250) NOT NULL DEFAULT '', link VARCHAR(250) NOT NULL DEFAULT '', adddef SMALLINT(3) NOT NULL DEFAULT '0', textdef VARCHAR(250) NOT NULL DEFAULT '', PRIMARY KEY (textlinkid) [/SQL] gives me this error: Quote:
|
Quote:
[sql] CREATE TABLE textlink ( textlinkid SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, text CHAR(250) NOT NULL DEFAULT '', link VARCHAR(250) NOT NULL DEFAULT '', adddef SMALLINT(3) NOT NULL DEFAULT '0', textdef VARCHAR(250) NOT NULL DEFAULT '', PRIMARY KEY (textlinkid) ) [/sql] |
installed and does not work
|
If you followed the instructions correcly then it should work.
|
When I add a link I get a "could not find phase" xxxxx
|
Means you just missing a phrase, but that won't let the hack not work. Add a textlink then post that text in your forums, it still should replace the text with the link. Also, what phrase did it say that it could not find?
|
it's says "could not find phase "saved_text_link_x_successfully" " when added a new link
|
Quote:
|
Any action I do leads to "could not find phase" and I check and all the pharses are there.
|
Quote:
|
I don't understand etheir I have installed 100's of hacks and I can't seem to male this one work.
|
This hack is a great idea like IntelliTXT, but is not working... I´ve installed many times following exactly what instructions says but nithing happens when I create a Text Replacenment Link and then a new post with the text to replace...
Please review the code because something is wrong... |
I will look at the code and install on a fresh vBulletin and see whats the problem/
|
Tnx a lot!
|
It's not working here either.
The phrase keeps getting reported as not there, when I've checked and double checked and it is there and in the correct group. In addition, the text is not parsed to a link anywhere in the forums. |
I got it somewhat working by replacing the functions_bbcode parse text posted in the second post here.
Don't ask me what the difference is, but there is a difference between that and the code in the install file. Only problem now is that it actually displays the entire link not the word. What I'd like is for it to display the word... and link the original word. |
Still not working for me.
|
Exactly installed in 3.03 as described but not working.
|
Still not working for me,too!
|
I installed but then used what Kentaurus posted and it works on highly modified vb 3.0.0
I also solved your www.google.com problem. Simply search for <space>Google<space> which will insure you wouldn't replace subwords as well for example Googleicous... So look for " Google " instead of "Google" Kentaurus's code with my small addition to check for spaces before and after the word and add a space before and after the replacement: PHP Code:
This works for me at Giant Vegenetics Sample word: Pumpkin Pending full implementation with Wiki... :) I plan to connect it to my WIKI for a very nice feature. Encylopedic knowledge injected directly into the threads. Sweet. |
Kentarus's with n*****?'s idea, Using case insensitive preg_replace and checking for spaces to avoid the www.google.com problem.
PHP Code:
|
can this main install file be updated so we can just install straight from your first post
|
Still not working here. But I think it's got something to do the the admin only html hack I've got installed.
|
I concur this hack does not work.
|
*sigh*
I disagree this hack does work - IF you follow the changes given by various people to the original unmaintained install file. Proof positive: http://www.giantvegenetics.com Give it a try. Use the word pumpkin in a post. Please use the AI Growbot Garden Teahouse forum for your test. PHP Code:
|
Quote:
|
All times are GMT. The time now is 05:01 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|