squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fortune_functions.php
Go to the documentation of this file.
1 <?php
23 function fortune_show() {
24 
25  global $color;
26 
27  $fortune_location = '/usr/bin/fortune';
28  $exist = is_executable($fortune_location);
29 
30  if (!$exist) {
31  $sMsg = sprintf(_("%s is not found."),$fortune_location);
32  } else {
33  $sMsg = htmlspecialchars(shell_exec($fortune_location . ' -s'));
34  }
35 
36 
37  echo "<center><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"$color[10]\">\n".
38  "<tr><td><table width=\"100%\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\" bgcolor=\"$color[5]\">\n".
39  "<tr><td align=\"center\">\n";
40  echo '<table><tr><td>';
41  echo '<center><em>' . _("Today's Fortune") . '</em></center><br /><pre>' .
42  $sMsg .
43  '</pre>';
44 
45  echo '</td></tr></table></td></tr></table></td></tr></table></center>';
46 }
47 
48 
54 
55  global $optpage_data, $username, $data_dir, $fortune_visible;
56  $fortune_visible = getPref($data_dir, $username, 'fortune_visible');
57 
58  $optgrp = _("Fortunes");
59  $optvals = array();
60 
61  $optvals[] = array(
62  'name' => 'fortune_visible',
63  'caption' => _("Show fortunes at top of mailbox"),
64  'type' => SMOPT_TYPE_BOOLEAN,
65  'refresh' => SMOPT_REFRESH_NONE
66  );
67 
68  $optpage_data['grps']['fortune'] = $optgrp;
69  $optpage_data['vals']['fortune'] = $optvals;
70 }
71 
getPref
getPref($data_dir, $username, $string, $default='')
Definition: db_prefs.php:316
fortune_show_options
fortune_show_options()
Definition: fortune_functions.php:53
fortune_show
fortune_show()
Definition: fortune_functions.php:23
$data_dir
$data_dir
Definition: config_default.php:499
sprintf
powered by Systran sprintf(_("Number of supported language pairs: %s"), '36').' '
Definition: options.php:107
$username
global $username
Definition: validate.php:55
_
_($str)
Definition: gettext.php:160
SMOPT_REFRESH_NONE
const SMOPT_REFRESH_NONE
Definition: options.php:44
$color
$color
Definition: load_prefs.php:28
SMOPT_TYPE_BOOLEAN
const SMOPT_TYPE_BOOLEAN
Definition: options.php:25