The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#22
|
|||
|
|||
This didn't work for me
|
#23
|
|||
|
|||
will this work with 3.6?
|
#24
|
|||
|
|||
Anyone here??
|
#25
|
|||
|
|||
Man no support
|
#26
|
|||
|
|||
Just installed this and is caused a database error as soon as I put the first Acronym into the settings.
|
#27
|
|||
|
|||
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". |
#28
|
|||
|
|||
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 |
#29
|
|||
|
|||
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! |
#30
|
|||
|
|||
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 |
#31
|
|||
|
|||
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 |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|