Topic: Combining Flickr + Local Pictures

Hi,

Pretty much what the topic says, I would like to incorporate linking my Flickr profile + local pictures from the server.

I have set up my Flickr successfully and I have set up local images successfully too but I want to mix them together now. I dont think this is possible, but I am hopeful that there is a way to set two databases together. I would greatly appreciate it if someone could give me some tips if possible or show me how to do it.

Thank You for looking and helping smile

Re: Combining Flickr + Local Pictures

You could use phpFlickr to pull your Flickr images into a dynamically generated XML file alongside local content.

phpFlickr can be found here: http://phpflickr.com/
Instructions on 'How to display your Flickr images using PHP' can be found here: http://www.burnmind.com/howto/how-to-di … -using-php

The following example will load 500 (which is the maximum) Flickr images in SimpleViewer Pro (or 50 images in SimpleViewer Standard) and then one local image at the end.

(1) Your embedding code would look like this:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars={};
flashvars.galleryURL="gallery.php";
jQuery(document).ready(function () {
SV.simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

(2) You would then upload phpFlickr (keeping the files in the 'phpFlickr' folder) to your web server (in the same folder as your 'gallery.php' file)

(3) Your 'gallery.php' file would look something like this (filling in your own Flickr API key and username as appropriate):

<?php
echo'<?xml version="1.0" encoding="UTF-8"?>';
echo'<simpleviewergallery title="SimpleViewer-Pro Gallery">';
require_once("phpFlickr/phpFlickr.php");
$phpFlickrObj = new phpFlickr('your_Flickr_API_key_goes_here');
$user = $phpFlickrObj->people_findByUsername('your_Flickr_username_goes_here');
$user_url = $phpFlickrObj->urls_getUserPhotos($user['id']);
$photos = $phpFlickrObj->people_getPublicPhotos($user['id'], NULL, NULL, 500);
foreach ($photos['photos']['photo'] as $photo)
{
  echo '<image imageURL="'.$phpFlickrObj->buildPhotoURL($photo, "large").'" thumbURL="'.$phpFlickrObj->buildPhotoURL($photo, "thumbnail").'" linkURL="" linkTarget=""></image>';
}
echo '<image imageURL="images/image.jpg" thumbURL="thumbs/thumb.jpg" linkURL="" linkTarget=""></image>';
echo'</simpleviewergallery>';
?>

Please note that your web server must have PHP installed and you must have a Flickr API key.
http://www.flickr.com/services/api/keys/apply/

Steven Speirs
SimpleViewer Support Team.