postheadericon Ubernyms: the ultimate text-replacement plugin

The purpose of ubernyms is to allow you configure a set of frequently used abbreviations that will be automatically encoded nicely whenever you use them. The goal is to make them visible in a way that is literate for both humans and computers. In other words: we tag them appropriately for your computer, and expand them as necessary for humans.

The main use for ubernyms is still going to be abbreviations, including acronyms. But you can also use it for other things like:

  • Words that you always want linked. For instance, the links to ubernyms are being added by the plugin.
  • Short forms of words or phrases or even entire paragraphs that you frequently have to type. The whole text can be placed to replace a single word.
  • Pictures or emoticons you use frequently. I have photos show up in my DomTT tool-tips for my kid’s names: Katrina and Mikayla.

Edit: May 6, 2006

I’ve included a full configuration panel this time. No more hacking the plugin source to add abbreviations! Each time you go to the configuration panel there’s 5 empty slots for new definitions, and when you submit those, you get space for 5 more. You can remove definitions by simply deleting their Text or Definition. You can see a partial screenshot of the ubernyms configuration if you’re interested, but there’s not much to see besides long lists of definitions.

There’s a setting for each ubernym that lets you define if it is an acronym, an initialism, just a plain old abbreviation, or simply a replacement or link. And if you’re using the DomTT tool-tips, you can specify additional text (including HTML) to be placed below the main definition.

You can download the zip here, which includes the DomTT script which you can also get here with more details about how to use it and the many features, in case you want to play with the tool-tips. The installation is pretty simple, just unzip, and upload the whole ubernyms folder into your plugins folder.

Edit: May 7, 2006

Note that there’s now an option in the plugin configuration for including the default ubernym CSS, but you can feel free to copy that into your CSS and/or edit it as you see fit.

Edit: May 9, 2006

Incidentally, putting the photos in (as I did with my daughters) is extremely simple a?? without getting into the details of how I actually do it, all you have to do is put the img tag into the Description field, and make sure that you’ve checked the option for using the DomTT tooltips. You can use pretty much any HTML in the descriptions for DomTT, within reason ;) . Of course, the images have to be somewhere. You can just upload them to your webhost and link to them there, or just specify an image you already uploaded to flickr. Remember, just put the HTML in, like: <img src="http://static.flickr.com/48/136555658_f0eaa892a9_m.jpg" alt="Sitting in a field of flowers" />

Edit: May 11, 2006

I’ve just released an update of this, no major changes, but it’s now in sync with my HuddledParser plugin so that if you’re using them both, you don’t accidentally get two copies of the DomTT scripts loaded. Aren’t I clever? ;-)

Edit: May 13, 2006

I finally fixed a few annoying bugs related to having quotes, single-quotes, and apostrophes in your abbreviations and released ubernym 2.4

Edit: May 14, 2006

I tweaked the javascript and css so that it all validates as XHTML 1.0 Transitional, XHTML 1.0 Strict, or even XHTML 1.1, but the DomTT javascript still uses a CSS file with those neat rounded-corners and alpha-blending opacity, so it’s CSS won’t validate … which doesn’t really bother me.

Edit July 24, 2006

Here’s a list of things that I still want to do:

  1. I have in mind to provide a check-box-like way of configuring where the replacements happen. That is: to create a sub-tab in the configuration with a list of most/all the “filter“able portions of WordPress, so people can easily choose NOT to have Ubernyms run on comments (usually that’s not helpful, imho, even though that’s the way I run it on my site right now), or choose to run it on the category list, or whatever … I haven’t looked, but there ought to be a way to get a list from WordPress of all the registered filterable things (since it’s trivial, for instance, to add a filter to my RSS plugin … what if I wanted to run Ubernyms on my RSS output?)
  2. I still need to investigate the language problems. There seems to be something wrong with the way WordPress is handling foreign-language characters through the option settings table?
  3. To make this more generic, it would be cool to be able to “create” new “types” of replacements. E.g. Shanta Rohse wants to use it to create links to a glossary, but still use it for other things too, so would like a “glossary term” category. Maybe there could also be an additional setting like the “english” one that allows auto-linking only the first occurrence as per these requests
  1. It might be interesting to add another feature (as a seperate tab?) specifically to create photo popups. I’m not 100% sure how this would best work … (would there be a way to upload photos, or an AJAX interface to let you select photos from Flickr or Zooomr, or a simple ‘preview’ feature and just a text box where you type the URL to an image). The idea is basically to have the tool create the sort of tooltips I have on my kids names, but without needing to type html into that teeny edit box.

