Convert fra php til XML
Denne side vil jeg gerne have til at lavet om til en XML filden skal virke på samme måde:
http://diskotekglobe.dk/hp/1/event/
Her kan siden ses i php:
<body style="background-color: transparent;">
<link rel="stylesheet" href="css.css" type="text/css">
<?php
extract($_GET);
$type = ( !empty( $_GET['type'] ) ? basename( $_GET['type'] ) : '' );
?>
<center>
<?php
$fundet = false;
$fd = fopen ("../edit/Tekst.txt", "r");
while (!feof ($fd))
{
$buffer = fgets($fd, 4096);
if (strstr($buffer,$type)===false&&(!$fundet))
{
}
else
{
if (strstr($buffer,':')===false&&$buffer!='')
$tekstderskalbruges[] = $buffer;
if (!$fundet)
$fundet=true;
else if (strstr($buffer,':'))
$fundet=false;
}
}
fclose ($fd);
$images = array();
$dates = array();
$names = array();
foreach (glob(getcwd() . "/../edit/1/" . $type . "{*.jpg,*.JPG,*.jpeg,*.JPEG}", GLOB_BRACE) as $image)
{
$filename = basename($image);
if(preg_match('/(.+?)-(.+?)-(\\d{2})_(\\d{2})_(\\d{2})\\.jpe?g/', $filename, $match))
{
$images[] = array('date' => mktime(0, 0, 0, $match[4], $match[3], '20'.$match[5]),'name' => $match[1], 'title' => $match[2], 'file' => $filename);
}
}
foreach ($images as $key => $image)
{
$dates[$key] = $image['date'];
$names[$key] = $image['name'];
}
array_multisort($dates, SORT_ASC, $names, SORT_ASC, $images);
echo '<fieldset style="padding-center: 80px;"><legend><b class="fontTitel">';
echo '<center>';
echo 'Event kalender';
echo '</center>';
echo '</legend>';
foreach ($images as $image)
{
if($image['date'] >= time())
{
echo '<table>';
echo '<tr><td>';
echo '<font size="1"><div align="right">';
echo date("d/m",$image['date']);
echo '</div></td><td>';
echo '<font size="2"><div align="right">';
echo " <a href=\"http://www.diskotekglobe.dk/hp/1/index.php?type=" . $image['name'] . "\" target=\"_blank\" alt=\"" . $image['title'] . "\">" . $image['title'] ."</a></div></font>";
echo '</td><td>';
echo '</table>';
}
}
echo '</fieldset></center>';
echo $tekstderskalbruges[1];
echo '<br>';
echo '<img src=\hp/1/edit/banner/banner.jpg>';
?>
</center>