\n". "\n". "
\n"; echo '
'; /* open handle and get all command output*/ $handle = popen($fortune_command,'r'); $fortune = ''; while ($read = fread($handle,1024)) { $fortune .= $read; } /* if pclose return != 0, popen command failed. Yes, I know that it is broken when --enable-sigchild is used */ if (pclose($handle)) { // %s shows executed fortune cookie command. $fortune = sprintf(_("Unable to execute \"%s\"."),$fortune_command); } echo "
" . _("Today's Fortune") . "
\n" .
            htmlspecialchars($fortune) .
            "
\n"; echo '
'; } /** * Add fortune options * @access private * @since 1.5.1 */ function fortune_function_options() { global $optpage_data; $optpage_data['grps']['fortune'] = _("Fortunes:"); $optionValues = array(); $optionValues[] = array('name' => 'fortune_visible', 'caption' => _("Show fortunes at top of mailbox"), 'type' => SMOPT_TYPE_BOOLEAN, 'initial_value' => false ); $optpage_data['vals']['fortune'] = $optionValues; } /** * Get fortune prefs * @access private * @since 1.5.1 */ function fortune_function_load() { global $username, $data_dir, $fortune_visible; $fortune_visible = getPref($data_dir, $username, 'fortune_visible'); }