Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Automatic Acronyms
Automatic Acronym’s Project Page
This hasn’t been updated in a while. Though neither has Textile.
I just wrote this up while wondering there is no way to have common acronyms defined automatically. Stuff like XML, HTML, TXP, etc. You can still define their own acronym’s.
It isn’t really a plugin, but just replaces the classTextile.php file. What I added was a function (acronym($a, $t)) that now called everytime Textile finds an acronym. The other thing I changed were the regex’s in glyphs($text), I added 2 character acronyms (like UN), the ability to actually call my acronym function, and a cutoff range of 8 characters for an acronym.
The enhanced classTextile.php can be found at:
acronym_patched_classTextile.src
To add an acronym, go to the $acronym_list array and add the acronym you want in the form: ‘ACRONYM’ => ‘TITLE’,
Everything seems to work perfectly (atleast for me), it will disregard non-acronym’s that you haven’t defined. Speed wise it might start to take up a lot of memory as $acronym_list increases in size, but any suggestions on how to make it faster/better would be appreciated.
Automatically title acronyms:
acronym_patched_classTextile.src
To install:
1. Rename “acronym_patched_classTextile.src” to “classTextile.php” (no quotes)
2. Replace current textpattern%/textpattern/lib/classTextile.php with your renamed classTextile.php (%textpattern is where you installed textpattern)
Last edited by greenrift (2004-10-24 05:34:19)
Offline
#2 2004-06-09 17:18:21
- Remillard
- Plugin Author
- From: Lenexa, KS
- Registered: 2004-05-16
- Posts: 169
Re: Automatic Acronyms
Does this need to be updated with the 1.19 release since it’s a hack?
Offline
Re: Automatic Acronyms
> Remillard wrote:
> Does this need to be updated with the 1.19 release since it’s a hack?
Nope works fine for me on 1.19. The Textile library wasn’t changed at all between the versions, so as long as that doesn’t then it will work.
Offline
Re: Automatic Acronyms
Beautiful. Excellent work, Greenrift. I will be testing this out tomorrow morning. You’ve read my mind.
Lumilux – A Photoblog
Offline
Re: Automatic Acronyms
Greenrift, can you detail what was added to classTextile.php so we can add it to our classTextile.textilephp.php files? Thanks!
Offline
#6 2004-10-24 03:17:05
- arakune
- Member
- Registered: 2004-10-23
- Posts: 13
Re: Automatic Acronyms
I’m very interested in this hack, but…. http://www.engineering.uiowa.edu/~mdpotter/acronym_patched_classTextile.src 404s :( Does anyone know where one can find a copy of it nowadays?
TIA!
~A.
Offline
#7 2004-10-24 03:55:32
- codyjack
- New Member
- Registered: 2004-09-27
- Posts: 3
Re: Automatic Acronyms
Check out http://greenrift.textdrive.com/projects
Offline
#8 2004-10-24 17:40:13
- arakune
- Member
- Registered: 2004-10-23
- Posts: 13
Re: Automatic Acronyms
> codyjack wrote:
> Check out http://greenrift.textdrive.com/projects
Thanks so much! :)
Offline
Re: Automatic Acronyms
I am wondering if anyone could use a centrally configured list of acronyms to go with this mod. I’m thinking of adding an admin page similar to the links page under Content that would allow the addition and deletion of acronyms that would be used by this mod when it does its thing.
Offline
#10 2004-11-06 23:53:14
- danielk
- Member
- Registered: 2004-03-04
- Posts: 24
Re: Automatic Acronyms
I would be all for a central list, if your offering. ;)
Offline
Offline
#12 2004-11-08 00:24:01
- danielk
- Member
- Registered: 2004-03-04
- Posts: 24
Re: Automatic Acronyms
For a test, it works great!
Offline