Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $data = file_get_contents("http://spasserbussen.dk/all.xml");
- $xml = new SimpleXMLElement($data);
- $games = $xml->games;
- if (!isset($_GET['game'])) {
- echo('<h1>Spil</h1>');
- foreach($games->game as $game) {
- $thumb = $game->images->thumb;
- $title = $game->title;
- $url = urlencode($title);
- echo <<< EOF
- <div class='game'>
- <a href='?game=$url'><img src='$thumb' /><br />
- <b>$title</b></a>
- </div>
- EOF;
- }
- } else {
- $title = urldecode($_GET['game']);
- $game = $games->xpath('game/title[text()="' . $title . '"]/..');
- $game = $game[0];
- $title = $game->title;
- $description = $game->description;
- $swf = $game->swf;
- $width = $game->width;
- $height = $game->height;
- echo <<< EOF
- <h1>$title</h1>
- <p>$description</p>
- <!--[if !IE]> -->
- <object type="application/x-shockwave-flash"
- data="$swf" width="$width" height="$height">
- <!-- <![endif]-->
- <!--[if IE]>
- <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
- codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
- width="$width" height="$height">
- <param name="movie" value="$swf" />
- <!--><!--dgx-->
- <param name="loop" value="true" />
- <param name="menu" value="false" />
- <p>This is <b>alternative</b> content.</p>
- </object>
- <!-- <![endif]-->
- EOF;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement