Live and Relax

5 Feb 2009 Pure Photoblog Modification Part 5

Filed under: Site Notes & News — ghorse@10:27 PM

In order to make a rss feed for the photoblog, I need a plugin that could handle the single pic short code in nextgen gallery and turn out the image url in the rss feed.  It turn out that the wp-piclens-plus plugin could do the magic.  The following addition in red in the wp-piclens-plus mrss.php make the media rss feed of only photoblog post to include a thumbnail of the image so that it could work with services like photoring and vfxy.  So, finally the following photoblog feeds works:


http://ghorse.org/wordpress/feed/mrss?cat=9



// Put items into PicLens MRSS feed
foreach ($allImages as $imgArray) {
$imgSrc = wp_specialchars($imgArray['thumb'], true);
$imgSrc = str_replace( ” “, “%20″, $imgSrc );
$imgSrcFull = wp_specialchars($imgArray['full'], true);
$imgSrcFull = str_replace( ” “, “%20″, $imgSrcFull );
// 5 lines added by KF to get thumbnail url only suitable for nextgen gallery
$imgSrc = $imgSrcFull;
$thumb_pos = strrpos($imgSrc, “/”);
if($thumb_pos != false) {
$imgSrc = substr_replace($imgSrc, ‘/thumbs/thumbs_’, $thumb_pos, 1);
}

// plplus: added wp_specialchars() around the attribution text.
echo ‘
<item>
<title>’ . $imgSrc . ‘</title>
<link>’ . $imgArray['guid'] . ‘</link>
<media:thumbnail url=”‘ . $imgSrc . ‘” />
<media:content url=”‘ . $imgSrcFull . ‘” />
<attribution text=”‘ . wp_specialchars($imgArray['text'], true) . ‘”/>
</item>
‘;
}

Related posts || 相关文章

Tags: category, mrss, nextgen gallery, photo blog, photoring, rss, thumbnail, vfxy, wordpress, wp-piclens-plus

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

:o :) :lol: ;) :( 8) :P :D 8O :? :x :| :oops: :mrgreen: :roll: :evil: :twisted: :cry: :!: :arrow: :idea: :?: more »

Live and Relax Copyright gHorse