Happy happy joy joy, www.infodrom.ffis.de is up!
[infodrom.org/www.infodrom.org] / Styles / quote.style
1 #use wml::std::box
2
3 # <quotebox [lang={deutsch|english}] [type={linux|infodrom|general}]>
4 #
5 <define-tag quotebox>
6   <preserve lang type btitle error fortune>
7   <set-var %attributes>
8   <if <not <get-var lang>>  <set-var lang=deutsch>>
9   <if <not <get-var type>>  <set-var type=general>>
10
11   <ifeq "<get-var lang>" "deutsch"  "<set-var btitle="Zitat des Tages">">
12   <ifeq "<get-var lang>" "english"  "<set-var btitle="Quote of the day">">
13
14   <ifeq "<get-var lang>" "deutsch"  "<set-var error="Leider heute kein Zitat.">">
15   <ifeq "<get-var lang>" "english"  "<set-var error="Sorry, no quote today.">">
16
17   <ifeq "<get-var type>" "infodrom"  "<set-var fortune="<root_prefix>fortune-infodrom.html">">
18   <ifeq "<get-var type>" "linux"     "<set-var fortune="<root_prefix>fortune-linux.html">">
19   <ifeq "<get-var type>" "general"   "<set-var fortune="<root_prefix>fortune-general.html">">
20
21   <center><box header="<font size=-1 face="Helvetica,Arial" color="#<box-fgcolor>"><b><get-var btitle></b></font>"
22         bdcolor="#<box-bdcolor>" bdwidth=2 bdspace=10
23         bgcolor="#<box-bgcolor>">
24     <font face="helvetica,arial" size=-1 color="#<box-fgcolor>">
25     <?
26       # FIXME: Was gibt fopen() zurück, wenn die Datei nicht geöffnet werden konnte?
27       if (is_file ("<get-var fortune>") && ($fortune = fopen ("<get-var fortune>", "r"))) {
28         while (!feof ($fortune)) {
29           $line = fgets ($fortune, 255);
30           echo $line;
31         }
32         fclose ($fortune);
33       } else {
34         echo "<get-var error>";
35       }
36     ?>
37     </font>
38   </box></center>
39   <restore lang type btitle error fortune>
40 </define-tag>
41
42
43
44
45
46
47 # -- [ Old ] -----------------------------------------------------------
48 #
49 # Quote of the day boxes
50 #
51 # quotebox-de-shtml
52 # quotebox-en-shtml
53 # quotebox-de-php
54 # quotebox-en-php
55 #
56
57 # FIXME: Schöner wäre es, wenn ich %0 == "" -> .fortune, sonst %0 abfragen könnte
58
59 <define-tag quotebox-de-shtml whitespace=delete>
60   <box header="<font size=-1 face="Helvetica,Arial" color="#<box-bdcolor>"><b>Zitat des Tages</b></font>"
61        bdcolor="#<box-bdcolor>" bdwidth=2 bdspace=10
62        bgcolor="#<box-bgcolor>"
63        width=500>
64     <font face="helvetica,arial" size=-1 color="#<box-fgcolor>">
65     <!--#include file="%0"-->
66     </font>
67   </box>
68 </define-tag>
69
70 <define-tag quotebox-en-shtml whitespace=delete>
71   <box header="<font size=-1 face="Helvetica,Arial" color="#<box-fgcolor>"><b>Quote of the day</b></font>"
72        bdcolor="#<box-bdcolor>" bdwidth=2 bdspace=10
73        bgcolor="#<box-bgcolor>">
74     <font face="helvetica,arial" size=-1 color="#<box-fgcolor>">
75     <!--#include file="%0"-->
76     </font>
77   </box>
78 </define-tag>
79
80 <define-tag quotebox-en-php whitespace=delete>
81   <box header="<font size=-1 face="Helvetica,Arial" color="#<box-fgcolor>"><b>Zitat des Tages</b></font>"
82        bdcolor="#<box-bdcolor>" bdwidth=2 bdspace=10
83        bgcolor="#<box-bgcolor>">
84     <font face="helvetica,arial" size=-1 color="#<box-fgcolor>">
85 <?
86   if ($fortune = fopen ("index-fortune.html", "r")) {
87     while (!feof ($fortune)) {
88       $line = fgets ($fortune, 255);
89       echo $line;
90     }
91     fclose ($fortune);
92   }
93 ?>
94     </font>
95   </box>
96 </define-tag>
97
98 <define-tag quotebox-en-php whitespace=delete>
99   <box header="<font size=-1 face="Helvetica,Arial" color="#<box-fgcolor>"><b>Quote of the day</b></font>"
100        bdcolor="#<box-bdcolor>" bdwidth=2 bdspace=10
101        bgcolor="#<box-bgcolor>">
102     <font face="helvetica,arial" size=-1 color="#<box-fgcolor>">
103 <?
104   if ($fortune = fopen ("index-fortune.html", "r")) {
105     while (!feof ($fortune)) {
106       $line = fgets ($fortune, 255);
107       echo $line;
108     }
109     fclose ($fortune);
110   }
111 ?>
112     </font>
113   </box>
114 </define-tag>
115
116 # Local variables:
117 # mode: text
118 # mode: auto-fill
119 # end: