The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#32
|
|||
|
|||
In order to solve the problem of abbreviations (or acronyms) being a prefix of one another, such as in "DHEA" (= Dehydroepiandrosterone) and "DHEA-S" (= Dehydroepiandrosterone-sulfate), I have made a further modification to the Acronyms add-on.
Up to now such abbreviations were only recognized correctly if by chance the longer definition was entered first (and thus had a lower primary key index in the database). The new version therefore first sorts all acronyms according to their length, and tries to find the longest match in the page to be displayed first. Only if that fails a shorter match is tried which then may be successful. An additional term in the regular expression of the search pattern was introduced in order to avoid multiple replacements at the same location, very similar to the one to avoid replacements inside of HTML tags. This means that if there were two abbreviations, for instance "DHEA" and "DHEA-S", then the text "DHEA-S" would match twice, once for "DHEA-S" and once for "DHEA". The result of such double replacements looks somewhat odd, therefore it has been prevented. Moreover, it has been found that omitting the call to "preg_quote()" (see the previous two postings) in order to prevent the introduction of regular expressions into the definition of acronyms has its advantages: This allows to define closely related variants of acronyms in a single definition (instead of a separate definition for each variant), such as for example "DHEA-?S". The question mark means that the preceding character is optional, i.e., this pattern would match "DHEAS" as well as "DHEA-S". The advantage is conciseness, less acronym definitions to administrate, and improved speed (the more acronyms are defined, the longer it takes to display any given page). The downside is that one needs at least a basic knowledge of (Perl) regular expressions in order to administrate the acronym definitions and that making a single error (e.g. a syntax error) will prevent the whole vBulletin board from working; all pages will display error messages instead of their contents, until the error is corrected. It goes without saying that this implies that in this case, only knowledgeable and especially trustworthy people should have access to the Acronyms menu, which is not always possible or desirable to ensure. Therefore two distributions have been prepared; the one with number "5" in its name is the "unsafe" one WITHOUT the call to "preg_quote()", and the one with number "6" in its name is the "safe" one (mnemonic: think of "safer sex", "6" = "sex") which prevents the introduction of Perl code into the definition of acronyms by escaping any characters with special meaning being found. I hope you'll find these additions useful. Best regards, ibeji in the name of Feechen See also: [vB 3.5.x]Akronyme f?r vB Seite 2 preg_replace() preg_quote() Arrays foreach strlen() uksort() create_function() |
#33
|
|||
|
|||
I just added the right apostrophe ("accent aigu") ´ as a possible separating character to the last two versions of the acronyms mod, because I had simply forgotten to include it in previous versions.
The left apostrophe ("accent grave") ` already was included since the beginning. Best regards, ibeji in the name of Feechen |
#34
|
|||
|
|||
Does this work on 3.6.8? And if so, which ZIP file is appropriate to download? There are like 10 of them posted throughout this thread.
Thx |
#35
|
|||
|
|||
wouldn't it be better to replace the post when it is edited/safed instead of loaded?
the performance would be much better i think |
#36
|
|||
|
|||
Quote:
(2) Of course the last two posted (5a, 6a), 5a if you want the power of Perl regular expressions in your acronyms, and 6a if you want the safer version without Perl code. Best regards |
#37
|
|||
|
|||
Quote:
Cheers |
#38
|
|||
|
|||
I have problems with capital/small letters. Is it possible to exclude small letters? We use the acronyms for airport codes and therefore we just need capital letters.
IST for example is the shortcut for Istanbul, but the german ist is a verb and is used everywhere. |
#39
|
|||
|
|||
Any chance of this working with 3.7.3 or am I going to have to buy GAL?
|
#40
|
||||
|
||||
Any idea if this will work with 3.8.1 ?
|
#41
|
|||
|
|||
can we replace the acronym instead of make it pop up their meaning on windows, I am just curious
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|