A stripped down uni-purpose version of my magpierss hack. All it does is read feeds from Gallery and put thumbs in your sidebar. Here's the short version. Step one: get [url=http://magpierss.sourceforge.net/]magpierss[/url] and put the extlib folder and 4 rss_ files in your skins/skinname folder. Step two: put something like
<?php require( dirname(__FILE__).'/rss_fetch.inc' ); ?>
<div class="bSideItem">
<h3>Magpie Does Gallery</h3>
<?php
$url = "http://blahblahblah.tld/gallery/rss.php";
$rss = fetch_rss($url);
require( dirname(__FILE__).'/_galleryreader.php' );
?>
</div>
in your sidebar in _main.php. Step C is to put
<?php
/**
* This file uses magpierss (magpierss.sourceforge.net) to read feeds from
* gallery (gallery.menalto.com) and display a thumbnail in the sidebar.
*
* This requires magpieRSS which is not part of the b2evolution distribution
* magpieRSS is released under the GPL License and the author holds copyright
* This application makes absolutely no modifications to the magpieRSS files!
* Download it, unzip it, and upload the files to your /skins/skinname folder
*
* magpieRSS - {@link http://magpierss.sourceforge.net/}
* Released under the GNU General Public License.
* @copyright (c)2002 kellan @ protest.net. All rights reserved.
* Please read the disclaimer at the top of the /extlib/Snoopy.class.inc file.
*
* Gallery - {@link http://gallery.menalto.com/}
* Released under the GNU General Public License.
* @copyright (c)2000-2004 Bharat Mediratta
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2004 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
* @subpackage your_skin_name
*/
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
# set this to false if you don't want to show the name of the gallery
# if false then 'gallery_start', 'gallery_end' and 'gallery_linked' don't get used
$show_site_name = true;
# this is for the name of the gallery
$gallery_start = '<h4>';
$gallery_end = '</h4>';
# set this to false if you don't want the gallery title linked to it's url
$gallery_linked = true;
# this is for the before and after all the thumbnails
$thumb_block_start = '';
$thumb_block_end = '';
# this is for the before and after each thumbnail
$thumb_start = '<p>';
$thumb_end = '</p>';
# set this to false if you don't want thumnails linked to thier url
$thumb_linked = true;
# this is what comes after the src and title and alt in the img tag
$thumb_tag_end = 'class="middle"';
# this is how many items to show if it is not set in _main.php
if(!isset($show_me)) $show_me = 10;
// BEYOND HERE BE DRAGONS!
if( $rss ) {
if( $show_site_name ) { // do this if the site name gets displayed
$site_title = $rss->channel['title'];
$site_url = $rss->channel['link'];
$site_desc = $rss->channel['description'];
$gallery_string = "";
$gallery_string .= $gallery_start;
if( $gallery_linked ) {
$gallery_string .= "<a href=\"".$site_url."\" title=\"".$site_desc."\">".$site_title."</a>";
} else {
$gallery_string .= $site_title;
}
$gallery_string .= $gallery_end."\n";
echo $gallery_string;
}
echo $thumb_block_start."\n";
$ii = 1;
foreach ($rss->items as $item ) { // now start cycling through items
if( $ii <= $show_me ) { // do it again if we have not reached the limit
$thumb_title = $item[title];
if( $thumb_title == '' ) { // if the item is untitled then make one up
$thumb_title = substr(strip_tags($thumb_desc), 0, 20).'...';
}
$thumb_url = $item[link];
if ( $thumb_url == '' ) { // if the item has no link then use the site link
$thumb_url = $rss->channel['link'];
}
$thumb_image = $item[photo][imgsrc];
$thumb_image = '<img src="'.$thumb_image.'" title="'.$thumb_title.'" alt="'.$thumb_title.'" '.$thumb_tag_end.' />';
$thumb_image_string = "";
$thumb_image_string .= $thumb_start;
if( $thumb_linked ) { // do this if the item gets linked
$thumb_image_string .= "<a href=\"".$thumb_url."\" title=\"link to ".$thumb_title."\">".$thumb_image."</a>";
} else { // do this if the item title does not get linked
$thumb_image_string .= $thumb_image;
}
$thumb_image_string .= $thumb_end;
echo $thumb_image_string;
}
$ii++;
}
echo $thumb_block_end."\n";
} else {
echo "<p>Houston we have a problem</p>";
}
?>
in your skins/skinname folder as _galleryreader.php.
Decorate as you see fit. I think it's got enough stuffers to let you do your thing your way. By the way I only tested this on one gallery installation. It's possible that they have more than one feed but I don't know. The file I pulled from was "rss.php" if that helps.
Finally, if you want, you can throw some traffic my way by reading the same thing on [url=http://wonderwinds.com/hackblog.php/2005/01/20/gallery_feed_reader_for_b2evolution]my blog[/url].
it works and i really like it. but how can i control where it pulls the thumbs from? i've looked in the rss.php file and others but i'm not that code savvy.
i'd like to just post thumbs from the newest album i put into gallery.