<?php
Header("Content-Type: application/xml;");
require_once("HTML/Template/IT.php");
include('admin/da.php');
$data = getLast(10);
   $tpl = new HTML_Template_IT(".");
   $tpl->loadTemplatefile("rss.tpl");
   $tpl->setVariable("pubDate",date("r",$data[0]["datum"]));
foreach($data as $key => $row)
   $tpl->setCurrentBlock("item");
   $tpl->setVariable("datum",date("r",$row["datum"]));
   $tpl->setVariable("titel",$row["titel"]);
   $tpl->setVariable("link","http://www.disc.be/nieuws.php?id=$key");
   $tpl->setVariable("bericht",htmlentities($row["tekst"]));
   $extra="";
   if($row["image"]!="" && $row["size"]!=0)
      $extra .= "<enclosure url=\"http://www.disc.be/dbpics/" . $row["image"] ."\" length=\"" . $row["size"] . "\" type=\"image/jpeg\" />";
   
  if($row["bijlage"]!="" )
    $beschrijving="";
    if($row["weergave"]=="")
      $beschrijving = "bijlage";
    else
      $beschrijving =$row["weergave"];
    
      $extra .= "<disc:bijlage>http://www.disc.be/dbbijlagen/" . $row["bijlage"] ."</disc:bijlage>";
      $extra .= "<disc:beschrijving>" . $beschrijving ."</disc:beschrijving>";
   
   $tpl->setVariable("extra",$extra);
   $tpl->parseCurrentBlock("item");


$tpl->show();
?>

