Exemplo n.º 1
0
}
$count = 0;
/**
 * Then get updates from Flickr..
 */
if (!empty($flickrfeed)) {
    $url = $flickrfeed;
    $rss = fetch_rss($url);
    if ($magpie_error != "") {
        debug("Lifestream parser / Flickr: " . $magpie_error('', true) . "\nurl: " . $url);
    }
    if (count($rss->items) > 0) {
        foreach ($rss->items as $item) {
            $tempitem = array();
            $url = lightbox::find_photo($item['summary']);
            $thumb_url = lightbox::photo($url, "square");
            $tempitem['title'] = sprintf("<a href=\"%s\"><img src=\"%s\" alt=\"%s\" border='0' /></a>", $item['link'], $thumb_url, $item['title']);
            $tempitem['link'] = $item['link'];
            $tempitem['date_timestamp'] = date("Y-m-d H-i-s", $item['date_timestamp']);
            $tempitem['source'] = "flickr";
            $tempitem['icon'] = str_replace("%icon%", "flickr.gif", $iconpath);
            $items[$tempitem['date_timestamp']] = $tempitem;
            $count++;
            if ($count >= $maxperfeed) {
                break;
            }
        }
    } else {
        debug("Flickr feed contains no data.");
        debug("feed url: {$url}");
    }
Exemplo n.º 2
0
/**
 * What sizes should we use?
 * Choices: square, thumb, small, medium, large.
 */
$thumb = 'square';
$full = 'medium';
?>
 
	<!-- Format the photos in a way that the Lightbox-clone scripts prefer. -->
	<?php 
foreach ($feed->get_items() as $item) {
    // Set some variables to keep the rest of the code cleaner.
    $url = lightbox::find_photo($item->get_description());
    $title = lightbox::cleanup($item->get_title());
    $full_url = lightbox::photo($url, $full);
    $thumb_url = lightbox::photo($url, $thumb);
    ?>
 
	<a href="<?php 
    echo $full_url;
    ?>
" title="<?php 
    echo $title;
    ?>
" rel="shadowbox">
		<img src="<?php 
    echo $thumb_url;
    ?>
" alt="<?php 
    echo $title;
    ?>