128 Responses to “Ubernyms: the ultimate text-replacement plugin”

  • thank you very much for this plugin, its nice to see it in action!

  • [...] Ubernyms(link). Ok, I discovered this today via Needle Exchange but I’m going to slowly be adding to it and cleaning it up, defining both the knitting and jewish words I use that part of my readers will grok but the other half may not. If there’s a word or combination of letters you don’t understand, please let me know. [...]

  • I can’t get it to work I get an error 403 when I try to go to the configuration page :(

  • [...] Jag vill med anledning av det passa pA? att tipsa om en trevlig plugin till WordPress kallad a??Ubernymsa??. Ubernyms arbetar med automatisk textersA?ttning och har ett antal olika funktioner. [...]

  • Great plugin, thank you!

    I noted that Swedish chars, such as A?,A?,A? gets messed up if you write them in the definition or description fields. Any ideas?

    I also noted the bug you have commented on in the code, about links ending up within links. Do you have any approach on how to fix that issue? It’s the only issue really bothering me with this great plugin!

    Best regards,
    BjA?rn

  • Not sure what’s going on with Starry’s … and I actually don’t know how you could get an access forbidden page from the config unless you don’t have login access to the wordpress admin.

    As far as the links issue, the only complete answer I know is to set all your acronyms to replace, and set the trigger text with brackets around it, like [PK] being the text that gets replaced with PK and being tagged as an acronym … that way it won’t ever grab text you didn’t mean for it to grab.

  • Hello, I love the idea of ubernyms. However, I am having a small problem where the tooltips do not render properly. I am using WP_ItemStats as well and whenever both plugins are activated, the tooltips render at the absolute top left corner (0,0) of the website. I’ve tried with and without the DomTT versions of the tooltips.

    I am using PortableFirefox (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4) for the most part. IE renders my test post with no problems, but I’d prefer not to use it ;)

  • Nic:

    Hello,

    Thank you for the great plugin. I am working on using it as a glossary (in combination with wp-snap), and it works like a charm.

    I wonder, however, if there is a way to auto-link only the first occurence of a word on a page, so if you use that word/abbreviation several times, you don’t end up with tons of links? If this is possible, I’d love to hear how to do it.

    Thanks

  • [...] If you are using the full version of WordPress, you can use the Huddled Masses – Ubernyms which will automatically convert common acronyms for you. [...]

  • Jaykul,
    This is really wonderful. Been looking for somethig like this for a while. Way to go.

    Like Nic, I’m also interested in atuo-linking only the first occurence of a word, but this time on a post as opposed to page.

    I’d really like to know if it can be done and how.

  • uruloki: Well, I have no idea why it wouldn’t work. Especially if you disable DomTT, since at that point, they’re just regular, browser-generated tooltips on acronyms. Do you have a link to an example page where the problem manifests (your page looks like it’s working, but it’s obviously not using DomTT)

    Nic, Luminus: It’s possible … but it would take some modifications to the plugin.

    Basically, if you set “English” true, you’ll see that the plugin puts the full text in parenthesis after the first occurence of the word in a post (NOTE: if it gets re-used in comments, it gets full-text the first time in each comment. I can’t figure out how to stop that).

    This behaviour could be modified slightly: say, add a “MarkOnce” feature like the “English” one. Then exclude those from the first loop so they don’t get linked at all. Finally, copy the “English” loop and change it for “MarkOnce” so you process it seperately (exactly the same as the English processing, except, link them up instead of putting the text in parenthesis after).

    With the current plugin, the only thing you could do would be to disable the styling, and the DomTT, and then use the “English” style. Feel free to code the links straight into the description…

  • Hey Jaykul,

    Your plugin is the greatest thing ever for tooltips. There are just two things, IMHO, that are in it’s way to being the greatest thing ever for anything:

    1) Messes up if used in a UTF-8 blog. Not only the text gets affected, but also the replacement if you try something like enclosing the text to be replaced in []s.
    2) Only owrks inside posts. I know this may be difficult to change, but if one uses it to create tooltips, the tooltips in the sidebar, header and footer will not be domtt-like, they will be regular ones, thus breaking the site visual unity.

    I hope these two points get your attention, because your plugin is highly configurable and flexible!

  • I’d like to ammend my comment above.

    Looking in the code more carefully (not that i know how to code), i see that the plugin should work with the sidebar content too. What about the content in the header and the footer, are there hooks for this?
    Also, there seem to be no DB functions of the plugin itself, just get_option() and update_option() which i think are WP functions. I posted in WP foruns ( http://wordpress.org/support/topic/79991 ) about it. Can this be corrected by the plugin, or do we need to file a bug in WP’s bugtracker?

    Thanks Jaykul.

  • Hey again Jaykul,

    So i have done some more testing with the international characters problem. I found this thread in the WP foruns: http://wordpress.org/support/topic/77286 , and i followed the instructions successfully. I have a local copy of my website for testing, where i am trying to get your plugin to work.
    Now my local website is completely UTF-8ized, including the WP connection to the database as instructed in the above cited thread, but ubernyms is still not working in two ways:

    - It seems the characters [ and ] break the text-matching. The text i specify to be replaced is enclosed in brackets, and it is not replaced, instead text that has nothing to do with it is (like single letters for example); – And the text that should be in the tooltips, which would include chinese characters, is unreadable (full of weird letters). I checked the field ubernyms_collection in the database and it seems the text for the tooltips is being stored as HTML entities, which obviously can’t deal with non-english languages apropriately.

    Please, please, will you make your plugin UTF-8 compatible? We non-english speakers need it so badly!
    Thank you,
    Eduardo

  • Murk:

    Things were looking good for this plugin. No fuss, flexible. Very nice.

    I was to try one more thing and then comment with a pat on the head for you…. but…I started playing with ‘replacing text, specifically making ‘Google’ automagically link to the website.

    I got these:
    WordPress database error: [Got a packet bigger than ‘max_allowed_packet’]
    UPDATE wp_options SET option_value = ‘a:44:{i:5;O:7:\“ubernym\”:7:{s:4:\“type\”;s:10:\“uttAcronym\”;s:4:\“abbr\”;s:3:\“AIM\”;s:4:\“text\”;s:21:\“AOL Instant Messenger\”;s:11:\“description\”;s:79:\“The most popular instant messaging service was originally for AOL members only.\”;s:7:\“english\”;b:0;s:8:\“makeLink\”;s:0:\”\”;s:10:\“appendLink\”;s:18:\“http://www.aim.com\”;}i:6;O:7:\“ubernym\”:7:{s:4:\“type\”;s:10:\“uttAcronym\”;s:4:\“abbr\”;s:4:\“AJAX\”;s:4:\“text\”;s:31:\“Asynchronous Javascript And XML\”;s:11:\“description\”;s:35:\“How we make web-pages truly dynamic\”;s:7:\“english\”;b:1;s:8:\“makeLink\”;s:0:\”\”;s:10:\“appendL….

    and so on.

    Whoops.

    Any hints?

  • Murk:

    I think I tracked it down. It wasn’t the google thing, it was to do with this picture:

    http://www.flickr.com/photos/murky/205551683/

    It had an é in the alt. (I think that was the issue). (Description Box)

    Deleting this entry did the trick

  • Murk:

    All now seems well, a couple of queries remain:

    1) With the DomTT switched on, I’ve read about how I could manually call the script and configure things like delay etc, but that sort of misses the point, it’d be nice if I could do that within Ubernyms (ideally, display until not hovering anymore)

    2) Weirdness happens with an embedded video, the tooltip appears behind the video: http://www.murky.org/blg/category/entertainment/television/battlestar-galactica/

    Neither of these is a deal-breaker, but both are annoyances and a work-round would be nice!

    Cheers!

    Regards,

  • Hey, glad you figured out that error, I was rather confused, and was going to ask how many ‘nyms you had set up…

    There does seem to be a problem with unicode in the WordPress plugin config, but I just don’t have any ideas what to do about it.

    Yeah, it might be nice to put all the domTT options somewhere, but honestly … there’s just so many of them that I just really don’t have the time to come up with a reasonable UI and storage scheme for it.

    As far as video … it’s because of the way that YouTube has you embedding them. The domTT script looks for ‘object’ or ‘select’ items to hide/avoid them, but it skips objects that have nested embed tags … according to the script comments it’s because of “flashing” issues, I haven’t investigated further.

  • Murk:

    Possible new bug:

    There doesn’t seem to be any check, when adding a link, as to if that text is already in a link (I haven’t done a similar test for abbr or acronym tags.

    This can end up with [url][url]text[/url][/url]

    The quick and dirty fix is to add a space before the text being searched for. This won’t suit every situation, of course, much better for ubernyms to check if the text is already linked (or has acronym tags)

    Regards,

  • Hey Jaykul,
    Yes the problem seems to be with UTF8. The characters are stored in the database field as html entities, which don’t deal apropriately with UTF8. Isn’t there a way to convert the characters to UTF8 hexadecimal codes (or the like), and then back when echoing them to the posts? This would need to be done for the text to be searched and for the text to be replaced too.
    About the domTT options: i would suggest creating just one single input field in the plugin config page so that the user can write all his domTT options in there, and usnig the user’s input in that one field to when calling domTT. That puts the burden of reading some domTT docs on the user, but it is better than having the user edit the plugin files directly, YMHO.
    Also, the [ and ] characters are currently messing up the regex, it seems.

  • I found this plugin, Ultimate Tag Warrior, which stores text strings much like Ubernyms does in the database – just UTW stores UTF-8 correctly. I wouldn’t know how it does the trick, but maybe UTW’s author can offer a suggestion. The URI is: http://www.neato.co.nz/ultimate-tag-warrior/

  • Nic:

    Is there a way to stop ubernyms from adding a link if the word is already within a link tag?

    I am using ubernyms in conjunction with wp-snap to create a glossary, and that works splendidly. However, when i try to add some of those words as technorati tags, both ubernyms and the SimpleTag plugin add a link around the word, causing no end of havock.

    I’m not sure how to make it so ubernyms doesn’t create a link if the word is already surrounded by the tag. Any ideas or suggestions?

  • [...] Joel Bennett for Ubernyms. [...]

  • Scott Plumlee:

    Hello. This is probably going to be the oddest comment you’ve gotten about ubernyms, which is a terrific plugin. I’m using Ubernyms on a production site that runs php 4.4.2 and MySQL 4.1.18. I have been testing a database dump and restore on mac that runs php 4.4.1 and MySQL 4.1.21. When I reload the database on the mac, the ubernyms collection is not properly unserialized. For some reason, it is not detected as an array. What’s odd is that all the other serialized values are correctly unserialized, including the ubernyms setting variables. Has anyone else seen this, or do you have any idea why this might be happening? I’ve testing it and it definitely seems to be that when the values are loaded from the database, it’s not detected as being an array. I’ve looked at the changelogs for PHP and MySQL and I’m not seeing anything immediately that would seem to cause this. It’s not the end of the world if I can’t make this work, but it’s the last thing between me and being able to have an up-to-date copy of the production site running on a backup. Any ideas appreciated.

  • [...] Per gli utenti WordPress esiste un magnifico plugin chiamato Ubernyms che semplifica di molto le cose in quanto aggiunge al nostro pannello di amministrazione una schermata di configurazione in cui potremo decidere quali tipi di attributi usare ed A? giA configurato con una buona lista di acronimi molto usati nella rete, eviteremo cosA? di dover inserire manualmente i tag HTML/XHTML ogni volta che dobbiamo scrivere un acronimo . [...]

  • cee:

    is it possible to get ubernyms to highlight words which show up in ‘the_meta’ as well? i edited ubernyms.php and added this line at the bottom:

    add_filter(‘the_meta’, ‘ubernyms_replacer’, 18);

    but it still doesn’t work. i’m wondering if there’s another way…

    thanks!

  • Rich:

    Whats the plugin for the rollover help boxes?

  • That’s the DomTT tool-tips that I mentioned in the article.

  • Hey Joel,
    Is there any progress on the i18n problem?

  • I am having a problem with the placement of the Tool Tip. At first I thought the plugin wasn’t working, but then I noticed that the text box is appearing in the far upper left corner of my website, (0,0) instead of under my cursor, as it appears on your site. Is this a CSS issue? If so, can you tell me what you did to get it to appear under your cursor?

    I am using this plugin on a wpmu installation, and other than the positioning issue, it works fine.

  • I have spoken too soon. It’s not working on WPMU, except on the front blog. The other blogs simply store the setting in the main blogs options. Since I really like this plugin, I will see if I can figure out how to store the options in (and read from) the right place. I’m not very sophisticated at php, so don’t know how successful I will be.

    I would still like to know how to get the placement of the TT correct.

  • Got the popup showing in the right place.

    Got it working in WPMU. Here are the two small changes needed if you are interested. It should still work fine in regular WP with these.

    function ubernyms_make_config_page() {
    if ( function_exists(‘add_submenu_page’) )
    add_submenu_page(‘plugins.php’, ‘Ubernyms Configuration’, ‘Ubernyms Configuration’, 1, basename(__FILE__), ‘ubernyms_config_page’);

    change basename(__file__) to file

    “>

    “>

  • Sorry about that. I guess the code tag doesn’t work here.

    The second section that needs to change is your form post method. Change action to: echo $_SERVER[“REQUEST_URI”];

    That’s all. It works like a charm!

  • I love this plugin, but I guess I have bad luckwith it, it seems to not work when another wp plugin is activated, AJAX Comments 2.0!
    In IE there’s an error message, “object doesn’t support this action” and in the page source both Ubernyms and AJAX Comments 2.0 scripts are called twice.

    Any idea? thanks

  • I just love the plugin. I’d really love it to work with other languages than English though. It fuddles up anything that has to do with accents and diacritical marks. I use it on a French blog to make it easier to read for my English speaking readers… and have to suppress accents or find other synonyms. Not so easy sometimes! Maybe in a next release???

  • DaveF:

    Is there a way to make Ubernyms ignore the “read more” link?

    I have mine set up to include the entry title (eg: Continue Reading “How to Build a Better Mousetrap”). I might want a definition for “mousetrap” in the entry body, but not in the text of the “read more” link.

  • Re. making Ubernyms ignore the read more link.

    Well, the simplest answer is that Ubernyms really ought not to parse text in links anyway, but I still haven’t solved the problem of how to get that to work along with all the other regular expressions.

    Re. UTF-8 and other languages.

    This is on my todo list. I’ve been sort-of stalling on it because I believe it is a WordPress bug, not something specific to my plugin. I’m going to have a look around to see what I can do to help get it fixed.

  • Nils:

    Thanks for this really helpfull Plug-In. I use it on my Website – but have Problems with the so called Umlauts HTML: ä for example… wenn this ist not translated. If I have some minutes I will have a look at your code and give you an hint how to handle this ;)

  • Hey Jaykul,

    Re. UTF-8 and other languages.
    Nice, thank you for your effort. We are keeping an eye on that because your plugin seems to be the best all-around text replacer and tooltips solution, it is indeed very complete. If it comes to handle UTF-8, it will be an unbeatable package.

  • Owen:

    Hi,
    I just upgraded to WP 2.1 and installed ubernyms. After I had created a few new entries I decided to change the styles to match the site styles. I did this but it only affected entries made after the changes were made.

    On this page http://www.owenkelly.net/2007/01/24/wordpress-21/ the word WordPress is a “text replace” made after I removed the underline from the css and unchecked DomTT. On the other hand UTW was entered before I removed DomTT, and it still has underlining and still shows the help cursor.

    So I looked to find where the entries were stored, thinking the information had been stored at the time of creation. Then I realised you weren’t using a database table to store them. Where are the user defined entries stored? And how do I remove the styling once it is applied?

    I know I could remove the entries and re-enter them. I am asking this now though in case I want to change my style sheets at some point in the future when I have 200 entries :)

    Which is an oblique way of saying that I think ubernyms is going to join UTW as an absolutely indispensible plug-in for me. Many thanks.

    Owen

  • Owen:

    Oh, and while I am here, I would be very happy to have an additional feature. I would like “Replace Text with tooltip” as an option which would replace the text with the definition, add a link, and then show the description in the tooltip.

    Then I could tip “reg”, have this changed into “the Register” as a link, with “biting the hand that feeds IT” showing as a tooltip when the reader hovers over the link.

    Could you add that some time, please? Unless of course there are secret reasons for not including it :)

    Cheers,
    Owen

  • Owen:

    My guess is that you missed a spot in the CSS file (they’re different):

    • WordPress as you described is a link with the CSS classes “ubernym” and “uttReplace”
    • UTW is also a link, with the CSS classes of “ubernym” and “uttAbbreviation” but it is also in an abbr tag with the class “uttAbbreviation”

    And there’s no reason that I can remember for not allowing tooltips on the replace type. I’ll try to get to that.

    Nills

    I think the Umlauts is more of the UTF-8 stuff…

  • For some reason, the download link doesn’t seem to be working at present. http://www.huddledmasses.org/wp-content/plugins/ubernyms.zip gives a “page not found” error.

  • sigh I fixed the download link … (I moved wordpress into it’s own directory, and for some reason, I’ve got all my plugin downloads inside wp-content).

  • Is there a place where I can set the time the DomTT tooltip is showing? I have pretty large texts in there and it is not possible to read it all before de tooltip disappears.
    Also, due to these long texts, it would be nice to place them in a rather large textarea instead of an input field.
    Otherwise very cool plugin. Keep on the good work!

  • Yes, in the DomTT script (and thus, in the initialization of it in my script) there are many settings for it. I thought about putting all the DomTT options into the control panel, but I was just too lazy.

  • Thx, I’ ll have a look at them. I allready tried some of them out, but without result. Must have chosen the wrong settings.

  • HI, Love the plugin and have been using for a while now. I have a record of an on-line game and am using this for tagging glossary items. It was working fine, but when I try and add an 84th “Just Link” it will not add the link. Have you seen a limit in the code somewhere. I cannot find any limit and am wondering if it might be a total size limitation on the database entry. Thoughts?

  • Hello,

    I’ve got Ubernyms install and working, but it does not seem to work if the item is part of a <LI>. Is all text of a post parsed or are there restrictions?

Archives