![]() |
Acronyms for vB
//EDIT: UPDATED 25.04 22:34 Please only use this new version! Replace old ones! THX Its an normal Acronym-Explanation-Mod. In the AdminCP you can enter Acronyms and Descriptions. Then in the Posts This word is underlined and green, and when the Users passes over with the mouse he sees the Description. Roland |
Quote:
|
Quote:
Then in the Posts This word is underlined and red, and when the Users passes with the mouse he sees the Description. |
So its like a cut down version of Geeks Auto Linker ?
Sounds good m8 although I use GAL for the same purpose I am sure it will come in handy for helping newbies out getting to grips with some of the common terminology. H |
Good! :-)
|
On vbhacks it was reported, that the hack works on local Installations but not in the productiv-Board...
Probably I'm not using the right Hook, or variable. I will look for an solution. Roland |
are we supposed to wait for the cron job to see the effects, 'cause nothing is happening. Acronym installed, tested it in several ways, nothing so far.
|
Quote:
I will post it later. Roland |
// Deleted the Hack for 1-2 Days because i haven't already found the perfekt hook.
global_complete has problems with the meta-infos... Please uninstall the Hack until i finished. THX Roland |
Look forward to this hope you can get it working a old site I use to browse running older VB has this and its a nice feature...anywhere key words like BBL for example are it underlines them and scroll over shows Be Back Later hope you get this working been looking for it for some time
|
So I finished!
Bugs eliminated! Please delete elder ones! And only use the new one! Roland |
I think you're confusing acronyms with abbreviations :)
|
New Install! Very nice.
My Opera users see the question mark but no definitions. Any ideas? |
Quote:
Quote:
But in the next Version I will use both. P.s. I know what Acronyms are ;) |
Quote:
Are you with me that NATO and NASA are acronyms but USA and FBI aren't? |
Quote:
Greet Roland |
how can we change the color and make it not underlined or bold? I would like it to just change to a Gold instead of the normal purple we use on our site
|
Quote:
You can change the colors in the Acronym-Plugin. PHP Code:
&& #082ceb; the UnderlineColor If xou don't want it underlined delete: PHP Code:
|
OK thanks but color isnt showing up using this
Code:
<span style=" font-weight: color:#FFCC00; cursor: help;">\\1</span> Also how do I make this available without giving my moderators access to the user area in ACP? I would like it to show to anyone who can administer plugins NEVER MIND I FIGURED IT ALL OUT. Simplier than i thought. |
so this is working fine with 3.5.4?
|
This didn't work for me
|
will this work with 3.6?
|
Anyone here??
|
Man no support
|
Just installed this and is caused a database error as soon as I put the first Acronym into the settings.
|
Dear Roland,
I hope this is the right thread to report bugfixes and enhancements to your add-on! If not, please bear with me (I'm new to this) and tell me the right place, ok? :) I installed this add-on of yours recently and I'm VERY fond of it! However, since I wanted to make some changes, I came across something that appears to possibly be a little bug. The file "product-acronym_mod.xml" contains a Perl regular sub-expression which reads as follows: (([.,:;-?!()\s"<\[]|$)) However, the part ";-?" in it means "including all characters from ; to ?" in Perl, i.e., the characters "; < = > ?" in ASCII or ISO-Latin-1. This is probably not what was intended, I guess the dash itself was meant instead. To achieve this, and to free the dash from its special meaning in character classes, you need to escape it with a backslash, like so: (([.,:;\-?!()\s"<\[]|$)) Moreover, I found out that the add-on also does replacements inside of HTML tags, which can cause problems like creating letter salad and make hyperlinks stop from working. In my case it was the "ALT" tag, which incidentally corresponds to an abbreviation in our forum (= Alanine-Amino-Transferase). Therefore I introduced an additional, negative zero-width look-ahead expression to prevent substitutions inside of HTML tags, directly after the match of the abbreviation (or acronym ;)), like this: (?![^<>]*>) This verifies that the intended substitution is not taking place inside an HTML tag by verifying that no closing ">" follows. As a downside of this, abbreviations followed by a plain ">" somewhere in the middle of normal text (before the next HTML tag) will not work anymore. I personally do not find this very limiting, in practice, though. However, abbreviations can be made to work in these circumstances if the ">" that follows is in reality written as "& gt ;" (without the blanks, of course). For this, the list of non-word characters or separating characters in the add-on needs to be adapted to include at least the ampersand "&". I found it convenient to put ALL punctuation and special characters into that list of possible separator characters, except for the backslash, which for a reason I haven't investigated yet did not work, and the "at" sign "@", because it might conflict easily with email addresses. I also found it useful to make the separators to the left and the right of the match symmetrical. This has the added benefit of making staggered abbreviations, such as for instance in "TPO-AB", possible, i.e., it allows "TPO" to be recognised as an abbreviation for "thyroid peroxidase" and "AB" as an abbreviation for "antibodies" (in theory this feature would also allow something like "XX-YY-ZZ" to work, although I guess this won't be needed very often in practice). The whole line now reads as follows: $post['message'] = preg_replace('# (?<=[\s!"\#\$%&\'()*+,\-.\/:;?^`{|}~>\]]|^)(' . $acros_final['acro'] . ')(?![^<>]*>) (([\s!"\#\$%&\'()*+,\-.\/:;?^`{|}~<\[]|$))#siU', '<acronym title="'.$acros_final['desc'].'"><span style="border-bottom: 1px dotted #082ceb; cursor: help;">\\1</span></acronym>\\2', $post['message']); I am attaching the original zip archive of the add-on as a reference, and also the modified file "product-acronym_mod.xml" itself (if this forum's configuration will let me). BTW, I also changed the font style to be just underlined, not green and bold, in order not to disrupt normal reading too much. I hope that these changes may be useful to others as well! Best regards, ibeji in the name of Feechen P.S.: I have based my changes on the German version, but I guess it should be no big deal to transfer the modifications to the English version, if those were different at all. P.P.S.: See also my posting in the German forum in the thread "[vB 3.5.x]Akronyme f?r vB". |
Please find attached hereto an updated version of the file "product-acronym_mod.xml" with improved performance.
Since it seems (at least subjectively) that the time it takes to display a complete forum page is longer when the Acronyms-addon is installed, I applied some more modifications in an attempt to increase its performance. Instead of matching the right separator character, capturing it and re-inserting it into the output stream (that's what the "\\2" does in the script), why not check the next character with a zero-width positive look-ahead regular expression? (Especially since the left separator character is already checked with a zero-width positive look-behind regular expression?) This saves the time that was needed before for the intermediate storage and interpolation (i.e., insertion) of the captured character into the output stream. But better still, this now allows us to put the subexpression (?![^<>]*>) at the very end of the regular expression. Because when there is no valid right separator character anyway (which can be checked in a single step, in O(1) time complexity), it is not necessary to execute this search for a closing ">" (which can potentially run until the end of the input stream, and therefore has O(n) time complexity) anymore at all. For an explanation in German of the nature of these modifications/improvements, please see also my corresponding posting in the thread "[vB 3.5.x]Akronyme f?r vB". I hope you might find this new version useful. Best regards, ibeji in the name of Feechen |
Dear all,
I have just overhauled the whole add-on which now contains - in addition to my modifications described before in this thread (now integrated into BOTH language versions) - also a number of fixes of typos. Please see the file "Acronym_Mod_fixed.zip" attached here. The text file "Acronym_Mod_patch.txt" contains a context-diff between the original and the modified distribution. Programmers often use such a context-diff in order to create a modified version out of an unmodified one, with the help of the "patch" program (another invention of the creator of Perl, Larry Wall). Best regards, ibeji in the name of Feechen P.S.: We use version 3.6.7 of vBulletin! |
Dear all,
I've found a bug in this add-on which allows to introduce working Perl code into abbreviations. For example, the abbreviation "P.S." (with two dots, where a dot means "any character" in Perl Regular Expressions, unless escaped with a backslash: "\.") does not only match the intended text "P.S.", but also "Post", or "PxSx" in general. In order to fix this, one needs to insert a call to the PHP function "preg_quote()". This has been done in the attached distribution file ("Acronym_Mod_fixed_2.zip"). The difference ("Acronym_Mod_patch_2.txt") between this modified distribution and the original one ("Acronym_Mod_new.zip") is attached here for the convenience of interested people only. I hope this helps! :) Best regards, ibeji in the name of Feechen |
Sorry,
the regular expression delimiter character '#' should of course be escaped by "preg_quote()" as well, in order to avoid crashes... Best regards, ibeji in the name of Feechen |
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() |
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 |
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 |
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 |
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 |
Quote:
Cheers |
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. |
Any chance of this working with 3.7.3 or am I going to have to buy GAL?
|
Any idea if this will work with 3.8.1 ?
|
can we replace the acronym instead of make it pop up their meaning on windows, I am just curious
|
All times are GMT. The time now is 04:54 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:
|