Replacing deprecated HTML "center" element (second try).
[squirrelmail.git] / plugins / fortune / functions.php
index ec8f4fe9fc277f38e916207c3dfaca7b6c2d90a5..d62dd88511ddf261ee8005347929e4fcbc9f3519 100644 (file)
@@ -1,8 +1,9 @@
 <?php
+
 /**
  * Fortune plugin functions
  *
- * @copyright (c) 2004-2005 The SquirrelMail Project Team
+ * @copyright &copy; 2004-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -48,19 +49,19 @@ function fortune_function() {
         $fortune_command=$fortune_location;
     }
 
-    echo "<center><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"$color[10]\">\n".
+    echo "<div style=\"text-align: center;\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"$color[10]\">\n".
         "<tr><td><table width=\"100%\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\" bgcolor=\"$color[5]\">\n".
         "<tr><td align=\"center\">\n";
     echo '<table><tr><td>';
     if (!$exist) {
         printf(_("%s is not found."),$fortune_location);
     } else {
-        echo "<center><em>" . _("Today's Fortune") . "</em></center><pre>\n";
-        htmlspecialchars(system($fortune_command));
-        echo "</pre>\n";
+        echo "<div style=\"text-align: center;\"><em>" . _("Today's Fortune") . "</em></div><pre>\n" .
+            htmlspecialchars(shell_exec($fortune_command)) .
+            "</pre>\n";
     }
 
-    echo '</td></tr></table></td></tr></table></td></tr></table></center>';
+    echo '</td></tr></table></td></tr></table></td></tr></table></div>';
 }
 
 /**