<li> <strong><a href="<root_prefix>search.html">Search</a></strong><br>
</ul>
-<quotebox lang=english type=general><p>
+<div class="fortune">
+<div class="fortune-body">
+<h3 class="fortune-title">Quote of the Day</h3>
+<div class="fortune-content" id="fortune">
+<?
+ function format_cookie ($cookie, $bg)
+ {
+ $fsource = "<div class=\"fortune-attribution\"><span style=\"display: none;\">-- </span>%s</div>";
+ $attribution = 0;
+ $result = '<div class="fortune_'.$bg.'">';
+ $firstchar = substr ($cookie[0], 0, 1);
+ if ( ($firstchar == "<")
+ || ($firstchar == ">")
+ || ($firstchar == "*")
+ || ($firstchar == " ")
+ || ($firstchar == "[") ) {
+ $pre = 1;
+ $result .= "<pre class=\"smallfont\">\n";
+ } else {
+ $result .= "<p>\n";
+ }
+
+ for ($i=0; $i < count ($cookie); $i++) {
+ $line = $cookie[$i];
+ $line = ereg_replace ("<", "<", $line);
+ $line = ereg_replace (">", ">", $line);
+
+ if (ereg ("^ ?-- ", $line)) {
+ $line = ereg_replace ("^ ?-- ", "", rtrim($line));
+ if ($pre) {
+ $pre = 0;
+ $result .= "</pre>\n";
+ } else {
+ $result .= "</p>\n";
+ }
+ $result .= sprintf ($fsource, $line);
+ $attribution = 1;
+ } else {
+ if (!$pre && substr($line, 0, 1) == ' ')
+ $result .= "<br>";
+ $result .= $line;
+ }
+ }
+ if (!$attribution) {
+ if ($pre) {
+ $pre = 0;
+ $result .= "</pre>\n";
+ } else {
+ $result .= "</p>\n";
+ }
+ }
+ $result .= "</div>\n";
+ return $result;
+ }
+
+ if (is_file ("../www.infodrom.org/fortune-general-en.html")) {
+ $fortune = fopen ("../www.infodrom.org/fortune-general-en.html", "r");
+ }
+ if ($fortune) {
+ $cookie = array ();
+ while (!feof ($fortune)) {
+ $line = fgets ($fortune, 255);
+ $cookie[] = $line;
+ }
+ fclose ($fortune);
+ echo format_cookie ($cookie, 0);
+ } else {
+ echo "<p>No fortune today.</p>";
+ }
+?>
+</div>
+</div>
+</div>
</page>