topical media & game development

talk show tell print

mashup-flickr-complete-gallery-photo.php / php



  <?php include (dirname(__FILE__) . '/../lib/gallery.php') ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Flickr Gallery</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/gallery.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../lib/js/prototype.js"></script>
    <script type="text/javascript" src="../lib/js/gallery.js"></script>
  </head>
  <body>
  <?php 
    gallery = new FlickrGallery();
    id = _REQUEST['id'];
    key = _REQUEST['key'];
    if (!empty(id))
    {
      info = gallery->getPhotoInfo(id);
      title = info['title'];
      img = 'http://static.flickr.com/' . info['server'] . '/' . info['id'] 
        . '_' . info['secret'] . '.jpg';
      photoPage = 'http://www.flickr.com/photos/' . info['owner']['nsid'] . '/' 
        . id . '/';
  
      photo = gallery->getPhoto(id);
      prev = gallery->getPreviousPhoto(photo, key);
      next = gallery->getNextPhoto(photo, key);
  }
  ?>
  <?php include ('header.php') ?>
  <?php include ('navigation.php') ?>
    <div class="photo-display">
      <p class="photo-title"><?php echo title ?></p>
      <p class="photo-image"><a href="<?php echo photoPage ?>"><img src="<?php echo img ?>" alt="<?php echo title ?>" title="<?php echo title ?>" /></a></p>
      <div class="photo-nav">
        <div class="photo-nav-prev">
        <?php 
        if  (empty(prev))
        { 
        ?>&nbsp;<?php 
        } 
        else 
        { 
      ?><a href="photo.php?id=<?php echo prev['id'] ?>&key=<?php echo key ?>">&lt; Previous</a><?php       } 
        ?>
        </div>
        <div class="photo-nav-next">
        <?php 
        if  (empty(next)) 
        { 
        ?>&nbsp;<?php 
        } 
        else 
        { 
      ?><a href="photo.php?id=<?php echo next['id'] ?>&key=<?php echo key ?>">Next &gt;</a><?php       } 
        ?>
        </div>
      </div>
      <div id="photo-info-<?php echo id ?>" class="photo-more"><a href="#" onclick="displayInfo(<?php echo id ?>); return false;">More info...</a></div>
    </div>
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.