May 11th, 2009 4:38:37 pm pst by
Sterling Camden
Yes, this is such a major upgrade to my OPML Browser plugin for WordPress that it warrants bumping the initial digit in the version number. Here’s what changed:
- The plugin now expects to be installed in its own folder: (siteurl)/wp-content/plugins/opml-browser
- JavaScript and CSS have been separated into their own files.
- JavaScript events are now hooked on window load instead of in the HTML.
- Added “alt” attribute to all “img” tags.
- Images are now looked for in (siteurl)/wp-content/plugins/opml-browser/images
- If an image cannot be found, it will be replaced by the supplied unknown.png (a question mark).
- Added “Sort items?” option. This sorts within categories, unless the “flatten” option is enabled (see next item).
- Added the “Flatten hierarchy?” option. This combines all items into one level. If sorting, all items get sorted together.
- The OPML description attribute is now displayed as a tooltip (as in the OPML Blogroll widget, but it also works in IE and Opera now!).
As far as I know, the OPML Browser can now do everything that the OPML Blogroll widget could do (items 7 through 9 filled that out), so I am herewith declaring the OPML Blogroll widget retired from further upgrades. Please use this plugin’s widget instead from now on. Let me know if I’ve forgotten any functionality that you need.
A big “thank you” to all of my users who requested various features and reported bugs. This plugin would not be what it is today without your input.
Posted in AJAX, ATOM, CSS, JavaScript, OPML, PHP, RSS, WordPress |
1 Comment » RSS 2.0 | Sphere it!
April 17th, 2008 1:47:33 pm pst by
Sterling Camden

