[Edit: The latest version of this plugin can be found here.]
I finally got round to hacking up the Ma.gnolia plugin so that it caches the link list for 30 minutes (by default), so as not to irritate the Ma.gnolia XML server any more than really necessary. Until now, it had been sending a request for each and every page render. I meant to fix it last week, and completely forgot…
To recap, this plugin allows you to easily publish your latest Ma.gnolia links in your WordPress sidebar (or anywhere else you want to call it from).
WordPress’s built-in RSS handlers didn’t seem to like Ma.gnolia’s feeds (they serve them up with a 301 redirect, which Snoopy apparently can’t cope with – details here), so I’ve used PHP5’s built-in DOM XML functions. Obviously this means that you will need version 5 of PHP on your server. If this isn’t an option, feel free to use my original JavaScript plugin, still available here.
The syntax remains the same as the previous version, with the exception that the byline is no longer an option. The default number of links to show is 10.
<?php magnolia(USERNAME[, NUMBER_OF_LINKS); ?>
eg. to show my 10 latest links, I simply use:
<?php magnolia('barryprice'); ?>
To show my 23 latest links, I’d use this instead:
<?php magnolia('barryprice', 23); ?>
Dead simple.
Diffs to automate usage of this plugin with K2 will be up shortly at some point…
Download Ma.gnolia plugin v0.2
I’m trying to edit your XHTML and CSS definitions slightly to better fit my blog. Unfortunately, none of my changes seem to take effect. Files saved to localhost (my test enviro) appropriately, everything checks out and yet when I refresh things, the XHTML and div classes are still the same.
Any ideas? Is there any other file other that magnolia.php that I need to be looking for?
Thanks!
Hi, the outputted uses the magnolia-linkroll (for the main div) and magnolia-linkroll-title (for the title) classes, which you’re free to define in your css.
I haven’t defined them at all, just using K2′s sidebar defaults. If you mean you’re editing the magnolia.php file and aren’t seeing the changes, I guess you’ve got a caching issue somewhere…
Hi Barry, is there a way to modify this to only display links from a certain bookmark group? I have a new blog associated with a bookmark group and only want those links displayed. If not, do you have any suggestions on how I might do this?
thanks
ryan
Hi Ryan,
It’s certainly possible, with a slight amend to the script. At the moment you supply the username as an argument, eg “JoeBloggs”. The script then appends this to the string “http://ma.gnolia.com/rss/lite/people/”, making the full path to the RSS feed “http://ma.gnolia.com/rss/lite/people/JoeBloggs”.
All you’d need to do to amend this to use groups instead is to change the string “http://ma.gnolia.com/rss/lite/people/” to “http://ma.gnolia.com/rss/lite/groups/”. Eg. for your blogging software group, you’d amend the string in the plugin as above, then supply the argument “blogsoft” as the “username”.
This would generate the URL “http://ma.gnolia.com/rss/lite/groups/blogsoft”, which is the RSS link for that group.
Hope that makes sense, I’ll probably include this as an option in the next version of the plugin – along with support for PHP4 (probably using Curl to retrieve the URL). That way you could use it twice in one page, for a group feed and a user feed.
awesome, thanks so much:)
Great work! And *almost* exactly what I need. I’m looking for a way to only show my bookmarks which I’ve given a particular star-rating, e.g. any links with more than 4 stars. Is that also something I can achieve with just a little script change?
Hi Matt, that’s something I’ll certainly take a look at, but if the star rating data isn’t in the RSS feed then it’s probably not going to happen. If it is, then it should certainly be possible.
Sorry for the delays with this, I’ve got version 0.3 almost finished. It works with PHP4 or PHP5, doesn’t require JavaScript, and doesn’t require php-curl or fopen() support. If I’m feeling brave when it’s done, I might even call it version 1.0!
But I’ve got way too many other projects on at the moment, and sadly the ones that pay my rent are being prioritised above this. Oh, and I’ve just started Thai lessons (which I’m going to post about soon)!
Excuses, excuses… I’ll have the new version up soon, honest!
great plugin!
but unfortunately I got error message in my blog.
i’m, using wordpress 2.0
whe the plugin activated, appear this message :
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/junecom/public_html/wp-content/plugins/magnolia.php on line 45could you help me please?
thank you
Hi germanny, dental.
I’ve never seen that error myself – are you sure you have PHP5 installed?
Version 0.3 (or perhaps even 1.0) will be up “Real Soon Now”, hopefully that will address these issues.
I’m really sorry about the delays but I’m working on several websites other than this one, figuring out life in a new country and culture, learning the language, and there just aren’t enough hours in the day!
Ma.gnolia always seems to be “next on the list”, unfortunately!
Closing comments here now – Version 1.0 is finally done.
Famous last words, I suspect…