Hello. I have created a photo gallery that uses php to pull images from flickr. The gallery displays perfectly when live online, but the photos do not dipslay in WAMP, only small placeholders (see attached screen shot). I'm not sure if this has to do with the php coding or the WAMP settings. I would assume the latter, since it works when online, but I wanted to get your take on it. I would appreciate any help or suggestions. The code from the html page is below:
HTML Code:
<?php
// For paging the thumbnails, get the page we are on
// if there isn't one - we are on page 1
$page = isset($_GET['page']) ? $_GET['page'] : 1;
//include the core file
require_once('phpFlickr.php');
// include the config file
require_once('config.php');
// Fire up the phpFlickr class
$f = new phpFlickr($key);
// phpFlickr needs a cache folder
// in this case we have a writable folder on the root of our site, with permissions set to 777
$f->enableCache("fs", "cache");
//returns an array
$result = $f->people_findByUsername($username);
// grab our unique user id from the $result array
$nsid = $result["id"];
// Get the user's public photos and show 21 per page
//$page at the end specifies which page to start on, that's the page number ($page) that we got at the start
$photos = $f->people_getPublicPhotos($nsid, NULL, NULL, 21, $page);
// Some bits for paging
$pages = $photos['photos']['pages']; // returns total number of pages
$total = $photos['photos']['total']; // returns how many photos there are in total
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>phpFlickr Gallery Demo</title>
<link href="styles.css" rel="stylesheet" type="text/css">
<link href="gallery.css" rel="stylesheet" type="text/css">
<!-- Lightbox Code-->
<script type="text/javascript" src="lightbox2.05/js/prototype.js"></script>
<script type="text/javascript"
src="lightbox2.05/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="lightbox2.05/js/lightbox.js"></script>
<link rel="stylesheet" href="lightbox2.05/css/lightbox.css"
type="text/css" media="screen" />
<!-- End Lightbox Code -->
</head>
<body>
<div id="header">
<h1><a href="/">phpFlickr Gallery Demo</a></h1>
</div>
<!-- Photo Gallery -->
<div id="thumbs">
<div class="photosets">
<?php foreach ($photos['photos']['photo'] as $photo):
$d = $f->photos_getInfo($photo['id']); ?>
<div class="photos">
<a rel="lightbox[]"
href="<?= $f->buildPhotoURL($photo, 'medium') ?>"
title="<?= $d['photo']['description'] ?>">
<img src="<?= $f->buildPhotoURL($photo, 'square') ?>"
alt="<?= $photo['title'] ?>" title="<?= $photo['title'] ?>" />
</a>
</div>
<?php endforeach; ?>
</div>
<!-- end thumbs -->
<!-- Paging -->
<p id="nav">
<?php
// Some simple paging code to add Prev/Next to scroll through the thumbnails
$back = $page - 1;
$next = $page + 1;
if($page > 1) {
echo "<a href='?page=$back'>« <strong>Prev</strong></a>";
}
// if not last page
if($page != $pages) {
echo "<a href='?page=$next'><strong>Next</strong> »</a>";}
?>
</p>
<?php
// a quick bit of info about where we are in the gallery
echo"<p>Page $page of $pages</p>";
echo"<p class=\"note\">$total photos in the gallery</p>";
?>
<!-- End Paging -->
<div id="footer">
</div>
</body>
</html>
Bookmarks