+#include <basic.style>
+#include "../index-tools.pl"
+
+<html>
+<head><title>Infodrom Oldenburg - News</title></head>
+
+<body-tag>
+
+<h1 align=center><font face="Helvetica,Arial">Infodrom Oldenburg</font><hr width=90% align=center></h1>
+
+<: main_menu (('Infodrom','Linux','Debian','Linx','Projects','News')); :>
+
+<font face="Helvetica,Arial">
+<?
+ $dbh = pg_pconnect ("kuolema", "5432", "web")
+ or die("Unable to connect to SQL server");
+
+ pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
+
+ if ($id > 0) {
+ $query = "SELECT * FROM news WHERE id = '$id'";
+ $sth = pg_exec ($dbh, $query);
+
+ if (pg_NumRows ($sth) > 0) {
+ $row = pg_fetch_array ($sth, 0);
+ if ($row['deleted'] == 0) {
+ $date = explode (" ", $row['releasedate']);
+ $date = explode ("-", $date[0]);
+ $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
+
+ printf ("<h3>%s</h3>", $row['subject']);
+ printf ("<h5>Von <a href=\"mailto:%s\">%s</a>, %s</h5>", $row['email'], $row['author'], $date);
+ printf ("<b>%s</b><p>", $row['teaser']);
+ echo ereg_replace ("<newline>", "
+", ereg_replace ("<newline><newline>","<p>", ereg_replace ("
+", "<newline>", $row['body'])));
+
+
+ }
+ }
+ echo "<p><a href=\"shownews.php3\">Ältere Nachrichten</a><p>";
+ } else {
+ $query = "SELECT id,subject,author,releasedate,teaser,body FROM news "
+ . "WHERE deleted = 0 AND releasedate < now() AND teaser <> '' "
+ . "ORDER BY releasedate DESC,insertd DESC";
+ $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
+
+ for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
+ $row = pg_fetch_array ($sth, $nr);
+ $date = explode (" ", $row['releasedate']);
+ $date = explode ("-", $date[0]);
+ $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]);
+ printf ("<b>%s</b><br>%s", $row['subject'], $row['teaser']);
+ if (strlen ($row['body']) > 0) {
+ printf (" <a href=\"shownews.php3?id=%d\"><phpmehr></a>", $row['id']);
+ }
+ printf ("<br>(<font size=\"-1\">%s, %s</font>)<p>", $row['author'], $date);
+
+ }
+ }
+?>
+</font>
+
+<page-footer>
+</body>
+</html>
+
+# Local variables:
+# mode: indented-text
+# mode: auto-fill
+# mode: iso-accents
+# end: