Das PHP Script für die Seite

Hier das Ergebniss - Skipmans Media
Zurück.


Werde später ein paar Erklärungen dazu Schreiben ;-)


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Skipmans Dvds and BlueRays.....</title>
</head>
<body bgcolor="#101020">
<?php

header("Content-Type: text/html; charset=utf-8");
$xmlFile = 'plexall.xml';

if (file_exists($xmlFile)) {
    $xml = simplexml_load_file($xmlFile);
	
echo "<table frame='void' width='80%' align='center' border='25' cellspacing='0' cellpadding='2'>". "\n";
echo "<tr bgcolor='#ffffcc'>". "\n";
echo "<td bgcolor='#ffffcc' align='left' valign='top' colspan='3'>". "\n";
echo "<h3>Skipman's DVD / BlueRay Collection - Insgesammt ". $xml['size'] . " Filme.</h3>". "\n";
echo "</td>" . "\n";
echo "</tr>". "\n";
echo "<td bgcolor='#000000' colspan='3'>" . "\n";
echo "<hr color='#6E6E6E'>" . "\n";
echo "</td>" . "\n";
echo "</tr>" . "\n";


    foreach ( $xml->Video as $data )  
		{  
			$ID=$data['ratingKey'];
			$originalTitle=$data['originalTitle'];
			$title=$data['title'];
			$tagline=$data['tagline'];
			$year=$data['year'];
			$rating=$data['rating'];
			$content=$data['contentRating'];
			$summary=$data['summary'];
			$size = $data->Media->Part['size'];
			$sizegb = $size / 1073741824;
			$sizeread = $sizegb = number_format($sizegb, 2, '.', '');
			$duration = $data->Media->Part['duration'];
			$min = floor($duration / 60000); # Millisekunden in Minuten
			$std = floor($min / 60); # Stunden abgerundet
			$min = $min - $std * 60; # Rest Minuten
		

echo "<tr bgcolor='#ffffcc'>". "\n";
echo "<td bgcolor='#ffffcc' align='left' valign='top' colspan='3'>". "\n";
echo "<h3>" . $title . " - " . $tagline . "</h3>"."\n";
echo "</td>" . "\n";
echo "</tr>". "\n";
echo "<td bgcolor='#ffffcc' style='padding:1px' valign='center' rowspan='2'>". "\n";
echo "<img width='150' src='/posters/". $ID.".jpg'>". "\n";
echo "</td>". "\n";
echo "<td bgcolor='#ffffcc' align='left' valign='top'>". "\n";
echo "<span style='font-size:95%'><b>Orginal Title - " . $originalTitle . "</b></span><br>". "\n";

			foreach($data->Director as $director)
			{
				echo "<span style='font-size:95%'><b>Director - ". $director['tag'] . "</b></span><br>". "\n";
			}

echo "<span style='font-size:80%'>&nbsp;</span><br>". "\n";
echo "<span style='font-size:80%'><b>Rating - ". $rating . "</b></span><br>". "\n";
echo "<span style='font-size:80%'><b>Film L&auml;nge - "  . $std . ':' . $min . " Stunden / Minuten</b></span><br>". "\n";
echo "<span style='font-size:80%'><b>File Größe - &nbsp;&nbsp;" . $sizeread . "&nbsp;GB</span></b>";
echo "</td>". "\n";
echo "<td bgcolor='#ffffcc' width='350' align='left' valign='top'>". "\n";
echo "<span style='font-size:95%'><b>Actors -</b></span><br>". "\n";
echo "<span style='font-size:40%'>&nbsp;</span><br>". "\n";

			foreach($data->Role as $Actor)
			{
				echo "<span style='font-size:80%'><b> &nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" . $Actor['tag'] . "</b></span><br>". "\n";
			}
			
			
echo "</td>". "\n";
  
echo "</tr>". "\n";
echo "<tr>". "\n";
echo "<td bgcolor='#ffffcc' height='120' align='left' valign='top' colspan='2'>". "\n";
echo $summary . "\n";
echo "</td>" . "\n";
echo "</tr>" . "\n";
echo "<tr>" . "\n";
echo "<td bgcolor='#000000' colspan='3'>" . "\n";
echo "<hr color='#6E6E6E'>" . "\n";
echo "</td>" . "\n";
echo "</tr>" . "\n";

		}

} else {
    exit("Datei $xmlFile kann nicht geöffnet werden.");
}
?>
</table>
</body>
</html>