Improved text
[infodrom.org/oldenburg.linux.de] / src / index.wml
1 #include <LUGO.style>
2 #include <tools.inc>
3
4 <?
5 $max_news = 2;
6 $max_age = 7;
7 $newsdir = "News";
8 $datedb = "Termine/dates.txt";
9 $max_days = 14;
10
11 function next_date()
12 {
13   global $max_days;
14   global $datedb;
15
16   $head = '<div class="news"><div class="newsbody"><h3 class="newstitle">%s</h3><div class="date">';
17   $head .= '<table class="font" cellpadding=1 cellspacing=2 width=100%%><tr><th>Wann</th><th>Was</th><th>Wo</th></tr>';
18   $foot = '</table></div></div></div>';
19   $row = '<tr%s><td>%s</td><td>%s</td><td>%s</td></tr>';
20   $pivot = time() + 60*60*24*$max_days;
21   $now = mktime(0,0,0, date('m'), date('d'), date('Y'));
22
23   if (($dates = fopen($datedb,'r')) !== false) {
24     $lines = array();
25     while (!feof($dates)) {
26       $line = fgets($dates, 200);
27
28       if (!preg_match("/\|OL\|/", $line))
29         continue;
30
31       if (preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})\|/", $line, $match)) {
32         $when = mktime(0,0,0, $match[2], $match[3], $match[1]);
33         if ($when > $pivot || $when < $now)
34           continue;
35         $lines[] = $line;
36       }
37     }
38
39     if (count($lines)) {
40       sort($lines);
41       echo '<div style="padding-top: 10px"></div>'."\n";
42       printf($head."\n", "Kommende Termine in Oldenburg");
43
44       foreach ($lines as $line) {
45         if (preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})\|([^\|]*)\|OL\|([^\|]*)\|([^\|]*)\|(.*)/", $line, $match)) {
46           $when = mktime(0,0,0, $match[2], $match[3], $match[1]);
47
48           if ($when == $now) {
49             $date = '<strong>heute, ' . $match[4].'</strong>';
50             $color = ' bgcolor="#ffff00"';
51           } else {
52             $date = strftime("%e.%m.%y", $when) . ', ' . $match[4];
53             $color = '';
54           }
55
56           if (empty($match[7]))
57             $what = $match[5];
58           else
59             $what = '<a href="'.$match[7].'">'.$match[5].'</a>';
60
61           printf($row, $color, $date, $what, $match[6]);
62         }
63       }
64       echo $foot;
65     }
66   }
67 }
68 function display_news($when, $file)
69 {
70   global $newsdir;
71
72   $head = '<div class="news"><div class="newsbody"><h3 class="newstitle">%s</h3><div class="newscontent">';
73   $foot = '</div></div></div>';
74
75   $date = strftime("%e. %B %Y", $when);
76
77   if (($news = fopen($newsdir.'/'.$file,'r')) !== false) {
78     $needp = 0;  // 0 = init, 1 = <p> need, 2 = no <p> needed
79
80     printf($head."\n", $date);
81     while (!feof($news)) {
82       $line = fgets($news, 200);
83
84       $line = str_replace ("\\\n", "", $line);
85
86       if ($needp == 0) {
87         if (substr($_, 0, 3) == "<p>") {
88           $needp = 2;
89         } else {
90           $needp = 1;
91           $line = '<p>'.$line;
92         }
93       }
94
95       echo $line;
96     }
97     if ($needp == 1)
98       echo '</p>';
99     echo $foot;
100   }
101 }
102
103 function newsbox()
104 {
105   global $max_news;
106   global $max_age;
107   global $newsdir;
108
109   setlocale(LC_TIME, "de_DE");
110
111   $pivot = time() - 60*60*24*$max_age;
112   $news = array();
113   if (is_dir($newsdir)) {
114     if ($dir = opendir($newsdir)) {
115       while (($file = readdir($dir)) !== false) {
116         if (!preg_match("/news-([0-9]{4})-([0-9]{2})-([0-9]{2})\.txt/", $file, $matches))
117           continue;
118         $when = mktime(0,0,0, $matches[2], $matches[3], $matches[1]);
119         if ($when < $pivot)
120           continue;
121         $news[$when] = $file;
122       }
123       closedir($dir);
124     }
125   }
126
127   if (count($news)) {
128     echo '<div style="padding-top: 10px"></div>'."\n";
129
130     krsort($news);
131
132     $cnt = 0;
133     foreach ($news as $time => $file) {
134       if ($cnt >= $max_news)
135         continue;
136       display_news($time, $file);
137       $cnt++;
138     }
139   }
140 }
141 ?>
142
143 <page>
144
145 <p>Die <em>Linux User Group Oldenburg</em> (LUGO) ist eine
146 Interessengemeinschaft für GNU/Linux und Freie Software in und um <a
147 href="http://www.oldenburg.de/">Oldenburg</a> in Niedersachsen.
148 Wir bieten bewußt kein Web-Forum für die Diskussion sondern laden
149 interessierte Anwender und Entwickler ein, an den regelmäßigen <a
150 href="<root_prefix>Infos/stammtisch.html">Oldenburger Stammtischen</a>
151 der Linux User Group Oldenburg teilzunehmen.</p>
152
153 <?next_date()?>
154
155 <p>Außerhalb dieser Treffen wird auf der <a
156 href="<root_prefix>Infos/liste.html">Mailing-Liste</a>
157 linux-stammtisch (<a href="<url ml-linux-stammtisch>">Archiv</a>) über
158 Freie Software und GNU/Linux diskutiert.  Aus der LUGO hervorgegangen
159 ist der gemeinnützige <a href="http://www.ffis.de/">Verein zur
160 Förderung Freier Informationen und Software e.V.</a> (ffis).  Auf den
161 folgenden Seiten finden Sie Informationen rund um Freie Software sowie
162 Veranstaltungen zu diesem Themenspektrum.</p>
163
164 <p>Linux ist der Kern eines freien Unix-artigen Betriebssystems für Rechner der Intel
165 x86er-Klasse ab 80386 sowie für viele weitere Prozessorarchitekturen
166 (u.a. Alpha,
167 Sun Sparc, PowerPC, HP PA-RISC, Motorola 680x0, IBM S/390, ARM, MIPS
168 etc.).  GNU/Linux ist das Betriebssystem auf Basis des Linux-Kernels, das echtes Multitasking und
169 vernünftige Unterstützung für Multiuser-Umgebungen bietet.  Durch
170 seine breite Hardwareunterst&uuml;tzung ist es f&uuml;r Privatanwender
171 genauso interessant, wie f&uuml;r den gewerblichen Einsatz.  <p>
172
173 <p>
174 <?newsbox()?>
175
176 </page>
177
178 # Local variables:
179 # mode: html
180 # mode: auto-fill
181 # mode: iso-accents
182 # end: