-function fortune() {
- global $fortune_visible, $color;
-
- if (!$fortune_visible) {
- return;
- }
-
- $fortune_location = '/usr/games/fortune';
- $exist = file_exists($fortune_location);
- echo "<center><table cellpadding=0 cellspacing=0 border=0 bgcolor=$color[10]><tr><td><table width=100% cellpadding=2 cellspacing=1 border=0 bgcolor=\"$color[5]\"><tr><td align=center>";
- echo '<TABLE><TR><TD>';
- if (!$exist) {
- echo "$fortune_location not found.";
- } else {
- echo "<CENTER><FONT=3><EM>Today's Fortune</EM><BR></FONT></CENTER><pre>";
- system($fortune_location);
- }
-
- echo '</pre></TD></TR></TABLE></td></tr></table></td></tr></table></center>';
+ $squirrelmail_plugin_hooks['template_construct_message_list.tpl']['fortune'] = 'fortune';
+ $squirrelmail_plugin_hooks['loading_prefs']['fortune'] = 'fortune_load';
+ $squirrelmail_plugin_hooks['optpage_loadhook_display']['fortune'] = 'fortune_options';