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