Ma.gnolia WordPress plugin 1.2

[Edit: The latest version of this plugin can be found here.]

Just a minor update to allow usage as a K2 Sidebar Module.

nb. To facilitate this, I removed the option for the plugin to output its own title – therefore the syntax involved in calling it has changed slightly – take note.

A note to new readers, this is a plugin for WordPress which lets you display the latest links from your Ma.gnolia account. You can now also display links matching one of your tags instead, if you like.

The options are, in order:

  1. Ma.gnolia username (required)
  2. Number of links to show (optional, can be any integer from 0-20, default is 10)
  3. Whether to show the description of each link (optional, 1 or 0, default is 0)
  4. Whether to show the date you published each link (optional, 1 or 0, default is 0)
  5. Whether to link to the Ma.gnolia page of each link, instead of the links themselves (optional, 1 or 0, default is 0)
  6. Whether to just show links marked with a certain tag (type the name of the tag in quotes if you want to do this, default is none)

So to just show your last 10 links, you only need supply your username:

<?php magnolia('barryprice'); ?>

Or to make it more interesting, to show the last 15 links I published, with descriptions, without dates, and linking to the Ma.gnolia page for each, I would do this:

<?php magnolia('barryprice', 15, 1, 0, 1); ?>

Or to show 20 links, without descriptions or dates, linking to the actual link URLs, we would do this:

<?php magnolia('barryprice', 20, 0, 0, 0); ?>

Of course, the default setting for those last three arguments is 0 anyway, so this would also work:

<?php magnolia('barryprice', 20); ?>

Finally, to do the same thing but only for entries tagged with “apple”, we would do:

<?php magnolia('barryprice', 20, 0, 0, 0, 'apple'); ?>

Download Ma.gnolia plugin 1.2

29 thoughts on “Ma.gnolia WordPress plugin 1.2

  1. Hi Sebastian – I’d never heard of Microformats or xFolk before your comment, but it looks trivial enough. Doesn’t look like it would break anything if I format the output like that for the next version, so consider it um, considered :)

  2. Hi Barry, it is a good plugin. However, it seems that is not working properly since this morning, might because ma.gnolia has done some changes to their site. I checked other commenters’ blogs and they all have the same problem. Do you have any ideas? Cheers.

  3. Ouch. Looks like every RSS/Atom feed on the whole ma.gnolia site is coming up 404 at the moment. Looks like a glitch at their end (I’ve just reported it), let’s hope they fix it soon.

  4. Hi, Barry, it’s back again. Working quite nicely.

    I am trying to style the output links by css, but it is quite difficult to target the title and description since they are both contained in the li tag, I know very little (tiny) about php, tried to tweak the code several times, resulted nothing but break the code. Have you considered seperate the title, description and date and other possible information in the forthcoming releases so user can style them more easily?

  5. Ah, relief. Yes, styling will probably become easier once I implement the XFolk output structure as requested by Sebastian up ↑ there :)

  6. Hey Barry, this is great! On top of Sebastien’s suggestion, Ma.gnolia is already publishing xFolk, so instead of relying on RSS, you could actually more easily scrape a ma.gnolia user’s profile page for links — in fact you could even simply copy over the entire linklog without reformatting — which would save a lot of processing on both ends!

    It’s like, why convert from HTML to RSS to HTML again? Why not just go from HTML to… HTML?

  7. Hi Chris

    I’m not using Ma.gnolia’s linkroll – I’m using their RSS feeds, which are formatted as RSS – not HTML :-)

    I’m on it though!

  8. Hmph. Looks like Ma.gnolia’s own linkrolls aren’t formatted as xFolk.

    Which means I’ve got to parse this spec, which is apparently subject to change at any time, and no way I’m going to get it done tonight :(

  9. xFolk should be working, Barry. We’ll look into this in the next day and let you know when we have it fixed. Sorry for the ups and downs – it’s temporary.

  10. Hi Todd, nice to see you :)

    The ma.gnolia linkroll generator gives me some javascript that outputs a brief <style> stanza, followed by a dl/dt/dd block marked with the “magnolia-mark” and “magnolia-description” classes.

    Which doesn’t look like what I expected xFolk to be.

    Am I missing something?

  11. Hey Barry – I got some answers about what’s going on here from Larry, who runs the Ma.gnolia show.

    We support xFolk on all of our Ma.gnolia.com pages, but we don’t use it in our linkrolls for a couple of reasons:

    1. we use Ma.gnolia-specific class names so that we avoid local style sheet conflicts, and people can specifically style the link roll

    2. the linkroll is dynamically rendered javascript, so microformats would never actually appear in the page markup to people/bots/agents looking at the page code.

    Should we be providing an xFolk feed?

  12. Hi Todd,

    Makes perfect sense. Got confused by Chris’s comment I think.

    I’ll take a look at the magnolia.com source to try and grok the xFolk markup and apply it to the plugin.

    Thanks again to all the commenters for your input!

  13. Having a problem with installation….I inserted this code in my sidebar:

    <?php magnolia(‘dougunderscorenelson’, 15, 1, 0, 1); ?>

    and it outputs absolutely no code. The plugin is activated, I turned permissions up to 777, I have PHP5 and a number of other plugins running….baffling. I’m no PHP wizard, so just to make sure I wasn’t putting it inside an ifelse or something, I pasted the code all over the sidebar. No results. Can you think of anything else I should be checking? Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">