Posts Tagged ‘plugin’

Friday Photos Version 1.2

Friday, May 16th, 2008

This release corrects two minor issues and implements a new feature. First, the most significant issue corrected was that the number of photos added to the post wasn’t always returning the amount specified by the option “Max Number of Photos to Display”. This was happening because the number of uniquely titled photos requested could be more than the number of photos recieved from the Flickr API call. Essentially the correction required calling the Flickr API until the “Max Number of Photos to Display” value had been reached or no more photos were available that matched the search criteria. The second issue required the renaming of the more_reccurences() and all references to it, to fridayphotos_more_reccurences(). This was to insure no collisions would occur with other plugins implementing this function. A new feature was also added to this release it will allow for posts to be generated in statuses other than “published”. This is managed on the Friday Photos’ “Option” screen through a new DropDownBox titled “WordPress Post Status” that allows the user to select the appropriate status. You can download the Version 1.2 of Friday Photos here.

Friday Photos Version 1.1

Monday, May 5th, 2008

Friday Photos Version 1.1 corrects two issues and implements a new feature. First to support weekly scheduling the implementation of WP Pseudo Cron required a “weekly” interval value that isn’t part of the default cron_schedule filter. To add this interval value the implementation of a filter function, as explained in the article Timing is everything: scheduling in WordPress, was needed. The code is shown here:

function more_reccurences() {
return array(
'weekly' => array('interval' => 604800, 'display' => 'Once Weekly'),
'fortnightly' => array('interval' => 1209600, 'display' => 'Once Fortnightly'),
);
}
add_filter('cron_schedules', 'more_reccurences');

Secondly the “Author” field wasn’t being set properly and required a small change to pass the field from the form to the database. Additionally Friday Photos now supports the ability to pull in the picture’s description from Flickr. This is handled through a new checkbox titled “Include Flickr Description” on the “Friday Photos” admin screen. You can download the new version of Friday Photos here.

Friday Photos My First WordPress Plugin

Monday, April 21st, 2008

I was recently inspired to write my first WordPress plugin, Friday Photos. The Friday Photos plugin will access your Flickr account and create a weekly post of a specified number of pictures based on username and tags. The first release will require a Flickr API Key, Flickr Secret and Flickr Username to be entered on the Friday Photos Options screen. (see screen shot below) Future releases will pull the description field and tags from Flickr, improve photo selection options, and add Flickr video support.

fridayphotosoptions_x500.png

The plugin draws on the code and ideas of two great plugins, the Slickr Gallery and Yet Another Daily Delicious. As this was my first attempt at writing a plugin the challenge of learning phpFlickr, the Flickr API, the basics of WordPress Plugin design, and how WP Pseudo Cron works all at once was challenging but with these well done plugins to look at it proved a very doable project.

A sample post can be seen live on the blog Milwaukee Development Update and starting Friday April 25th 2008, the site Friday Photos, will use the plugin to display weekly photos. The Friday Photos site will be the place to look for new releases and additional documentation for the Friday Photos Plugin.

To try out this plugin yourself:

  1. Download Friday Photos
  2. Upload the plugin into your wp-content/plugins directory
  3. Extract the .zip file
  4. Activate the plugin in the plugin administration page
  5. Open the plugin configuration page, which is located under Options -> Friday Photos and enter your Flickr username, Flickr API Key, Flickr Secret and additional paramaters. To obtain a Flickr API Key click here
  6. The plugin will automatically create a Friday post of pictures from your Flickr Account