topical media & game development

talk show tell print

mashup-flickr-07-Step-3-gallery-edit.php / php



  <?php 
  include (dirname(__FILE__) . '/../lib/gallery.php');
  gallery = new FlickrGallery();        
  gallery->authenticate("write");
  if (!gallery->checkAuthenticatedUser())
  {
    gallery->error("You do not have permission to edit these details");
  }
  ?>
  <!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>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/gallery.css" rel="stylesheet" type="text/css" />
    <title>Flickr Gallery</title>
  </head>
  <body>
  <?php 
    id = _REQUEST['id'];
    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 . '/';
      description = info['description'];
    }
  ?>
  <?php include ('header.php') ?>
  <?php include ('navigation.php') ?>
    <div class="photo-edit">
      <form action=<doEdit.php> method="post">
        <p class="photo-image"><a href="<?php echo photoPage ?>"><img src="<?php 
  echo img ?>" alt="<?php echo title ?>" title="<?php echo title ?>" /></a></p>
        <p class="photo-title-edit"><input name="title" type="text" id="title" 
  value="<?php echo title ?>" size="50" />
        <p class="photo-description-edit">
          <textarea name="description" cols="50" rows="6" wrap="VIRTUAL" 
  id="description"><?php echo description ?></textarea>
        </p>
        <p class="photo-description-edit">
          <input name="id" type="hidden" value="<?php echo id ?>" />
          <input type="submit" name="Submit" value="Submit Changes" />
          <input type="reset" name="Reset" value="Reset" />
        </p>
      </form>
    </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.