]> git.sur5r.net Git - bacula/docs/blob - docs/home-page/de/pages/news.php
2d1e39980306016ea32dbaca27e12573591ab1de
[bacula/docs] / docs / home-page / de / pages / news.php
1 <? require_once("inc/header.php"); ?>
2
3 <table width="100%">
4 <tr>
5         <td class="contentTopic">
6                 News
7         </td>
8 </tr>
9 </table>
10 <table width="90%" align="center">
11 <tr>
12         <td class="content">
13         <table class="news" style="width: 99%">
14 <?
15
16 $max_news = 5;
17 $news_counter = 0;
18
19 // read file into an array and revert that
20 // revert cause array_pop always gets the last element
21 //
22 //currently the english-version from above
23 $file = "news.txt";
24 $lines = array_reverse(file($file)) or
25         die("Kein Newsfile gefunden!");
26
27 // as long as there are lines ...
28 //
29 while(count($lines) > 0 && $news_counter < $max_news) {
30         // next line
31         $line = array_pop($lines);
32
33         // start of news
34         if(eregi("^[a-z0-9]+;;;", $line)) {
35                 // news header
36                 list($author,$date,$time) = explode(";;;",$line);
37
38                 // news subject
39                 $subject = array_pop($lines);
40                 printf('<tr><td class="newsHeader">%s</td></tr>', $subject);
41                 printf('<tr><td class="newsContent"><pre class="newsContent">');
42
43                 continue;
44         }
45
46         // end of news
47         if(eregi("^;;;", $line)) {
48                 printf('</pre></td></tr>');
49                 printf('<tr>');
50                 printf('<td class="newsFooter">%s - %s, %s</td>', $date, $time, $author);
51                 printf('</tr>');
52                 printf('<tr><td><img src="../images/spacer.gif" width="1px" height="15px"></td></tr>');
53                 $news_counter++;
54                 continue;
55         }
56
57         // news content
58         printf('%s', $line);
59 }
60 ?>
61         </table>
62         </td>
63 </tr>
64 </table>
65 <? require_once("inc/header.php"); ?>