The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Autolink strings in custom mod
I have created a custom terminology/glossary mod for vb, and i have also included a simple function to auto link to other terms. but i have two major issues. It breaks html tags.
Any help is appreciated, the preg_replace in line 15 is the vbulletin method to highlight strings, if that helps... PHP Code:
For example, there are the terms "system" and "system registry". In a 3rd term definition there is the string "system registry". In the first pass it replaces the "system" term but in the second pass it tries to replace the whole string "system registry" Here comes in hand the removal of the empty term bbcode. This isn't a great issue as the first one as i believe if the first issue is fixed this will also be gone. You can check it out here Here is an example breaking img tag with the tag parameter. |
#2
|
||||
|
||||
Here is a different version which seems to be working better without breaking the original html tags at least. The process is based on this highlight function.
PHP Code:
|
#3
|
||||
|
||||
Personally I found it worth shelling out the 20 drinking vouchers on GALS, despite the slightly Beta-ish status and a few shortcomings. It works very well, has popup definitions as well as click throughs. And the stats keeping is interesting, being able to see how many folk actually click through to a given definition.
Maybe not as much fun as writing your own, but if you are pressed for time, definitely worth a look. -- hugh |
#4
|
||||
|
||||
Hrm the gals works with predefined keywords, the auto links in my case are produced dynamically with a query, this gives me the option to extend the autolinks to other sections custom pages, other mods etc etc
Well i don't want to pay for a whole product just to borrow some regex, more important i don't even know if it works like i want. With the last version of that function i solved my problem with broken html tags but there is still the occasional issue with the links over links. e.g PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|