xml = "\n".''."\n";
$this->xml .= " \n x-log\n http://waterwave.ch/weblog\n";
$this->xml .= " Mein persönlicher Weblog\n";
$this->xml .= " Andreas Jaggi aka X-Way\n ";
/* Datenbankabfrage -> Datum des letzen Eintrags */
$sqlab = "select dayofmonth(w.datum) AS tag, month(w.datum) AS monat, ";
$sqlab .= "year(w.datum) AS jahr, w.stunde, w.minute from weblog as w ";
$sqlab .= "order by w.datum desc, w.stunde desc, w.minute desc limit 1;";
$res = mysql_query($sqlab);
$row = mysql_fetch_array($res);
$year = $row["jahr"];
$month = $row["monat"];
$day = $row["tag"];
$hour = $row["stunde"];
$minute = $row["minute"];
/* Rest des Heads erzeugen */
$this->xml .= date ("l, j. F Y g:i:s", mktime($hour, $minute, 23, $month, $day, $year))." CEST";
$this->xml .= "\n http://backend.userland.com/rss092\n";
$this->xml .= " de\n x-way@waterwave.ch (X-Way)\n";
$this->xml .= " x-way@waterwave.ch (X-Way)\n";
/* Datenbankabfrage -> Auswahl der letzten 9 Einträge */
$sqlab = "select w.titel, w.text, w.id, k.name as kat, k.id as kid";
$sqlab .= " from weblog as w, kategorien as k where w.kategorie = ";
$sqlab .= "k.id order by w.datum desc, w.stunde desc, w.minute desc";
$sqlab .= " limit 9;";
$res = mysql_query($sqlab);
/* Auslesen und Anfügen der letzen 9 Einträge */
while($row = mysql_fetch_array($res)){
$this->xml .= " - \n ".$row["titel"]."\n";
$this->xml .= " ".$row["text"]."\n";
$this->xml .= " http://waterwave.ch/weblog/detail.php?id=";
$this->xml .= $row["id"]."\n ";
$this->xml .= "xml .= $row["kid"]."\">".$row["kat"]."\n
\n";
}
/* Link des Archivs anfügen */
$this->xml .= " - \n Archiv\n http://waterwave.ch/weblog/archiv.php\n";
$this->xml .= "
\n \n";
/*
und in
und umwandeln (XML-kompatibel) */
$this->xml = preg_replace ('=<(img|br)([^>]*?)>=i', '<\\1\\2 />', $this->xml);
/* rss.xml schreiben */
$fp = fopen($fn, 'w');
fwrite($fp, $this->xml);
fclose($fp);
}
}
?>