]> git.sur5r.net Git - bacula/docs/blob - docs/home-page/en/pages/donations.php
f03c6ec4e1c88e102875cec2f461ca58ff08d043
[bacula/docs] / docs / home-page / en / pages / donations.php
1 <? require_once("inc/header.php"); ?>
2
3 <table width="100%">
4 <tr>
5         <td class="contentTopic">
6                 Donations Received
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 $file = "donations.txt";
23 $lines = array_reverse(file($file)) or
24         die("No newsfile!");
25
26 // as long as there are lines ...
27 //
28 while(count($lines) > 0 && $news_counter < $max_news) {
29         // next line
30         $line = array_pop($lines);
31
32         // start of news
33         if(eregi("^[a-z0-9]+;;;", $line)) {
34                 // news header
35                 list($author,$date,$time) = explode(";;;",$line);
36
37                 // news subject
38                 $subject = array_pop($lines);
39                 printf('<tr><td class="newsHeader">%s</td></tr>', $subject);
40                 printf('<tr><td class="newsContent"><pre class="newsContent">');
41
42                 continue;
43         }
44
45         // end of news
46         if(eregi("^;;;", $line)) {
47                 printf('</pre></td></tr>');
48                 printf('<tr>');
49                 printf('<td class="newsFooter">%s - %s, %s</td>', $date, $time, $author);
50                 printf('</tr>');
51                 printf('<tr><td><img src="/images/spacer.gif" width="1px" height="15px"></td></tr>');
52                 $news_counter++;
53                 continue;
54         }
55
56         // news content
57         printf('%s', $line);
58 }
59 ?>
60         </table>
61         </td>
62 </tr>
63 </table>
64 <? require_once("inc/header.php"); ?>