HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/mail/plugins/fortune/setup.php
<?php

/**
 * plugins/fortune/setup.php
 *
 * Original code contributed by [email protected]
 *
 * Simple SquirrelMail WebMail Plugin that displays the output of
 * fortune above the message listing.
 *
 * @copyright (c) 1999-2009 The SquirrelMail Project Team
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version $Id: setup.php 13549 2009-04-15 22:00:49Z jervfors $
 * @package plugins
 * @subpackage fortune
 *
 */

/**
 * Init plugin
 * @access private
 */
function squirrelmail_plugin_init_fortune() {
  global $squirrelmail_plugin_hooks;

  $squirrelmail_plugin_hooks['mailbox_index_before']['fortune'] = 'fortune';
  $squirrelmail_plugin_hooks['optpage_loadhook_display']['fortune'] = 'fortune_optpage_loadhook_display';
}

/**
 * Show fortune
 * @access private
 */
function fortune() {
    global $fortune_visible, $username, $data_dir;
    $fortune_visible = getPref($data_dir, $username, 'fortune_visible');

    // Don't show fortune if not enabled
    if (empty($fortune_visible)) {
        return;
    }

    include_once(SM_PATH . 'plugins/fortune/fortune_functions.php');
    fortune_show();
}

/**
 * Add fortune options
 * @access private
 */
function fortune_optpage_loadhook_display() {
    include_once(SM_PATH . 'plugins/fortune/fortune_functions.php');
    fortune_show_options();
}