Thanks to a suggestion from Diego, I have added tooltips to each entry in the OPML Blogroll widget for WordPress. These tooltips display the content of the “description” attribute of each outline entry, if one exists, when the user hovers the mouse over the entry.
Note that this is not an update to the OPML Browser plugin, although I plan to add the same feature to that plugin as well (along with a ton of other enhancements).
I used JavaScript to pop up and remove the Tooltips. I decided to roll my own (with much help from Shelley Powers’ book Adding Ajax) rather than use an existing library, in order to keep the widget lean and to avoid conflicts with other libraries that might be in use on your blog.
Thanks to Internet Explorer, this seemingly simple enhancement required about twice as much JavaScript code as as a Firefox/Opera/Safari-only version would have. Here are the differences that required special code for IE:
- Of course, events don’t get passed to event handlers. So you use window.event. No big deal.
- And we all know about addEventListener vs. attachEvent. Not a problem, just wrap it in a function.
- If you attach a property to a DOM object, lose the reference, and then reacquire that same element from the DOM later, it doesn’t have the property you added any more. Apparently IE gives you a new object each time. So in IE, this plugin has to look up the tooltip for the current item every time it wants to be displayed.
- Not having the “currentTarget” property on the Event object in IE really sucks. You can use “srcElement”, but it isn’t the same element as “currentTarget”. For instance, if you have a “mouseover” event on an element that contains a link around an image, “currentTarget” gives you the element on which the event was specified, whereas srcElement will give you whatever contained element the mouse was actually over. So this plugin accesses parentNode until it finds the one that’s meaningful.
Another nice “feature” of Internet Explorer keeps the tooltips from displaying at all in my theme – perhaps due to the use of float on nearby div’s. I tried the fix outlined here to no avail. It does work using the WordPress default theme, though, so there is hope. Let me know how it works with your theme.
I also fixed a problem with the auto-discovery link in which the ending quote on the href was missing.
Linking to earlier versions for pingback.
UPDATE: 2009-05-11: I have incorporated all the features of this widget into my OPML Browser plugin version 2.0. Please upgrade (it’s free).
Posted in CSS, JavaScript, OPML, PHP, RSS, Web, WordPress |
16 Comments » RSS 2.0 | Sphere it!
March 4th, 2007 3:09:57 pm pst by
Sterling Camden
Sorry Paul, this isn’t the big update you’re waiting for — just a few loose screws that needed tightening up.
After upgrading to WordPress 2.1, I noticed that the RSS icons in my OPML blogroll widget disappeared. I was using an image that is no longer distributed in the same location, so I put a copy of rss.png in the wp-content/widgets/images directory.
Taking a look at how I was referencing images, I realized that it also wouldn’t work if your blog was not in the root folder of your domain. So I added a call to get_settings(‘siteurl’) to fix that up.
Last month I nearly ran out of bandwidth on Chip’s Quips, and after analyzing the requests I found that nearly half of the bandwidth for the month was consumed by requests for my OPML file. In my case, the OPML file resides on the same server as my site, so there’s no need to request it over HTTP. I added a “Local path” option to the widget which, if specified, will open the file locally.
So now of course the “OPML URL” option is no longer required. If you leave that empty, then the auto-discovery link will be suppressed. It doesn’t make much sense to auto-discover a link on the local file system.
I also discovered that WordPress’s cache support in wp-includes/cache.php ignores the $expire parameter that you can pass when adding or setting cache data. This has not been fixed in WordPress 2.1 either. I’ll have to come up with a better solution so the OPML file doesn’t get banged every fifteen minutes, whether or not it’s on a local drive. But we’ll leave that for the next revision.
UPDATE (3/29/07): Tony Lindskog found a bug where a feed that has no “text” attribute caused a regular expression parsing error, and Paul McGillivary found a missing end-quote in the auto-discovery link. I’ve included fixes for those as well.
UPDATE (3/29/07): For an OPML plugin that preserves the hierarchy within the OPML file (categories, usually) and lets you expand/collapse that hierarchy, go here.
UPDATE (4/17/08): The latest version of this plugin can be found here.
Posted in OPML, PHP, RSS, Web, Wildly popular, WordPress |
31 Comments » RSS 2.0 | Sphere it!
October 9th, 2006 11:50:50 am pst by
Sterling Camden
Thanks to some suggestions from Sergio Longoni, this morning I whipped up version 1.1 of the opml-blogroll widget for WordPress.
New features include:
- OPML auto-discovery link tag added to the “head” section of your page automatically (Sergio provided the code).
- You can suppress the OPML image and link by unchecking a new option “Link to OPML?” which is checked by default when upgrading.
- If you keep the OPML link, I’ve added the new semi-standard OPML icon.
- Closed the “img” tag for the RSS icons for XHTML compliance (oops).
Suggestions for future enhancements:
- Sergio suggested adding more control over how items are displayed. For instance, he would prefer “li” tags instead of a table. I’m going to give that some thought, but perhaps I could include options for prolog, epilog, pre-item, post-item, etc. and let you control the HTML.
- The Dead 2.0 skeptic (who appears to have been hammered out of the blogosphere by the traffic surge incumbent upon his identity intrigue) suggested a while ago that I add some form of paging, so that only the first N items would be displayed unless the user took some action.
What do you think of these suggestions? Got any more?
UPDATE: Latest version here.
Posted in OPML, PHP, RSS, Web, Wildly popular, WordPress |
25 Comments » RSS 2.0 | Sphere it!
June 14th, 2006 10:59:01 am pst by
Sterling Camden
I don’t know about you, but when Share Your OPML went live, my first thought was “Oh great, something else to keep updated!” It’s bad enough trying to keep my blogroll on my blog up to date with my subscriptions in my feed reader(s). Now there’s SYO to keep updated, too. Not to mention other similar sites like OPML Workstation and OPML Manager.
This little widget hopes to bring us some relief. Rather than having to reload your blogroll or manually update it every time your subscriptions change, you can display your blogroll directly from a hosted OPML file. So, you can keep your OPML at OPML Workstation or OPML Manager (would be nice if SYO offered an external link as well), and just keep that up to date. Or, you can host the OPML file on your own site and just hand the URL to SYO. Either way, you only have to keep this file updated in one place.
For me, that means that when I add a subcription to my Favorite Feeds folder in FeedDemon, I’ll export my OPML and upload it to my site. Done.
Installation and configuration instructions are included in the opml-blogroll-readme.txt file enclosed.
UPDATE: Latest version here.
Posted in OPML, PHP, Wildly popular, WordPress |
33 Comments » RSS 2.0 | Sphere it!