$f = new phpFlickr($apiKey); $page = $_GET['page']; if ($page == null) { $page = 'home'; } $setId = $_GET['setId']; if ($page == "blog") { $setId = $blog; } if ($page == "about") { $setId = $about; } $collections = $f->collections_getTree($collectionId, $user); if ($setId) { $photos = $f->photosets_getPhotos($setId); $info = $f->photosets_getInfo($setId); $title = $info['title']; $description = $info['description']; foreach ($photos['photoset']['photo'] as $photo) { $photoURL[] = "http://www.flickr.com/photos/" . $user . "/" . $photo['id']; $photoLink[] = $f->buildPhotoURL($photo, 'large'); $info = $f->photos_getInfo($photo['id']); $pTitle[] = $info['title']; $pDescription[] = $info['description']; } } foreach ($collections['collections']['collection'] as $collection) { if ($collection['id'] != $collectionId) { $workId[] = $collection['set'][0]['id']; $workTitle[] = $collection['title']; foreach ($collection['set'] as $set) {
<?php if (!isset($_GET['id'])) { header('Location:index.php'); } require_once "phpFlickr/phpFlickr.php"; $f = new phpFlickr("44449d9d74ed80abe095ab2a6f137dbe", "abde3a1309b8d8e1"); $photos = $f->photosets_getPhotos($_GET['id']); if (sizeof($photos['photoset']['photo']) <= 0) { header('Location:index.php'); } $p = $f->photosets_getInfo($photos['photoset']['id']); $set_title = $p['title']; include "header.php"; //include "sidebar.php"; ?> <div id="main_left"> <img src="<?php echo $f->buildPhotoURL($photos['photoset']['photo'][0], 'medium'); ?> " /> </div> <div id="main_right"> <ul id="gallery" class="gallery"> <?php $i = 0; foreach ((array) $photos['photoset']['photo'] as $photo) { //echo 'photo:'.$photo.'<hr />'; echo "<li><a href='" . $f->buildPhotoURL($photo, "medium") . "' title='" . $photo['title'] . "'>"; echo "<img alt='" . $photo['title'] . "' " . "src='" . $f->buildPhotoURL($photo, "square") . "' /></a></li>"; $i++;
if (!class_exists('phpFlickr')) { require_once fenchurch_flickr_library_path() . '/phpFlickr.php'; } if (module_exists('keys')) { $flickr_api_key = keys_get_key('flickr_theme_helper'); } $f = new phpFlickr($flickr_api_key, NULL, FALSE); if (module_exists('fenchurch')) { $f->enableCache('db', fenchurch_flickr_cache_db_url(), variable_get('fenchurch_flickr_cache_lifetime', 64000)); } if ($flickr_path[1] == 'photos' && is_numeric($flickr_path[3])) { $flickr_photo_info = $f->photos_getInfo($flickr_path[3]); $thumbnail_url = 'http://farm' . $flickr_photo_info['farm'] . '.static.flickr.com/' . $flickr_photo_info['server'] . '/' . $flickr_photo_info['id'] . '_' . $flickr_photo_info['secret'] . '_s.jpg'; } else { if ($flickr_path[1] == 'photos' && $flickr_path[3] == 'sets') { $flickr_photo_set_info = $f->photosets_getInfo($flickr_path[4]); $flickr_photo_info = $f->photos_getInfo($flickr_photo_set_info['primary']); $thumbnail_url = 'http://farm' . $flickr_photo_info['farm'] . '.static.flickr.com/' . $flickr_photo_info['server'] . '/' . $flickr_photo_info['id'] . '_' . $flickr_photo_info['secret'] . '_s.jpg'; } } } if ($thumbnail_url) { print '<div class="website-thumbnail">'; $thumbnail = theme('image', $thumbnail_url, $title, '', NULL, FALSE); $link_attributes = array(); $link_attributes['rel'] = $dead_link ? 'nofollow' : NULL; $link_attributes['html'] = TRUE; print l($thumbnail, check_url($node->field_url[0]['display_url']), $link_attributes); print '</div>'; } }