#include "stacheltermine.inc"
#include "years.inc"
+<?
+$datedb = "dates.txt";
+
+$dates = array();
+function readdb()
+{
+ global $datedb;
+ global $dates;
+
+ if (($db = fopen($datedb,'r')) !== false) {
+ $lines = array();
+ while (!feof($db)) {
+ $line = fgets($db, 200);
+
+ if (!preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})\|/", $line))
+ continue;
+
+ $dates[] = $line;
+ }
+ }
+}
+
+function display_dates()
+{
+ global $dates;
+
+ $layout_head = '<div style="padding-top: 10px;"></div>'
+ .'<table class="dates" width="100%%" border="0" cellpadding="0" cellspacing="0">'
+ .'<tr bgcolor="#aeaeae"><th align="left" colspan="2"><strong> %s</strong></th>'
+ .'<td align="left">Ort</td>'
+ .'<td align="center">Zeit</td>'
+ .'</tr>';
+ $layout_row = '<tr bgcolor=#%s>'
+ .'<td align=left width=20%%> %d. (%s)</td>'
+ .'<td align=left width=60%%>%s</td>'
+ .'<td align=left width=15%%>%s</td>'
+ .'<td align=right width=5%%>%s </td>'
+ .'</tr>';
+ $layout_foot = '</table>';
+
+ $nowstring = date("Y-m-");
+ $today = mktime(0,0,0, date('m'), date('d'), date('Y'));
+
+ sort($dates);
+ $cmon = false;
+ $color = 'ffffff';
+ foreach ($dates as $line) {
+ if ($line < $nowstring)
+ continue;
+
+ if (preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})\|([^\|]*)\|[^\|]*\|([^\|]*)\|([^\|]*)\|(.*)/", $line, $match)) {
+
+ $when = mktime(0,0,0, $match[2], $match[3], $match[1]);
+
+ if ($match[1] !== $thisyear || $match[2] !== $thismonth) {
+ if ($cmon)
+ echo $layout_foot;
+ $thisyear = $match[1];
+ $thismonth = $match[2];
+ printf($layout_head, strftime("%B %Y", $when));
+ $cmon = true;
+ }
+ if ($when == $today)
+ $color = 'ffff00';
+ printf($layout_row, $color, $match[3], strftime("%A", $when), $match[5], $match[6], $match[4]);
+ $color = $color == 'ffffff'?'d7d7d7':'ffffff';
+ }
+ }
+ if ($cmon)
+ echo $layout_foot;
+}
+
+setlocale(LC_TIME, "de_DE");
+readdb();
+?>
+
<page name=Termine>
-<p>Im folgenden finden Sie Termine von Veranstaltungen die sich mit
-Linux und Freier Software befassen und in der Region Weser-Ems
-stattfinden oder von generellem Interesse sind. Wenn keine Stadt
-angegeben ist, findet die Veranstaltung in Oldenburg statt.
-
-<:
- @termine = (
- # CCO: http://www.cco-ev.de/CMS/cms.cgi/kalender.py
- # LUG-HB: Treffen: Jeden 3. Sonntag im Monat
- # delta=16; for i in `seq 1 53`; do
- # delta=$[delta + 7]; date=`date -d now+${delta}days +%Y-%m-%d`
- # printf " '%s|19:00|Linux User Group Bremen|Bremen|http://lug-bremen.info/',\n" $date
- # done
- # LUG-WHV: In einer geraden Kalenderwoche Dienstag um 19:30 Uhr
- # delta=-16; for i in `seq 1 27`; do
- # date=`date -d now+${delta}days +%Y-%m-%d`; delta=$[delta + 14];
- # printf " '%s|19:30|Linux User Group Wilhelmshaven|W\\'haven|http://www.lug-whv.de/',\n" $date
- # done
- # LUG Oldenburger Land
- # Quartalsmitte am 2. Mittwoch des Monats (Februar, Mai, August, November)
- # http://www.ewetel.net/~carsten.westdoerp/lugoland/treffpunkt.html
-
-
- '2007-11-03|15:00|LUG Oldenburg Arbeitstreffen|Flair|http://lists.infodrom.org/linux-stammtisch/2007/0628.html',
- '2007-11-09|19:00|Oldenburger Linux-Stammtisch|Bei Beppo|http://oldenburg.linux.de/Infos/stammtisch.html',
- '2007-11-26|20:00|Oldenburger Linux-Stammtisch|Bei Beppo|http://oldenburg.linux.de/Infos/stammtisch.html',
- '2007-11-13|19:30|Linux User Group Wilhelmshaven|W\'haven|http://www.lug-whv.de/',
- '2007-11-27|19:30|Linux User Group Wilhelmshaven|W\'haven|http://www.lug-whv.de/',
- '2007-11-02|19:00|Linux Gruppe Ostfriesland|Hesel|http://linux.cco-ev.de/',
- '2007-11-16|19:00|Linux Gruppe Ostfriesland|Hesel|http://linux.cco-ev.de/',
- '2007-11-14|20:00|LUG Oldenburger Land|Sandkrug|http://www.lugoland.de/',
- '2007-11-18|19:00|Linux User Group Bremen|Bremen|http://lug-bremen.info/',
-
- '2007-12-07|19:00|Oldenburger Linux-Stammtisch|Bei Beppo|http://oldenburg.linux.de/Infos/stammtisch.html',
- '2007-12-17|20:00|Oldenburger Linux-Stammtisch|Bei Beppo|http://oldenburg.linux.de/Infos/stammtisch.html',
- '2007-12-11|19:30|Linux User Group Wilhelmshaven|W\'haven|http://www.lug-whv.de/',
- '2007-12-25|19:30|Linux User Group Wilhelmshaven|W\'haven|http://www.lug-whv.de/',
- '2007-12-07|19:00|Linux Gruppe Ostfriesland|Hesel|http://linux.cco-ev.de/',
- '2007-12-21|19:00|Linux Gruppe Ostfriesland|Hesel|http://linux.cco-ev.de/',
- '2007-12-16|19:00|Linux User Group Bremen|Bremen|http://lug-bremen.info/',
-
- );
-:>
-
-# Use this to export our meetings to the Oldenburger Stachel
-# <stachelexport>
+<h3>Veranstaltungen rund um GNU/Linux in der Region Weser-Ems</h3>
+
+<p>Hier finden Sie Termine von Veranstaltungen, die sich mit Linux,
+GNU/Linux und/oder Freier Software befassen und in der Region
+Weser-Ems stattfinden. Wenn keine Stadt angegeben ist, findet die
+Veranstaltung in Oldenburg statt.</p>
+
+<p>Sollte eine Veranstaltung fehlen, kontaktieren Sie bitte joey@infodrom.org.</p>
+
+<? display_dates() ?>
<build_tables>
<more_years>