magpie RSS. Author: Jon Madison Author URI: http://www.smartbrother.org Version: 0.3 0.2 - Fixed error when you specify "0" on showAlbumTitles 0.25 - Added title hover text 0.3 - cache dir configuration pointing to the place specified by the install directions, choice of layout types (currently list or div) */ /* STUFF TO NOTE: In my estimatiion, gallery having the "imgsrc" tag represent the thumbnail, and the "thumbnail" represent the "sized" image is incorrect, and perhaps a bug. When they fix it, you'll want to update your plugin as i will have fixed it. TODO: besides fixes, want to use the actual thumbnail attributes. From what I understand, Magpie RSS does not handle attributes. INSTALL: 1) make sure you have downloaded Magpie RSS from http://magpierss.sourceforge.net and have unzipped or untarred it somewhere your webserver can see it. 2) put this plugin (gallery_rss.php) in place: wp-content/plugins 3) create the cache directory: cd [Wordpress Installation Dir]/wp-content/plugins mkdir cache_gallery_rss chgrp [web group of your server] cache_gallery_rss chmod g+w cache_gallery_rss go to your Wordpress admin, and enable the "Gallery RSS" plugin USAGE: in your template Call the gallery_rss function somewhere in your index.php as: "echo gallery_rss(4,"",0,0.50,"div")"; and style the output using CSS. parameters: numItems - number of items to show from feed (defaults to 5) photoTitle - title header of the displayed thumbnails showAlbumTitles - show album titles with thumbnails scaleMultiple - decimal amount to scale image thumbnails. 1.0 is fullsize. use a fractional amount for smaller thumbnails (i.e. 0.50) layoutType - layout type. currently supported: "ul" - unordered list "div" - divs allowing for box type styling The default is "ul". */ /********************************** * Set up the following variables: **********************************/ //where you installed magpie RSS $magpie_install_dir = "/home/jmm/jon/magpie"; //set the URL to where your gallery RSS is, typically something //like //$gallery_rss_url = "http://[yoursite]/gallery/rss.php"; $gallery_rss_url = "http://www.smartbrother.org/gallery/rss.php"; $gallery_rss_cache_dir = "./wp-content/plugins/cache_gallery_rss"; define('ATTR', '_mprAttribs'); // element attributes //cache timeout, in seconds. $cache_timeout = 3600; /********************************** * End variable setup **********************************/ function gallery_rss ($numItems = 5,$photoTitle,$showAlbumTitles = 0,$scaleMultiple = 1.0, $layoutType = "ul") { global $magpie_install_dir, $gallery_rss_url, $cache_timeout, $gallery_rss_cache_dir; $output = ""; define('MAGPIE_CACHE_DIR', $gallery_rss_cache_dir); define('MAGPIE_CACHE_AGE', $cache_timeout); require_once($magpie_install_dir . '/rss_fetch.inc'); $rss = fetch_rss($gallery_rss_url); if(!empty($photoTitle)) { $output .= "
$title
\n"; } $output .= "