<?php
require_once('./flickr.php');
require_once('./techno.php');
$farm = $_GET['farm'];
$secret = $_GET['secret'];
$server = $_GET['server'];
$id = $_GET['id'];
$url = "http://farm$farm.static.flickr.com/$server/" . $id . "_$secret.jpg";
$obj = getTags(null,'php_serial',$id);
$tags = $obj['photo']['tags']['tag'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
  <head>
    <meta name="generator"
    content="HTML Tidy for Linux/x86 (vers 1st November 2002), see www.w3.org" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>Witryna mashup używajšca usług Google, Flickr i Technorati</title>
    <link rel="stylesheet" type="text/css" href="mashup3.css" title="not" />
  </head>
  <body>
    <div class="container">
      <div class="name">
        Zdjęcie:
      </div>
      <div class="content">
        <div id="innerphoto">
          <img id="image" src="<?php echo $url; ?>" alt="pokaz slajdów" />
          <div id="required">
          </div>
        </div>
      </div>
      <div class="name" id="flickrtab">
        Oznaczenia z witryny Flickr:
      </div>
      <div class="content" id="flickrtags">
        <div id="innertags">
          <ul>
            <?php
            foreach ($tags as $tag) {
               if ($tag['machine_tag'] != 1)
                  echo '<li>' . $tag['raw'] . '</li>';
            }
            ?>
          </ul>
        </div>
      </div>
      <div id="techpostname" class="name">
        Wpisy z witryny Technorati:
      </div>
      <div class="content" id="techposts">
        <div id="techpostcontent">
          <?php
          foreach ($tags as $tag) {
             if ($tag['machine_tag'] != 1) {
                echo '<p><b>' . $tag['raw'] . '</b></p>';
                echo '<ul>';
                $xmlstr = getTechnorati($tag['raw']);
                $xml = new SimpleXMLElement($xmlstr);
                foreach ($xml->document->item as $item) {
                   echo '<li><a href="' . $item->permalink . '">' . $item->title . '</a></li>';
                }
                echo '</ul>';
             }
          }
          ?>
        </div>
      </div>
    </div>
  </body>
</html>

