![]() |
I'll reiterate. I've applied all changes posted here in this thread. And it still does not work. However, as I posted above, I believe it won't work for me due to admin ability to post html on my forums. For me, admins posting html is more important that text replacements, especially since these replacements can be handled in the built-in vb3 replacement variables.
|
you cannot do this in the built-in vb3 replacement variables.
e.g. If i replace Code:
value Code:
[url = http://www.value.com]value[/url] I actually need this hack! and was looking for it, its a shame its not finished, i know that Geographic2 has tried to help, however, when i did the test on your forum, the word pumpkin did not replace with a link. I need this hack asap and would love for someone to finish it! p.s. i added a few spaces coz this forum kept picking it up as vb code |
Im planning to install this hack tonight. I will see about releasing what code I use that works correctly. I will then talk with my man livewire and see if he cares about me releasing a new version of this hack for him.
|
Quote:
I agree though move it to beta so people who can't program or stand to read a thread will stay away from it. :) Quote:
http://www.giantvegenetics.com/gv/showthread.php?t=2390 |
I'm not a php idiot. I've coded quite a bit. I've followed everyone's advice here, installed and reinstalled. I still can not get this hack to work in any form on my site. I can not rule out that it's my site that is the problem. However, this is the first release by anyone at vb.org that I could not get to function.
|
Works great - no problems :squareeyed:
|
This hack is not working .. everything is installed word by word .. but the hack it self wouldn't work .. and the links wouldn't show ..
|
I agree, I have been hacking vB for 3 years and I cannot get this one to work either.
|
I couldn't get it to work initially but I added the changes that Geographic2 had posted and then it did work. However, it appears that if the text that is to be replaced is at the last text of the post or if the text is followed by a punctuation mark it doesn't not work.
|
thanks.. will install this for sure..
|
this hack doesn't work at all..
|
Somebody should continue to work on this. It's a really great option for advertisers. Not only does their banner ad show (if they have one), but any time their company name is addressed, it can link to their web site...
|
The hack works great for me. But with the "spaces" addition it will not work if the word to be replaced is the first or last word in a post.
|
Got it working with the code (case insensitive) posted by Geographic2.
One bug I noticed though -- it doesn't handle phrases. I can't replace 2 word phrases. So I couldn't replace say "Golden Retreiver" with a link to a description of the breed. Limitation of the system? Or something easily fixed? |
If you don't like the way it is parsing things then come up with a better regular expression to cover what you are looking for. I'm happy with the way this one has performed for me. Here it is running on my Glossary of Botanical Terms which is integrated with my WIKI. I personally feel there are already enough links being made without including the ones which appear with punctuation etc. I'd actually think of making it limit the # of links more that create more than there is like this.
If you want to check to see if it's at the end of a sentence or followed by a comma simply define it in the regex: Code:
$findtext[] = "/\s".$link['text']."\s/i"; Instead of blocking the replacement of what are already URL's which is the reason I introduced the search for " word " instead of "word" in the first place way back when, you could search for "Not [" and "Not ]" to prevent the url bbcode from being broken. I'm a big fan of people learning how to do things, so somebody learn and figure it out. I can get mine to cover 2 word phrases, not sure why yours will not. I am using the same regex I posted here... Here I am replacing the phrase "Giant Vegetables", when I put it in via the admin CP i don't include the quotation marks. http://www.giantvegenetics.com/gv/sh...9&page=3&pp=10 |
Here is another fix to the fix of the fix (just kidding).
Yet another thought before I'll move on to the fixed code posting - make sure that the version of the php your server is runing has PCRE enabled; navigate to your admin control panel, go to 'Import & Maintenance' section; click on 'View PHP Info' link. Once you are able to view PHP info in the main panel please search for 'pcre': PCRE (Perl Compatible Regular Expressions) Support enabled If the line is missing the code may not work for you. What's fixed: - now it works with phrases - works with both words and phrases at the beggining or the end of the post Enjoy it: Code:
static $customReplaceInit = false; |
Hey everyone, i'm back for good now and i'll be able to start updating and supporting my hacks. I just read the thread and i have to thank everyone who has contributed there time to trying to make this hack work while i was away. I am going over the code now and will have an update very shortly with all fixes. Thanks again!
|
Nice to see you back (for good???).
|
It works! :)
Thanks! |
everything works great, but I do get an error every time I add a new text link in the redirect window:
Cannot find phrase: "saved_text_link_x_successfully' |
actually, none of the redirect window phrases work, they all give he "could not find phrase" error.
|
I noticed that, but the thing is the phrase is there. If you search the phrase it is in the database but for some reason its given me that error. I'll check it out after work.
Yes for good.... :) |
yes the phrase is there and as far as I can tell the code is calling the correct phrase, but there is definitely something coded wrong.
|
figure anything out yet? :)
|
Havn't even worked on it, its not a top priority on my list. As long as the hack work for now. Next version will be the fix.
|
Is this compatiable with the Geek Auto Linker?
|
Not sure what that does
|
Quote:
|
hmmm, came out 2 months after mine. Have to take a look at it.
|
just a question, lets say I have amazon linking to amazon.com
a user makes a post and types "AMAZON" all in CAPS, the hack links but converts it back to lowecase, is it possible to avoide this problem? also is this one query per page or per post. |
One query per page. That isn't possiable. If you have the word "Soda" as a link going to coke.com, and a user says. I like to drink soda. It will show up as a link. There isn't a way around it unless you deigne something where it can tell the PHP how the user is using the word.
|
I think the geek auto linker only has one query per page.
|
As this one does also.
|
hehe what you wrote didnt make sense...anyway I just tested auto linker again, and it seems to do what I described above.
not sure which system to use :) |
Quote:
I would use whatever fits your needs, this isn't any sort of competition. :) |
I installed it, but it's not working as well as I hoped, so I'll be removing it. My beef with it is that it messes up the formatting of posts right now.... Sometimes it removes the newlines in posts, and sometimes it removes the preceeding space, making posts really cluttery...
Let me know when you beef this up and fix the errors.. |
i acually never seen this error. Got a screenshot?
|
At first, I have to say "Thank you" for this excellent work!
I found out why the redirect phrases are not working - they phrasetypeid is wrong. I use the german vB3, so I don't know how the type is called in the english version, must be something like "Control Panel: Messages" - the phrasetypeid is "9000" (as sayed, in the german version). After installing the hack, i asked myself: If someone asks "Where do I find the homepage of XYZ", and XYZ is in the TextReplacement-Table, the other users will think he is completely insane, because there is no option to tell this automatic link from the others. So I did the following modification: I changed one line in the code to insert in functions_bbcodeparse.php from PHP Code:
PHP Code:
Next, I created a custom vb-Code: Name: autolink Tag: autolink Code to insert: Code:
<span class="autolink"><a title="this link has been created automatically" href="{option}" target="_blank">{param}</a>*</span> At last, I went to the custom CSS-Definitions and inserted the following: Code:
.autolink a:link Additionally, the links will be underlined. If you alreade use "underline" for the normal Links, you should use any other CSS-Definition. |
Thank you for that! I will definitly be looking at your above post when I port this to 3.5.0! :)
|
Feel free to do so :)
Just found another problem: If the text to replace is followed by a ".", it will not work. And if the word to replace is the first in a line, the link will "jump" to the end of the line before, even if there are one ore more blank lines in between. (Tried this also with the original hack without my modifications, same behaviour). Any idea? |
All times are GMT. The time now is 10:57 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|