1 #include <infodrom.style>
4 #include <phptools.inc>
6 <page title="Infodrom Linx">
9 <h3>Most recent entries</h3>
13 $dbh = pg_pconnect ("<dbhost>", "<dbport>", "<dbname>")
14 or die("Unable to connect to SQL server");
16 # pg_exec ($dbh, "SET DateStyle = 'ISO'"); // ignore or die("Datenbank-Abfrage!");
18 $query = "SELECT url,subject,category,changed FROM links ORDER BY changed DESC,category,subject";
19 $sth = pg_exec ($dbh, $query);
21 $tables = browser_with_tables();
23 if (pg_NumRows ($sth) > 0) {
25 echo ("<div align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"75%\" summary=\"\">");
27 for ($nr=0; ($nr < pg_NumRows ($sth)) && ($nr < <recent>); $nr++) {
28 $row = pg_fetch_array ($sth, $nr);
30 if ($category != $row['category']) {
35 printf ("<b><a href=\"lookup.php3?category=%s\">%s</a></b><br><ul>", $row['category'], $row['category']);
37 printf ("<tr><td bgcolor=\"#<linxcolh>\"><a href=\"lookup.php3?category=%s\">"
38 ."<font face=\"Helvetica,Arial\">%s</font></a></td></tr>",
39 $row['category'], $row['category']);
41 $category = $row['category'];
44 printf ("<li><a href=\"%s\">%s</a></li>", $row['url'], $row['subject']);
46 printf ("<tr><td bgcolor=\"#<linxcold>\"><a href=\"%s\">"
47 ."<font face=\"Helvetica,Arial\">%s</font></a></td></tr>",
48 $row['url'], $row['subject']);
54 echo ("</table></div>");