

"); echo ("

"); echo ("

"); printf (" %s

", date("D, d M Y H:i:s T")); ?> Logbook of Joey Schulze Logbook of Joey Schulze http://www.infodrom.org/~joey/log/ joey@infodrom.org Infodrom for ($nr=0; $nr < pg_NumRows ($sth); $nr++) { $row = pg_fetch_array ($sth, $nr); $body = str_replace(array('','&',"\\

","\r"), array('<', '>', '&', '', ''), $row['body']); $date = explode (" ", $row['created']); $time = explode (":", $date[1]); $tz = substr($time[2], 2); if (strlen ($tz) == 3) { $tz .= "00"; } else { $tz = date ("T", mktime ($time[0], $time[1], $time[2], $date[1], $date[2], $date[0])); } $date = explode ("-", $date[0]); $date = date ("D, d M Y H:i:s ", mktime ($time[0], $time[1], $time[2], $date[1], $date[2], $date[0])) . $tz; echo ("

"); printf (" %s

", $row['teaser']); printf (" http://www.infodrom.org/~joey/log/?%s

", $row['id']); printf (" %s

", $date); printf (" %s

", $row['category']); printf (" %s

", $body); echo ("

"); } echo ("





"); exit; } ?>

Joey's Logbook

%s ", $title); echo (" "); $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['created']); $time = explode (":", $date[1]); $date = explode ("-", $date[0]); $date = sprintf ("%d.%d.%d", $date[2], $date[1], $date[0]); printf (" %s %s ", $date, $row['id'], $row['teaser']); } echo (" "); echo (" "); printf ("", $title); echo ("

%s ", $row['id'], $row['teaser']); printf (" %s ", str_replace ("\\

", "", str_replace ("\r", "", $row['body']))); echo ("

"); echo (" "); printf ("", $row['id'], $row['teaser']); printf ("", str_replace ("\\

", "", str_replace ("\r", "", $row['body']))); echo ("

"); echo ("

$dbh = pg_pconnect ("", "", "web") or die("Unable to connect to SQL server"); pg_exec ($dbh, "SET DateStyle='ISO'") or die("Datenbank-Abfrage!"); if (strlen ($_SERVER[QUERY_STRING])> 0 && ($_SERVER[QUERY_STRING] == "all" || strlen($_SERVER[QUERY_STRING]) == 4)) { if ($_SERVER[QUERY_STRING] == "all") { $query = "SELECT id,teaser,created FROM logbook " . "WHERE public = 1 AND category <> 'absurd' " . "ORDER BY created DESC"; $title = "Index of all Logbook Entries"; } else { $this_year = (int)$_SERVER[QUERY_STRING]; $next_year = $this_year + 1; $query = sprintf ("SELECT id,teaser,created FROM logbook " ."WHERE public=1 AND category <> 'absurd' " ."AND created>= '%d-01-01' AND created < '%d-01-01' ORDER BY created ASC", $this_year, $next_year); $title = sprintf ("Index of Logbook Entries from %d", $this_year); } echo (""); } else { if (strlen ($_SERVER[QUERY_STRING])> 0) { $query = sprintf ("SELECT * FROM logbook " ."WHERE public = 1 AND category <> 'absurd' AND id='%s'", addslashes ($_SERVER[QUERY_STRING])); } else { $query = "SELECT * FROM logbook WHERE public=1 AND category <> 'absurd' " . "ORDER BY created DESC LIMIT 5"; } $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['created']); $time = explode (":", $date[1]); $date = explode ("-", $date[0]); $date = sprintf ("%d.%d.%d %02d:%02d", $date[2], $date[1], $date[0], $time[0], $time[1]); echo (""); } } ?>