From 9b5edd1d391a8ca6329984ce68655c442d465a0b Mon Sep 17 00:00:00 2001 From: thomppj Date: Fri, 6 Sep 2002 02:05:03 +0000 Subject: [PATCH 1/1] Added fortune plugin. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3581 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/fortune/INSTALL | 22 ++++++++++++ plugins/fortune/setup.php | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 plugins/fortune/INSTALL create mode 100644 plugins/fortune/setup.php diff --git a/plugins/fortune/INSTALL b/plugins/fortune/INSTALL new file mode 100644 index 00000000..3f158175 --- /dev/null +++ b/plugins/fortune/INSTALL @@ -0,0 +1,22 @@ +Installing Fortune Plugin +========================= +Simply untar the file in the plugins directory, and make sure it is +in its own directory, and that the name of the directory is the name +of the plugin. Example below uses "fortune" as the name of the +directory: + + $ cd plugins + $ tar -zxvf /usr/archives/fortune_plugin.tar.gz + +You may have to edit plugins/fortune/setup.php and change the location +of fortune on your system. Simply modify the $fortune_location variable +This script was written on RedHat 6.2 as such fortune is expected in +/usr/games/fortune also if safe mode is enabled your going to have to +copy fortune into your safe_mode bin directory. + +Then go to your config directory and run conf.pl. Choose option +8 and add the plugin (+). Save and exit, then that should be all +if the plugin was made correctly. :) + + $ cd ../config + $ ./conf.pl diff --git a/plugins/fortune/setup.php b/plugins/fortune/setup.php new file mode 100644 index 00000000..4d99eb2a --- /dev/null +++ b/plugins/fortune/setup.php @@ -0,0 +1,74 @@ +
"; + echo '
'; + if (!$exist) { + echo "$fortune_location not found."; + } else { + echo '
Today's Fortune
';
+        system($fortune_location);
+    } 
+  
+    echo '
'; +} + +function fortune_load() { + global $username, $data_dir, $fortune_visible; + + $fortune_visible = getPref($data_dir, $username, 'fortune_visible'); +} + +function fortune_options() { + global $fortune_visible; + + echo 'Fortunes:\n'; + echo ' Show fortunes at top of mailbox\n"; +} + +function fortune_save() { + global $username,$data_dir; + global $fortune_fortune_visible; + + if (isset($fortune_fortune_visible)) { + setPref($data_dir, $username, 'fortune_visible', '1'); + } else { + setPref($data_dir, $username, 'fortune_visible', ''); + } +} + +?> -- 2.25.1