コード例 #1
0
<body>

<?php 
require_once 'flickr_API.php';
$key = '596dcd0930202d1c338ebb17261fae8c';
$Flickr = new FlickrAPI($key);
// get photo ID
$id = isset($_GET['photoid']) ? $_GET['photoid'] : NULL;
$query = isset($_GET['query']) ? $_GET['query'] : NULL;
$page = isset($_GET['page']) ? $_GET['page'] : NULL;
// get photo's information details
$photo = $Flickr->getInfo($id, $secret = NULL);
$photo = $photo['photo'];
//print_r($photo);
//get photo context info
$context = $Flickr->getContext($id);
//print_r($context);
$prev_photo = $context['prevphoto'];
$prev_photo_id = $prev_photo['id'];
$next_photo = $context['nextphoto'];
$next_photo_id = $next_photo['id'];
$photoUrl = $Flickr->getPhotoURL($photo, $size = "large");
//print_r($photoUrl);
echo "<div class='photo_content'>";
echo "<img src='{$photoUrl}' alt=" . $photo["title"]["_content"] . " />";
echo "<p>Title: " . $photo["title"]["_content"] . "</p>";
echo "<p>Description: " . $photo["description"]["_content"] . "</p>";
echo "<p>User: "******"owner"]["username"] . "</p>";
echo "<p>Location: " . $photo["owner"]["location"] . "</p>";
echo "<br>";
echo "<div class='pagination_footer'><div>";