Ma.gnolia WordPress plugin 1.1

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

So here’s a few extra features – some requested, others invented.

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 new syntax gives many more options – they 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 include the H2 tag with the “Ma.gnolia” title above the list of links (optional, 1 or 0, default is 1)
  4. Whether to show the description of each link (optional, 1 or 0, default is 0)
  5. Whether to show the date you published each link (optional, 1 or 0, default is 0)
  6. Whether to link to the Ma.gnolia page of each link, instead of the links themselves (optional, 1 or 0, default is 0)
  7. 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, with a “Ma.gnolia->[your username]” title above them, you only need supply your username:

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

Or to make it more interesting, to show the H2 title, then 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, 1, 0, 1); ?>

Or to omit the H2 title (just outputting a UL/LI structure, like e.cordero wanted), then show 20 links, without descriptions or dates, linking to the actual link URLs, we would do this:

<?php magnolia('barryprice', 20, 0, 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, 0); ?>

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

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

Download Ma.gnolia plugin 1.1

7 thoughts on “Ma.gnolia WordPress plugin 1.1

  1. Barry,

    Thanks for stopping by my site to check out the modifications I made. I’d be glad to combine efforts and see what we can do, though you may have already covered all bases with v1.1. I’ll to take a closer look.

    Feel free to contact me offline via email.

    And by the way, thanks for the nice work!

    Ed

  2. I can’t get this to work! I enable the plugin, adds the code (cut’n paste), change the username to mine, and nothing happens! I’ve waited many hours, becouse I thought it might need some time (I just bookmarked the pages at the same time I added the plugin), but still nothing! Help..?

  3. Any error messages? Can you write to the wp-content directory? Does your host allow fopen() ?

    What were you waiting for? The page to load?

    Need some more information, sorry :-)

  4. No error messages, the page looks just as it did before I did anything. I just waited to see if it would start working after a while, I thought there might be a lag. The blog in question is the one located at http://blogg.forteller.net/ and I’ve implemented your code in the sidebar just above where it says “Comments”.
    I don’t know what fopen() is, but I’m using DreamHost and I’m using many other plugins at the moment. wp-content permisions is set to 755.