Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Acronyms for vB Details »»
Acronyms for vB
Version: 1.00, by RolandvonGilead RolandvonGilead is offline
Developer Last Online: Dec 2006 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.5.4 Rating:
Released: 04-22-2006 Last Update: 04-24-2006 Installs: 52
DB Changes Uses Plugins
Additional Files Is in Beta Stage  
No support by the author.


//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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 09-15-2006, 08:07 PM
rareclownfish rareclownfish is offline
 
Join Date: Mar 2006
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This didn't work for me
Reply With Quote
  #23  
Old 09-16-2006, 03:49 AM
JenniferK JenniferK is offline
 
Join Date: Dec 2005
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will this work with 3.6?
Reply With Quote
  #24  
Old 09-17-2006, 02:23 AM
rareclownfish rareclownfish is offline
 
Join Date: Mar 2006
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone here??
Reply With Quote
  #25  
Old 09-18-2006, 03:30 PM
rareclownfish rareclownfish is offline
 
Join Date: Mar 2006
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Man no support
Reply With Quote
  #26  
Old 12-09-2006, 08:35 PM
Puntoboy Puntoboy is offline
 
Join Date: Sep 2005
Location: Northampton UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just installed this and is caused a database error as soon as I put the first Acronym into the settings.
Reply With Quote
  #27  
Old 05-19-2007, 06:58 PM
Feechen Feechen is offline
 
Join Date: Jul 2003
Location: Germany
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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".
Reply With Quote
  #28  
Old 05-20-2007, 08:35 PM
Feechen Feechen is offline
 
Join Date: Jul 2003
Location: Germany
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #29  
Old 05-21-2007, 01:10 PM
Feechen Feechen is offline
 
Join Date: Jul 2003
Location: Germany
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #30  
Old 06-05-2007, 03:09 PM
Feechen Feechen is offline
 
Join Date: Jul 2003
Location: Germany
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #31  
Old 06-05-2007, 03:30 PM
Feechen Feechen is offline
 
Join Date: Jul 2003
Location: Germany
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:10 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
  • Page Generation 0.07363 seconds
  • Memory Usage 2,310KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete