function phorum_htmlpurifier_show_migrate_sigs_form()
{
    $frm = new PhorumInputForm('', "post", "Migrate");
    $frm->hidden("module", "modsettings");
    $frm->hidden("mod", "htmlpurifier");
    $frm->hidden("migrate-sigs", "1");
    $frm->addbreak("Migrate user signatures to HTML");
    $frm->addMessage('This operation will migrate your users signatures
        to HTML. <strong>This process is irreversible and must only be performed once.</strong>
        Type in yes in the confirmation field to migrate.');
    if (!file_exists(dirname(__FILE__) . '/../migrate.php')) {
        $frm->addMessage('Migration file does not exist, cannot migrate signatures.
            Please check <tt>migrate.bbcode.php</tt> on how to create an appropriate file.');
    } else {
        $frm->addrow('Confirm:', $frm->text_box("confirmation", ""));
    }
    $frm->show();
}
Пример #2
0
function phorum_htmlpurifier_show_form()
{
    if (phorum_htmlpurifier_config_file_exists()) {
        phorum_htmlpurifier_show_config_info();
        return;
    }
    global $PHORUM;
    $config = phorum_htmlpurifier_get_config();
    $frm = new PhorumInputForm("", "post", "Save");
    $frm->hidden("module", "modsettings");
    $frm->hidden("mod", "htmlpurifier");
    // this is the directory name that the Settings file lives in
    if (!empty($error)) {
        echo "{$error}<br />";
    }
    $frm->addbreak("Edit settings for the HTML Purifier module");
    $frm->addMessage('<p>Click on directive links to read what each option does
    (links do not open in new windows).</p>
    <p>For more flexibility (for instance, you want to edit the full
    range of configuration directives), you can create a <tt>config.php</tt>
    file in your <tt>mods/htmlpurifier/</tt> directory. Doing so will,
    however, make the web configuration interface unavailable.</p>');
    require_once 'HTMLPurifier/Printer/ConfigForm.php';
    $htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s');
    $htmlpurifier_form->setTextareaDimensions(23, 7);
    // widen a little, since we have space
    $frm->addMessage($htmlpurifier_form->render($config, $PHORUM['mod_htmlpurifier']['directives'], false));
    $frm->addMessage("<strong>Warning: Changing HTML Purifier's configuration will invalidate\r\n      the cache. Expect to see a flurry of database activity after you change\r\n      any of these settings.</strong>");
    $frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false));
    // hack to include extra styling
    echo '<style type="text/css">' . $htmlpurifier_form->getCSS() . '
    .hp-config {margin-left:auto;margin-right:auto;}
    </style>';
    $js = $htmlpurifier_form->getJavaScript();
    echo '<script type="text/javascript">' . "<!--\n{$js}\n//-->" . '</script>';
    $frm->show();
}
Пример #3
0
//   along with this program.                                                 //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_ADMIN")) {
    return;
}
include_once "./include/format_functions.php";
include_once "./include/api/file_storage.php";
// Execute file purging for real?
if (count($_POST)) {
    $deleted = phorum_api_file_purge_stale(TRUE);
    phorum_admin_okmsg("Purged " . count($deleted) . " files");
}
// Retrieve a list of stale files.
$purge_files = phorum_api_file_purge_stale(FALSE);
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", count($purge_files) ? "Purge stale files now" : "Refresh screen");
$frm->hidden("module", "file_purge");
$frm->addbreak("Purging stale files...");
$frm->addmessage("It's possible that there are files stored in the Phorum system,\n         which no longer are linked to anything. For example, if users\n         write messages with attachments, but do not post them in the end,\n         the attachment files will be left behind in the database.\n         Using this maintenance tool, you can purge those stale files\n         from the system.");
$prev_reason = '';
if (count($purge_files)) {
    $frm->addbreak("There are currently " . count($purge_files) . " stale files in the database");
    foreach ($purge_files as $id => $file) {
        if ($file['reason'] != $prev_reason) {
            $prev_reason = $file['reason'];
            $frm->addsubbreak("Reason: " . $file['reason']);
        }
        $frm->addrow(htmlspecialchars($file["filename"]), phorum_filesize($file["filesize"]));
    }
} else {
    $frm->addmessage("There are currently no stale files in the database");
Пример #4
0
<?php

if (!defined("PHORUM_ADMIN")) {
    return;
}
// Apply default settings.
require_once './mods/editor_tools/defaults.php';
// Save the settings to the database.
if (count($_POST)) {
    $PHORUM["mod_editor_tools"] = array("enable_help" => $_POST["enable_help"] ? 1 : 0);
    $PHORUM['DB']->update_settings(array("mod_editor_tools" => $PHORUM["mod_editor_tools"]));
    phorum_admin_okmsg("The settings were successfully saved.");
}
// Build the settings form.
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "editor_tools");
$frm->addbreak("Edit settings for the Editor Tools module");
$row = $frm->addrow("Enable Help tool", $frm->checkbox("enable_help", "1", "", $PHORUM["mod_editor_tools"]["enable_help"]) . ' Yes');
$frm->addhelp($row, "Enable Help tool", "If you enable this option, then a help button will be added to\n     the tool bar. This help button can be used to open help pages\n     that are registered by other modules (e.g. to show a list of\n     smileys or available BBcode tags).");
$frm->show();
Пример #5
0
    $settings["min_length"] = (int) $_POST["min_length"];
    $settings["only_lowercase"] = isset($_POST["only_lowercase"]) ? 1 : 0;
    // Valid chars is a bit special.
    $settings["valid_chars"] = isset($_POST["valid_chars"]) ? implode("", array_keys($_POST["valid_chars"])) : "";
    // Take care of applying sane settings.
    if ($settings["min_length"] < 0) {
        $settings["min_length"] = 0;
    }
    if ($settings["max_length"] < $settings["min_length"] && $settings["max_length"] != 0) {
        $settings["max_length"] = $settings["min_length"];
    }
    // Save settings array.
    $PHORUM["mod_username_restrictions"] = $settings;
    phorum_db_update_settings(array("mod_username_restrictions" => $settings));
    phorum_admin_okmsg("The module settings were successfully saved.");
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "username_restrictions");
$frm->addbreak("Edit settings for the username restrictions module");
$frm->addrow("Minimum username length (0 = no restriction)", $frm->text_box('min_length', $PHORUM["mod_username_restrictions"]["min_length"], 6));
$frm->addrow("Maximum username length (0 = no restriction)", $frm->text_box('max_length', $PHORUM["mod_username_restrictions"]["max_length"], 6));
$checkboxes = '';
foreach ($valid_chars_options as $k => $v) {
    $enabled = strpos($PHORUM["mod_username_restrictions"]["valid_chars"], $k) === FALSE ? 0 : 1;
    $checkboxes .= $frm->checkbox("valid_chars[{$k}]", "1", "", $enabled) . " {$v}<br/>";
}
$frm->addrow("Valid username characters (check none for no restrictions)", $checkboxes);
$frm->addrow("Allow only lower case characters", $frm->checkbox("only_lowercase", "1", "", $PHORUM["mod_username_restrictions"]["only_lowercase"]) . ' Yes');
$frm->show();
Пример #6
0
}
// ----------------------------------------------------------------------
// Display status information about possible module problems
// ----------------------------------------------------------------------
// Show module problems to the admin.
if (count($list['problems'])) {
    foreach ($list['problems'] as $problem) {
        phorum_admin_error($problem);
    }
}
// ----------------------------------------------------------------------
// Build the form
// ----------------------------------------------------------------------
// Just used for building form elements.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "");
$frm_url = phorum_admin_build_url();
$html = "<form id=\"modules_form\" " . "action=\"{$frm_url}\" method=\"post\">" . "<input type=\"hidden\" name=\"phorum_admin_token\"\n                value=\"{$PHORUM['admin_token']}\" />" . "<input style=\"display:none\" type=\"submit\" " . "value=\"catch [enter] key\" onclick=\"return false\"/>" . "<input type=\"hidden\" name=\"module\" value=\"mods\" />" . "<input type=\"hidden\" name=\"do_module_updates\" value=\"1\" />" . "<div class=\"PhorumAdminTitle\">Phorum module settings</div>" . "<div class=\"modules_filter\">" . "<strong>Filter:</strong> " . "show " . $frm->select_tag('filter_status', array(0 => 'all', 1 => 'enabled', 2 => 'disabled'), isset($_POST['filter_status']) ? $_POST['filter_status'] : 0, 'onchange="filter_modules(this.form)"') . " modules, matching " . $frm->text_box('filter_text', isset($_POST['filter_text']) ? $_POST['filter_text'] : '', 30, NULL, FALSE, 'onkeyup="filter_modules(this.form)" id="filter_text"') . $frm->checkbox('hide_description', 1, 'hide descriptions', isset($_POST['hide_description']) ? 1 : 0, 'style="margin-left:1em" ' . 'onchange="filter_modules(this.form)" ' . 'id="hide_descriptions"') . "</div>";
foreach ($list['modules'] as $name => $info) {
    // Disable a module if it's enabled, but should be disabled based
    // on the Phorum version.
    if ($info['version_disabled'] && $info['enabled']) {
        phorum_admin_error("Minimum Phorum-Version requirement not met for " . "module \"" . htmlspecialchars($name) . "\"<br/>" . "It requires at least version " . "\"" . htmlspecialchars($info['required_version']) . "\", " . "but the current version is \"" . PHORUM . "\".<br />" . "The module was disabled to avoid malfunction of " . "your Phorum because of that requirement.<br/>");
        phorum_api_modules_disable($name);
        phorum_api_modules_save();
        $info['version_disabled'] = TRUE;
    }
    $id = base64_encode("mods_{$name}");
    $title = $info["title"];
    if (isset($info["version"])) {
        $title .= " (version " . $info["version"] . ")";
Пример #7
0
            foreach ($usergroups as $group_id => $group) {
                $group_perm = $group['user_status'];
                $group_info = phorum_db_get_groups($group_id);
                $frm->hidden("groups[{$group_id}]", "{$group_id}");
                $frm->addrow($group_info[$group_id]["name"], $frm->select_tag("group_perm[{$group_id}]", $group_options, $group_perm, $extra_opts));
            }
        }
        $frm->show();
    } else {
        echo "User Not Found.";
    }
    //display add user form
} elseif (isset($_REQUEST["add"]) || isset($addUser_error)) {
    $username = isset($user_data["username"]) ? $user_data["username"] : "";
    $real_name = isset($user_data["real_name"]) ? $user_data["real_name"] : "";
    $email = isset($user_data["email"]) ? $user_data["email"] : "";
    $admin = isset($user_data["admin"]) ? $user_data["admin"] : "";
    print "<a href=\"" . htmlspecialchars($referrer) . "\">Back to the user overview</a><br/>";
    $frm = new PhorumInputForm("", "post", "Add User");
    $frm->hidden("module", "users");
    $frm->hidden("referrer", $referrer);
    $frm->hidden("addUser", 1);
    $frm->addbreak("Add User");
    $frm->addrow("User Name", $frm->text_box("username", $username, 50));
    $frm->addrow("Real Name", $frm->text_box("real_name", $real_name, 50));
    $frm->addrow("Email", $frm->text_box("email", $email, 50));
    $frm->addrow("Password", $frm->text_box("password1", "", 0, 0, true));
    $frm->addrow("Password (Confirmation)", $frm->text_box("password2", "", 0, 0, true));
    $frm->addrow("Administrator", $frm->select_tag("admin", array("No", "Yes"), $admin));
    $frm->show();
}
Пример #8
0
            $value = (int) $_POST['enabled'][$tagname];
            $PHORUM['mod_bbcode']['enabled'][$tagname] = $value;
            if ($value == 2) {
                $nr_of_enabled_tags++;
            }
        }
    }
    // Store the new settings array.
    $PHORUM['DB']->update_settings(array('mod_bbcode' => $PHORUM['mod_bbcode']));
    phorum_admin_okmsg("The settings were successfully saved.");
    if ($nr_of_enabled_tags > 0 && empty($PHORUM['mods']['editor_tools'])) {
        phorum_admin_error("<b>Notice:</b> You have configured one or more BBcode tags to add a button to the editor tool bar. However, you have not enabled the Editor Tools module. If you want to use the tool buttons, then remember to activate the Editor Tools module.");
    }
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "bbcode");
$frm->addbreak("General settings for the BBcode module");
$row = $frm->addrow("Open links in new window", $frm->checkbox("links_in_new_window", "1", "Yes", $PHORUM["mod_bbcode"]["links_in_new_window"]));
$frm->addhelp($row, "Open links in new window", "When users post links on your forum, you can choose whether to open these in a new window or not.");
$row = $frm->addrow("Turn bare URLs into clickable links", $frm->checkbox("process_bare_urls", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_urls"]));
$frm->addhelp($row, "Turn bare URLs into clickable links", "If you enable this option, then the BBcode module will try to detect bare URLs in the message (URLs that are not surrounded by [url]...[/url] BBcode tags) and turn those into clickable links (as if they were surrounded by [url]...[/url]).");
$row = $frm->addrow("Turn bare email addresses into clickable links", $frm->checkbox("process_bare_email", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_email"]));
$frm->addhelp($row, "Turn bare email addresses into clickable links", "If you enable this option, then the BBcode module will try to detect bare email addresses in the message (addresses that are not surrounded by [email]...[/email] BBcode tags) and turn those into clickable links (as if they were surrounded by [email]...[/email]).");
$row = $frm->addrow("Show full URLs", $frm->checkbox("show_full_urls", "1", "Yes", $PHORUM["mod_bbcode"]["show_full_urls"]));
$frm->addhelp($row, "Show full URLs", "By default, URLs are truncated by phorum to show only [www.example.com]. This is done to prevent very long URLs from cluttering and distrurbing the web site layout. By enabling this feature, you can suppress the truncation, so full URLs are shown.");
$row = $frm->addrow("Add 'rel=nofollow' to links that are posted in your forum", $frm->checkbox("rel_no_follow", "1", "Yes", $PHORUM["mod_bbcode"]["rel_no_follow"]));
$frm->addhelp($row, "Add 'rel=nofollow' to links", 'You can enable Google\'s rel="nofollow" tag for links that are posted in your forums. This tag is used to discourage spamming links to web sites in forums (which can be done to influence search engines by implying that the site is a popular one, because of all the links).<br/><br/>Note that this does not stop spam links from being posted, but it does mean that spammers do not get any credit from Google for that link.');
$row = $frm->addrow("Enable BBcode quoting using the [quote] tag", $frm->checkbox("quote_hook", "1", "Yes", $PHORUM["mod_bbcode"]["quote_hook"]));
$frm->addhelp($row, "Enable BBcode [quote]", "If this feature is enabled, then quoting of messages is not done using the standard Phorum method (which resembles email message quoting), but using the BBcode module's quoting method instead. This means that the quoted text is placed within a [quote Author]...[/quote] bbcode block.<br/><br/>Two of the advantages of using this quote method is that the quoted message can be styles though CSS code and that no word wrapping is applied to the text.");
Пример #9
0
}
// Keep the current page within bounds.
if ($page <= 0) {
    $page = 1;
}
if ($page > $pages) {
    $page = $pages;
}
$filter_base .= '&page=' . $page;
// Retrieve event logs for the active page.
$logs = event_logging_getlogs($page, $pagelength, $filter);
// ----------------------------------------------------------------------
// Display header form for paging and filtering.
// ----------------------------------------------------------------------
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", $filter_mode ? "Apply filter" : "Refresh page");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "event_logging");
$frm->hidden("curpage", $page);
$frm->hidden("el_action", $filter_mode ? "filter" : "logviewer");
$frm->addrow("<span style=\"float:right;margin-right:10px\">" . $frm->select_tag("pagelength", $pagelengths, $pagelength, 'onchange="this.form.submit()"') . "&nbsp;&nbsp;&nbsp\n         <input type=\"submit\" name=\"prevpage\" value=\"&lt;&lt;\"/>\n         page " . $frm->select_tag("page", $pagelist, $page, 'onchange="this.form.submit()"') . " of {$pages}\n         <input type=\"submit\" name=\"nextpage\" value=\"&gt;&gt;\"/>\n     </span>Number of entries: {$logcount}");
if ($filter_mode) {
    $frm->hidden("filter_mode", 1);
    $loglevel_checkboxes = '';
    foreach ($strings["LOGLEVELS"] as $l => $s) {
        $loglevel_checkboxes .= '<span style="white-space: nowrap">' . $frm->checkbox("show_loglevel[{$l}]", "1", "", isset($show_loglevel[$l]) ? 1 : 0, "id=\"llcb_{$l}\"") . ' <label for="llcb_' . $l . '"><img align="absmiddle" src="' . $PHORUM["http_path"] . '/mods/event_logging/images/loglevels/' . $l . '.png"/> ' . $s . '</label></span> ';
    }
    $row = $frm->addrow("Log levels to display", $loglevel_checkboxes);
    $frm->addhelp($row, "Log levels to display", "By using these checkboxes, you can limit the log levels that are displayed. If you do not check any of them, then no filtering will be applied and all log levels will be displayed.");
    $category_checkboxes = '';
    foreach ($strings["CATEGORIES"] as $l => $s) {
Пример #10
0
        $alt = "";
        $uses = 2;
    }
} else {
    $title = "Update a smiley";
    $submit = "Update smiley";
    // Fill initial form data for editing smileys.
    if (!isset($_POST["smiley_id"])) {
        $smileydata = $PHORUM["mod_smileys"]["smileys"][$smiley_id];
        $search = $smileydata["search"];
        $smiley = $smileydata["smiley"];
        $alt = $smileydata["alt"];
        $uses = $smileydata["uses"];
    }
}
$frm = new PhorumInputForm("", "post", $submit);
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "smileys");
$frm->hidden("smiley_id", $smiley_id);
$frm->hidden("action", "edit_smiley");
$frm->addbreak($title);
$frm->addrow("Smiley string to match", $frm->text_box("search", $search, 20));
$row = $frm->addrow("Image to replace the string with", $frm->select_tag("smiley", array_merge(array('' => 'Select smiley ...'), $available_smileys), $smiley, "onChange=\"change_image(this.options[this.selectedIndex].value);\"") . "&nbsp;&nbsp;<div style=\"display:none;margin-top:5px\" id=\"preview_div\"><strong>Preview: </strong><img src=\"images/trans.gif\" id=\"preview_image\" /></div>");
$frm->addhelp($row, "Smiley replacement image", "The drop down list shows all images that were found in your\n     smiley prefix path. If you want to add your own smileys, simply place\n     them in \"" . htmlspecialchars($PHORUM["mod_smileys"]["prefix"]) . "\"\n     and reload this page.");
$frm->addrow("ALT attribute for the image", $frm->text_box("alt", $alt, 40));
$frm->addrow("Used for", $frm->select_tag("uses", $PHORUM_MOD_SMILEY_USES, $uses));
$frm->show();
// Make the preview image visible in case a $smiley is set.
if (!empty($smiley)) {
    ?>
    <script type="text/javascript">
Пример #11
0
        if(!$ret){
            $error="No messages deleted.<br />";
        } else {
            echo "$ret Messages deleted.<br />";
        }
    }

    if($error){
        phorum_admin_error($error);
    }

    include_once "./include/admin/PhorumInputForm.php";
        

    $frm = new PhorumInputForm ("", "post", "Delete messages");

    $frm->hidden("module", "message_prune");

    $frm->addbreak("Pruning old threads ...");
    $frm->addmessage("ATTENTION!<br />This script deletes quickly A LOT of messages. Use it on your own risk.<br />There is no further confirmation message after sending this form!");

    $frm->addrow("older than (days from today)",$frm->text_box("days", "365", 10));
    $frm->addrow("in Forum", $frm->select_tag("forumid", $forum_list,0));
    $frm->addrow("Check for", $frm->select_tag("mode", array(1=>"When the thread was started",2=>"When the last answer to the thread was posted"),0));    

    $frm->show();


?>
Пример #12
0
function phorum_generate_language_file($lang, $displayname, $generate_new)
{
    global $fullfile;
    $basename = preg_replace('/-.*$/', '', $lang);
    $fullfile = $basename . '-' . PHORUM . '.php';
    // Get our default language file.
    $DEFAULT = phorum_get_language(PHORUM_DEFAULT_LANGUAGE);
    // Get the languagefile to update, unless generating a new language.
    $CURRENT = array();
    if (!$generate_new) {
        $CURRENT = phorum_get_language($lang);
    } else {
        $CURRENT['STORE']['language_hide'] = 0;
        $CURRENT['STORE']['language'] = urlencode("'" . addslashes($displayname) . "'");
    }
    // Keep a copy of the languagefile.
    $CURRENT_COPY = $CURRENT;
    // Collect all language strings from the distribution files.
    $language_strings = phorum_extract_language_strings();
    $frm = new PhorumInputForm("", "post", "Download new " . htmlspecialchars($fullfile) . " language file");
    $frm->hidden("module", "manage_languages");
    $frm->hidden("action", "download_lang");
    $frm->hidden("filename", $lang);
    if (!$generate_new) {
        $frm->addmessage("<h2>Update language: " . htmlspecialchars($displayname) . "</h2>" . "Below you will see all the things that have been updated " . "to get to the new version of the language file. At the " . "bottom of the page you will find a download button to download " . "the updated language file. This language file has to be placed " . "in <b>include/lang/" . htmlspecialchars($lang) . ".php</b> to make it " . "available to Phorum (backup your old file first of course!). " . "If new language strings have been added, " . "they will be marked with '***' in the language file, so it's " . "easy for you to find them.");
        $frm->addbreak("Updates for the new language file");
    } else {
        $frm->addmessage("<h2>Generate new language: " . htmlspecialchars($displayname) . "</h2>" . "A new language file has been generated. Below you will find " . "a download button to download the new file. In this file, you " . "can replace all language strings by strings which apply to " . "\"" . htmlspecialchars($displayname) . "\". After updating the new " . "file, you will have to place it in " . "<b>include/lang/" . htmlspecialchars($basename) . ".php</b>, " . "so Phorum can use it (backup your old file first of course!).");
    }
    $notifies = 0;
    // Check for language strings that are missing.
    $missing = array();
    $count_missing = 0;
    foreach ($language_strings as $string => $data) {
        // This one is special.
        if ($string == 'TIME') {
            continue;
        }
        // Multi-dimentional string? That must be a module lang string
        // (cut at PHORUM->LANG->myarray-|>word).
        if (preg_match('/-$/', $string)) {
            continue;
        }
        if (!isset($CURRENT["DATA"]["LANG"][$string])) {
            array_push($missing, $string);
            $translation = urlencode("'" . addslashes($string) . "'");
            if (isset($DEFAULT["DATA"]["LANG"][$string])) {
                $translation = $DEFAULT["DATA"]["LANG"][$string];
            }
            $CURRENT_COPY["DATA"]["LANG"][$string] = urlencode("'***'. " . urldecode($translation));
            $count_missing++;
            if (!$generate_new) {
                $frm->addrow("MISSING ({$count_missing})", $string);
                $notifies++;
            }
        } else {
            unset($CURRENT["DATA"]["LANG"][$string]);
        }
    }
    // Check for language strings that are deprecated.
    $deprecated = array();
    $count_deprecated = 0;
    if (!$generate_new) {
        foreach ($CURRENT["DATA"]["LANG"] as $string => $translation) {
            if ($string == 'TIME') {
                continue;
            }
            // This one is special.
            $count_deprecated++;
            $deprecated[$string] = true;
            // Only notify the deprecation if not already in deprecated state.
            if (!isset($CURRENT['STORE']['DEPRECATED'][$string])) {
                $frm->addrow("DEPRECATED ({$count_deprecated})", htmlspecialchars($string));
                $notifies++;
            }
        }
    }
    $CURRENT_COPY['STORE']['DEPRECATED'] = $deprecated;
    // Restore our full current language data from the copy.
    $CURRENT = $CURRENT_COPY;
    // Copy values from our default language to the current language.
    $copyfields = array('long_date', 'long_date_time', 'short_date', 'short_date_time', 'locale', 'thous_sep', 'dec_sep');
    foreach ($copyfields as $f) {
        if (!isset($CURRENT[$f])) {
            $CURRENT[$f] = $DEFAULT[$f];
            if (!$generate_new) {
                $frm->addrow("MISSING VARIABLE", "{$f} set to default " . htmlspecialchars(urldecode($DEFAULT[$f])));
                $notifies++;
            }
        }
    }
    // Copy default values beneath DATA to the current language.
    $datafields = array('CHARSET', 'HCHARSET', 'MAILENCODING', 'LANG_META');
    foreach ($datafields as $f) {
        if (!isset($CURRENT['DATA'][$f]) || $CURRENT['DATA'][$f] == '') {
            $CURRENT['DATA'][$f] = $DEFAULT['DATA'][$f];
            if (!$generate_new) {
                $frm->addrow("MISSING VARIABLE", "DATA->{$f} set to default " . htmlspecialchars(urldecode($DEFAULT['DATA'][$f])));
                $notifies++;
            }
        }
    }
    // Copy default values for timezone information to the current language.
    foreach ($DEFAULT['DATA']['LANG']['TIME'] as $key => $val) {
        if (!isset($CURRENT['DATA']['LANG']['TIME'][$key])) {
            $CURRENT['DATA']['LANG']['TIME'][$key] = $val;
            if (!$generate_new) {
                $dflt = htmlspecialchars(urldecode($DEFAULT['DATA']['LANG']['TIME'][$key]));
                $frm->addrow("MISSING TZINFO", "TZ {$key} set to default<br/>{$dflt}");
                $notifies++;
            }
        }
    }
    if ($generate_new) {
        $frm->addrow("COMPLETED", "A new language file has been generated for you");
    } elseif (!$notifies) {
        $frm->addrow("NONE", "There were no updates for the current \"{$lang}\" language file");
    }
    $frm->show();
    phorum_write_language_file($lang, $CURRENT);
}
Пример #13
0
                <input type="hidden" name="curr" value="<?php 
    echo htmlspecialchars($_GET['curr']);
    ?>
" />
                <input type="hidden" name="delete" value="1" />
                <input type="submit" name="confirm" value="Yes" />&nbsp;<input type="submit" name="confirm" value="No" />
            </form>
        </div>

        <?php 
} else {
    // load bad-words-list
    $banlists = phorum_db_get_banlists();
    $bad_words = $banlists[PHORUM_BAD_WORDS];
    include_once "./include/admin/PhorumInputForm.php";
    $frm = new PhorumInputForm("", "post", $submit);
    $frm->hidden("module", "badwords");
    $frm->hidden("curr", "{$curr}");
    $row = $frm->addbreak($title);
    if ($curr == 'NEW') {
        $frm->addmessage("This feature can be used to mask bad words in forum messages\n             with \"" . PHORUM_BADWORD_REPLACE . "\". All bad words will\n             automatically be replaced by that string. If you want to use\n             a different string (e.g. \"CENSORED\" or \"*****\"), then you\n             can change the definition of the constant\n             \"PHORUM_BADWORD_REPLACE\" in the Phorum file\n             include/constants.php.");
    }
    $row = $frm->addrow("Bad Word", $frm->text_box("string", $string, 50));
    $frm->addhelp($row, "Bad Word", "The word that you want to mask in forum messages.\n             Rules that apply to the matching are:\n             <ul>\n               <li><b>Only the full word</b> is matched, so \"foo\" would\n                   not mask (part of) \"foobar\";</li>\n               <li>The match is <b>case insensitive</b>, so \"foo\" would also\n                   mask \"FoO\".</li>\n             </ul>");
    $frm->addrow("Valid for Forum", $frm->select_tag("forum_id", $forum_list, $forum_id));
    $row = $frm->addrow('Comments', $frm->textarea('comments', $comments, 50, 7));
    $frm->addhelp($row, "Comments", "This field can be used to add some comments to the ban (why you\n             created it, when you did this, when the ban can be deleted, etc.)\n             These comments will only be shown on this page and are meant as\n             a means for the administrator to do some bookkeeping.");
    $frm->show();
    echo "<hr class=\"PhorumAdminHR\" />";
    if (count($bad_words)) {
        echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
Пример #14
0
<?php

if (!defined("PHORUM_ADMIN")) {
    return;
}
require_once 'defaults.php';
// save settings
if (count($_POST)) {
    $PHORUM['mod_sphinx_search'] = array('hostname' => $_POST['hostname'], 'port' => $_POST['port']);
    if (!phorum_db_update_settings(array('mod_sphinx_search' => $PHORUM['mod_sphinx_search']))) {
        phorum_admin_error("Updating the settings in the database failed.");
    } else {
        phorum_admin_okmsg("Settings updated");
    }
}
?>
<div style="font-size: xx-large; font-weight: bold">Sphinx Search Module</div>
 This module uses the sphinx fulltext search engine to gather the results of the phorum-search.<br />
 On this page you can set the hostname and port of your sphinx search daemon.

<br style="clear:both" />
<?php 
include_once PHORUM_INCLUDES_DIR . '/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "sphinx_search");
$frm->addbreak("Hostname and port");
$row = $frm->addrow("What is the hostname of the sphinx daemon? (e.g. 127.0.0.1){$warn}", $frm->text_box("hostname", $PHORUM["mod_sphinx_search"]["hostname"], 30));
$row = $frm->addrow("What is the port of the sphinx daemon? (e.g. 9312){$warn}", $frm->text_box("port", $PHORUM["mod_sphinx_search"]["port"], 30));
$frm->show();
Пример #15
0
    if (isset($_POST['vroot_forum_id']) && is_array($_POST['vroot_forum_id'])) {
        foreach ($_POST['vroot_forum_id'] as $vroot_id => $vroot_forum_id) {
            $PHORUM["mod_announcements"]["vroot"][$vroot_id] = (int) $vroot_forum_id;
        }
    }
    $PHORUM["mod_announcements"]["forum_id"] = (int) $_POST["forum_id"];
    $PHORUM["mod_announcements"]["pages"] = $_POST["pages"];
    $PHORUM["mod_announcements"]["disable_autodisplay"] = isset($_POST["disable_autodisplay"]) ? 1 : 0;
    $PHORUM["mod_announcements"]["only_show_unread"] = isset($_POST["only_show_unread"]) ? 1 : 0;
    $PHORUM["mod_announcements"]["number_to_show"] = (int) $_POST["number_to_show"];
    $PHORUM["mod_announcements"]["days_to_show"] = (int) $_POST["days_to_show"];
    phorum_db_update_settings(array("mod_announcements" => $PHORUM["mod_announcements"]));
    phorum_admin_okmsg("Announcement settings updated");
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "announcements");
$frm->addbreak("Announcement Settings");
$page_list = $frm->checkbox("pages[home]", 1, "Home page, root level forum list (index.php)", $PHORUM["mod_announcements"]["pages"]["home"]) . "<br/>" . $frm->checkbox("pages[index]", 1, "Any forum List (index.php)", $PHORUM["mod_announcements"]["pages"]["index"]) . "<br/>" . $frm->checkbox("pages[list]", 1, "Message List (list.php)", $PHORUM["mod_announcements"]["pages"]["list"]) . "<br/>" . $frm->checkbox("pages[read]", 1, "Read Message (read.php)", $PHORUM["mod_announcements"]["pages"]["read"]);
$frm->addrow("Announcements Appear On", $page_list);
$row = $frm->addrow("Disable automatic displaying of announcements?", $frm->checkbox("disable_autodisplay", 1, "Disable automatic displaying", $PHORUM["mod_announcements"]["disable_autodisplay"]));
$frm->addhelp($row, "Disable automatic displaying", "By default, the announcements will be displayed after the page header automatically. If you need more control over the exact placement, then enable this option. Then you can specify where you want the announcements to appear yourself by placing the code {MOD_ANNOUNCEMENTS} in your templates.");
$frm->addrow("Show only unread messages to the user?", $frm->checkbox("only_show_unread", 1, "Show only unread", $PHORUM["mod_announcements"]["only_show_unread"]));
$frm->addrow("Number To Show", $frm->text_box("number_to_show", $PHORUM["mod_announcements"]["number_to_show"], 10));
$frm->addrow("Maximum Days To Show", $frm->text_box("days_to_show", $PHORUM["mod_announcements"]["days_to_show"], 10) . " (0 = forever)");
$forum_list_global = phorum_get_forum_info(1, 0);
$frm->addrow("Announcement Forum", $frm->select_tag("forum_id", $forum_list_global, $PHORUM["mod_announcements"]["forum_id"]));
//$vroot_folders = phorum_db_get_forums(0, NULL, '\'forum_id\'');
$vroot_folders = phorum_get_forum_info(3, -1);
if (count($vroot_folders)) {
Пример #16
0
    $vroot = 0;
}
// If we are inheriting settings from a forum,
// then disable the inherited fields in the input.
$disabled_form_input = '';
if ($inherit_id != -1) {
    $disabled_form_input = 'disabled="disabled"';
}
// ----------------------------------------------------------------------
// Handle displaying the folder settings form
// ----------------------------------------------------------------------
if ($errors) {
    phorum_admin_error(join("<br/>", $errors));
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
// Edit an existing folder.
if (defined("PHORUM_EDIT_FOLDER")) {
    $frm->hidden("module", "editfolder");
    $frm->hidden("forum_id", $forum_id);
    $title = "Edit existing folder";
} else {
    $frm->hidden("module", "newfolder");
    $title = "Add A Folder";
    $folders = $folder_data;
}
$frm->addbreak($title);
$frm->addrow("Folder Title", $frm->text_box("name", $name, 30));
$frm->addrow("Folder Description", $frm->textarea("description", $description, $cols = 60, $rows = 10, "style=\"width: 100%;\""), "top");
$parent_id_options = phorum_api_forums_get_parent_id_options($forum_id);
$frm->addrow("Put this forum below folder", $frm->select_tag('parent_id', $parent_id_options, $parent_id));
Пример #17
0
    $html_disabled = 1;
    $show_in_admin = 0;
    $title = "Add A Profile Field";
    $submit = "Add";
    // Setup data for edit mode.
} else {
    $name = $field['name'];
    $length = $field['length'];
    $html_disabled = $field['html_disabled'];
    $show_in_admin = isset($field['show_in_admin']) ? $field['show_in_admin'] : 0;
    $title = "Edit Profile Field";
    $submit = "Update";
}
// Display the custom profile field editor.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", $submit);
$frm->hidden("module", "customprofile");
$frm->hidden("curr", "{$curr}");
$frm->addbreak($title);
$row = $frm->addrow("Field Name", $frm->text_box('name', $name, 50));
$frm->addhelp($row, "Field Name", "This is the name to assign to the custom profile field. Because it must be possible to use this name as the name property for an input element in an HTML form, there are a few restrictions to it:<br/><ul><li>it can only contain letters, numbers<br/> and underscores (_);</li><li>it must start with a letter.</li></ul>");
$frm->addrow("Field Length (Max. " . PHORUM_MAX_CPLENGTH . ")", $frm->text_box("length", $length, 50));
$row = $frm->addrow("Disable HTML", $frm->checkbox("html_disabled", 1, "Yes", $html_disabled));
$frm->addhelp($row, "Disable HTML", "\n    If this option is enabled, then HTML code will not be usable\n    in this field. When displaying the custom field's data,\n    Phorum will automatically replace special HTML characters\n    with their safe HTML counter parts.<br/>\n    <br/>\n    There are two possible reasons for disabling it:<br/>\n    <ol>\n      <li>You need HTML in this field and run a module which formats\n          the field data into safe html (before storing it to the database\n          or before displaying it on screen).\n      <li>You run a module that needs to store an array in the field.\n    </ol>\n    So in practice, you only disable this option if module documentation tells\n    you to do so or if you are writing a module which needs this. If you don't\n    understand what's going on here, then don't disable the option.<br/>\n    <br/>\n    To learn about the security risks involved, search for \"XSS\" and\n    \"cross site scripting\" on the internet.");
$row = $frm->addrow("Show in user admin", $frm->checkbox("show_in_admin", 1, "Yes", $show_in_admin));
$frm->addhelp($row, "Show in user admin", "If this option is enabled, then the contents of the field will be displayed on the user details page in the Phorum admin interface (section \"Edit Users\").");
$frm->show();
// If we are not in edit mode, we show the list of available profile fields.
if ($curr == "NEW") {
    print "Creating a custom profile field here merely allows for the use\n           of the field. If you want to use it as an extra info field for\n           your users, you will need to edit the register, control center\n           and profile templates to actually allow users to enter data in\n           the fields and have it stored. You will have to use the name\n           you enter here as the name property of the HTML form element.\n           <hr class=\"PhorumAdminHR\" />";
    if (isset($PHORUM['PROFILE_FIELDS']["num_fields"])) {
Пример #18
0
        $full_purge = isset($_POST["purge_all"]) && $_POST["purge_all"];
        $report = phorum_cache_purge($full_purge);
        print $report . "<br/>";
    }
    // Cleanup compiled templates.
    $purged = 0;
    $dh = opendir($PHORUM["cache"]);
    if (!$dh) {
        die("Can't opendir " . htmlspecialchars($PHORUM["cache"]));
    }
    while ($entry = readdir($dh)) {
        if (preg_match('/^tpl-.*[a-f0-9]{32}\\.php(-stage2)?$/', $entry)) {
            $compiled_tpl = $PHORUM["cache"] . "/{$entry}";
            $size = filesize($compiled_tpl);
            if (@unlink($compiled_tpl)) {
                $purged += $size;
            }
        }
    }
    require_once "./include/format_functions.php";
    print "Finished purging compiled Phorum templates<br/>\n" . "Purged " . phorum_filesize($purged) . "<br/>";
    print "<br/>";
    print "DONE<br/><br/>";
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Purge cache");
$frm->hidden("module", "cache_purge");
$frm->addbreak("Purging the Phorum cache");
$frm->addmessage("For improving performance, Phorum uses caching techniques for taking some load of the database and webserver. After running Phorum for some time, the amount of cached data will grow though. Using this maintenance tool, you can purge stale data from the Phorum cache to bring it back in size. Purging the cache will also cleanup all compiled template files.");
$frm->addrow("Cleanup all cache items, not only the expired ones", $frm->select_tag("purge_all", array("No", "Yes"), 0));
$frm->show();
Пример #19
0
    }
    // Prepare a forum data array for initializing the form.
    $forum = phorum_api_forums_save(array('forum_id' => NULL, 'folder_flag' => 0, 'inherit_id' => 0, 'parent_id' => $parent_id, 'name' => ''), PHORUM_FLAG_PREPARE);
    extract($forum);
}
// ----------------------------------------------------------------------
// Handle displaying the forum settings form
// ----------------------------------------------------------------------
if ($errors) {
    phorum_admin_error(join("<br/>", $errors));
}
if (isset($_GET['okmsg'])) {
    phorum_admin_okmsg(htmlspecialchars($_GET['okmsg']));
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
if (defined("PHORUM_DEFAULT_OPTIONS")) {
    $frm->hidden("module", "forum_defaults");
    $title = "Edit the default forum settings";
} elseif (defined("PHORUM_EDIT_FORUM")) {
    $frm->hidden("module", "editforum");
    $frm->hidden("forum_id", $forum_id);
    $title = "Edit settings for forum \"{$name}\" (Id: {$forum_id})";
} else {
    $frm->hidden("module", "newforum");
    $title = "Create a new forum";
}
$frm->addbreak($title);
// Options that are only required when editing or creating a forum.
if (!defined("PHORUM_DEFAULT_OPTIONS")) {
    $frm->addrow("Forum Title", $frm->text_box("name", $name, 30, 50));
Пример #20
0
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_ADMIN")) {
    return;
}
$error = "";
if (count($_POST)) {
    // some sanity checking would be nice ;)
    $PHORUM["smtp_mail"] = array('host' => $_POST['host'], 'port' => empty($_POST['port']) ? "25" : $_POST['port'], 'auth' => $_POST['auth'], 'username' => $_POST['auth_username'], 'password' => $_POST['auth_password'], 'conn' => $_POST['conn'], 'log_successful' => $_POST['log_successful'], 'show_errors' => $_POST['show_errors']);
    if (empty($error)) {
        phorum_db_update_settings(array("smtp_mail" => $PHORUM["smtp_mail"]));
        phorum_admin_okmsg("Settings updated");
    }
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "smtp_mail");
$frm->addbreak("Settings for the SMTP Mail Module");
$frm->addrow("Hostname of mailserver", $frm->text_box("host", $PHORUM['smtp_mail']['host'], 50));
$frm->addrow("Port of mailserver", $frm->text_box("port", $PHORUM['smtp_mail']['port'], 5) . " (Default Port is 25, unencrypted. Encrypted Port is usually 465)");
$frm->addrow("Connection Type", $frm->select_tag("conn", array('plain' => 'Plain Connection', 'ssl' => 'SSL-Encryption', 'tls' => 'TLS-Encryption'), $PHORUM['smtp_mail']['conn']) . " (e.g. Google-Mail connection needs TLS)");
$frm->addrow("Use SMTP Auth", $frm->select_tag("auth", array(1 => 'Yes', 0 => 'No'), $PHORUM['smtp_mail']['auth']));
$frm->addrow("SMTP Auth Username", $frm->text_box("auth_username", $PHORUM['smtp_mail']['username'], 50));
$frm->addrow("SMTP Auth Password", $frm->text_box("auth_password", $PHORUM['smtp_mail']['password'], 50, 0, true));
$frm->addsubbreak("Logging / Errorhandling");
$row = $frm->addrow("Show errors on screen", $frm->select_tag("show_errors", array(1 => "Yes", 0 => "No"), $PHORUM['smtp_mail']['show_errors']));
$frm->addhelp($row, "Show errors on screen", "This option enables to show errors on screen (default). If disabled you should make sure that you have the Event Logging Module enabled which will log errors in email sending.");
$row = $frm->addrow("Log successful mails to the Event Logging Module", $frm->select_tag("log_successful", array(0 => "No", 1 => "Yes"), $PHORUM['smtp_mail']['log_successful']));
$frm->addhelp($row, "Logging of successful emails to the Event Logging Module", "This option logs successful email messages to the Event Logging Module if that is enabled too.\nErrors are logged there always (if the module is enabled).");
$frm->show();
Пример #21
0
                    $err = true;
                }
                elseif ($fp = fopen($PHORUM["cache"] . "/phorum-install-test", "w+")) {
                    unlink($PHORUM["cache"] . "/phorum-install-test");
                }
                else {
                    $err = true;
                }

            }
            error_reporting(E_WARN);
            if ($message == "") {
                if($err){
                    $message.="Your cache directory is not writable. Please change the permissions on '/cache' inside the Phorum directory to allow writing. In Unix, you may have to use this command: chmod 777 cache<br /><br />If you want to continue anyway and set a cache directory manually, press continue. Note that you must do this, Phorum will not work without a valid cache.";
                } else {
                    $message.="Cache directory set.  Next we will create a user with administrator privileges.  Press continue when ready.";
                }
            }

            $frm = new PhorumInputForm ("", "post", "Continue ->");
            $frm->hidden("module", "install");
            $frm->addbreak("Checking cache....");
            $frm->addmessage($message);
            $frm->hidden("step", "4");
            $frm->show();

            break;
    }

?>
Пример #22
0
            $error = "Database error while updating settings.";
        }
    }
}
if ($error) {
    phorum_admin_error($error);
} elseif (isset($_GET['message']) && $_GET['message'] == 'success') {
    $okmsg = "Settings updated";
    phorum_admin_okmsg($okmsg);
}
// create the time zone drop down array
for ($x = -23; $x <= 23; $x++) {
    $tz_range[$x] = $x;
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
$frm->addbreak("Phorum General Settings");
$frm->hidden("module", "settings");
$row = $frm->addrow("Phorum Title", $frm->text_box("title", $PHORUM["title"], 50));
$row = $frm->addrow("Phorum Description", $frm->textarea("description", $PHORUM["description"], 30, 5, "style='width: 100%'"));
$row = $frm->addrow("DNS Lookups", $frm->select_tag("dns_lookup", array("No", "Yes"), $PHORUM["dns_lookup"]));
$frm->addhelp($row, "DNS Lookups", "DNS is the system that (amongsts other things) is responsible for\n     translating host names into IP addresses and vice versa.\n     If DNS lookups are enabled, phorum will use DNS lookups for:\n     <ul>\n     <li>logging the hostname from which a message was posted, instead of\n         the plain IP address;</li>\n     <li>being able to create IP ban items based on host and domain names;</li>\n     <li>checking the email address that is for user registrations.</li>\n     </ul>\n     If Phorum keeps reporting illegal email addresses during signup or\n     if you are suffering from massive delays during posting messages,\n     then there might be DNS problems on your server. In that case, disable\n     DNS lookups as a work around.");
$row = $frm->addrow("Hide inaccessible Forums on the Index Page", $frm->select_tag("hide_forums", array("No", "Yes"), $PHORUM["hide_forums"]));
$frm->addhelp($row, "Hide inaccessible Forums on the Index Page", "By setting this to Yes, forums that users are not allowed to read will be hidden from them in the forums list.");
$row = $frm->addrow("Show New Counts for Forums on the Index Page", $frm->select_tag("show_new_on_index", array(PHORUM_NEWFLAGS_NOCOUNT => "No", PHORUM_NEWFLAGS_COUNT => "Yes", PHORUM_NEWFLAGS_CHECK => "No count, just indicator"), $PHORUM["show_new_on_index"]));
$frm->addhelp($row, "Show New Counts for Forums on the Index Page", "This feature will show registered users how many new messages and threads there are in each forum on the forum index page.  If you have a large number of posts, a large number of forums, a large number of users or some combination of the three, this setting could cause some performance issues.  If you see performance issues, try setting it to \"No count, just indicator\" or \"No\"");
$row = $frm->addrow("How to Display Forums and Folders on the Index Page", $frm->select_tag("index_style", array(PHORUM_INDEX_DIRECTORY => 'Directory Structure', PHORUM_INDEX_FLAT => 'Flat Structure'), $PHORUM["index_style"]));
$frm->addhelp($row, "How to Display Forums and Folders on the Index Page", "Forum has multiple displaying styles available for the index page:\n     <ul>\n     <li><b>Directory Structure:</b><br/>\n         <br/>\n         <em>This style resembles the way in which you normally would browse a\n         filesystem directory structure, hence the name.</em><br/>\n         <br/>\n         When using this style, the index page will show a list of folders\n         and a list of forums that are available in the folder for which the\n         index page is shown. The user can either go to a forum or traverse\n         the folder tree by going to one of the deeper folders.<br/><br/></li>\n     <li><b>Flat Structure</b><br/>\n         <br/>\n         <em>This style will present the user a flat list of category sections\n         with forums (and possibly folders) in them. This is the style\n         that most forums use nowadays.</em><br/>\n         <br/>\n         When using this style, the root index page will show category\n         sections with forums and folders in them. Each section is a folder\n         that is directly below the root. The folders and forums that are\n         in those folders are shown in the corresponding sections.<br/>\n         Forums that are placed directly in the root folder, will be\n         shown in a generic \"Forums\" section.<br/>\n         <br/>\n         When visiting a subfolder, then the folders and forums inside that\n         subfolder are shown. For a subfolder, No sections are displayed.\n         This means that browsing subfolders in the flat structure works\n         a bit like browsing them in the directory structure.</li>\n     </ul>");
$row = $frm->addrow("Go To Forum if only One Forum is Visible on the Index", $frm->select_tag("jump_on_single_forum", array("No", "Yes"), $PHORUM['jump_on_single_forum']));
$frm->addhelp($row, "Go To Forum if only One Forum is Visible on the Index", "By setting this to Yes, Phorum will automatically jump to a forum if that is the only forum visible on the index page. This can be useful in case you are running a forum site with only one forum (or where visitors see only one forum due to permission settings), so visitors do not have to do an additional click to get from the index to the forum.");
$row = $frm->addrow("Enable Moderator Notifications", $frm->select_tag("enable_moderator_notifications", array("No", "Yes"), $PHORUM["enable_moderator_notifications"]));
Пример #23
0
    settype($string, "string");
    settype($type, "int");
    settype($pcre, "int");

    if($error){
        phorum_admin_error($error);
    }

    // load bad-words-list
    $banlists=phorum_db_get_banlists();
    $bad_words=$banlists[PHORUM_BAD_WORDS];

    include_once "./include/admin/PhorumInputForm.php";

    $frm = new PhorumInputForm ("", "post", $submit);

    $frm->hidden("module", "badwords");

    $frm->hidden("curr", "$curr");

    $frm->addbreak($title);

    $frm->addrow("Bad Word", $frm->text_box("string", $string, 50));

    $frm->addrow("Valid for Forum", $frm->select_tag("forumid", $forum_list, $forumid));

    $frm->show();

    echo "<hr class=\"PhorumAdminHR\" />";
Пример #24
0
    } else {
        echo "Settings Updated<br />";
    }
}
// Apply default values for the settings.
if (!isset($PHORUM["mod_example_settings"]["displaytext"])) {
    $PHORUM["mod_example_settings"]["displaytext"] = "";
}
if (!isset($PHORUM["mod_example_settings"]["displaycount"])) {
    $PHORUM["mod_example_settings"]["displaycount"] = 1;
}
// We build the settings form by using the PhorumInputForm object. When
// creating your own settings screen, you'll only have to change the
// "mod" hidden parameter to the name of your own module.
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "example_settings");
// Here we display an error in case one was set by saving
// the settings before.
if (!empty($error)) {
    echo "{$error}<br />";
}
// This adds a break line to your form, with a description on it.
// You can use this to separate your form into multiple sections.
$frm->addbreak("Edit settings for the example_settings module");
// This adds a text message to your form. You can use this to
// explain things to the user.
$frm->addmessage("This is the settings screen for the example_settings module. This module is only written for demonstrating the use of a settings screen for you own modules. The module itself will display a configurable text for a configurable number of times on screen.");
// This adds a row with a form field for entering the display text.
$frm->addrow("Text to display (default: Hello, world!)", $frm->text_box('displaytext', $PHORUM["mod_example_settings"]["displaytext"], 50));
Пример #25
0
            $vroot = $oldfolder["vroot"];
        } else {
            $vroot = 0;
        }
    }
    $forum_settings["vroot"] = $vroot;
} elseif (defined("PHORUM_EDIT_FOLDER")) {
    $forums = phorum_db_get_forums($_REQUEST["forum_id"]);
    $forum_settings = $forums[$_REQUEST["forum_id"]];
    extract($forum_settings);
}
if ($error) {
    phorum_admin_error($error);
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post");
$folder_data = phorum_get_folder_info();
if (defined("PHORUM_EDIT_FOLDER")) {
    $frm->hidden("module", "editfolder");
    $frm->hidden("forum_id", $forum_id);
    $title = "Edit Folder";
    $this_folder = $folder_data[$_REQUEST["forum_id"]];
    foreach ($folder_data as $folder_id => $folder) {
        // remove children from the list
        if ($folder_id != $_REQUEST["forum_id"] && substr($folder, 0, strlen($this_folder) + 2) != "{$this_folder}::") {
            $folders[$folder_id] = $folder;
        }
    }
    if ($vroot == $forum_id) {
        $vroot = 1;
    } else {
Пример #26
0
    if($curr!="NEW"){
        extract($PHORUM["mod_replace"][$curr]);
        $title="Edit Replacement";
        $submit="Update";
    } else {
        settype($string, "string");
        settype($type, "int");
        settype($pcre, "int");
        $title="Add A Replacement";
        $submit="Add";
    }

    include_once "./include/admin/PhorumInputForm.php";

    $frm = new PhorumInputForm ("", "post", $submit);

    $frm->hidden("module", "modsettings");

    $frm->hidden("mod", "replace");

    $frm->hidden("curr", "$curr");

    $frm->addbreak($title);

    $frm->addrow("String To Match", $frm->text_box("search", $search, 50));

    $frm->addrow("Replacement", $frm->text_box("replace", $replace, 50));

    $frm->addrow("Compare As", $frm->select_tag("pcre", $match_types, $pcre));
Пример #27
0
     $frm->addrow("Admin User Name", $frm->text_box("admin_user", $admin_user, 30));
     $frm->addrow("Admin Email Address", $frm->text_box("admin_email", $admin_email, 30));
     $frm->addrow("Admin Password", $frm->text_box("admin_pass", "", 30, 0, true));
     $frm->addrow("(again)", $frm->text_box("admin_pass2", "", 30, 0, true));
     $frm->show();
     break;
 case "done":
     $cont_url = phorum_admin_build_url();
     $PHORUM['DB']->update_settings(array("installed" => 1));
     echo "The setup is complete.  You can now go to <a href=\"{$cont_url}\">the admin</a> and start making Phorum all your own.<br /><br /><strong>Here are some things you will want to look at:</strong><br /><br /><a href=\"{$_SERVER['PHP_SELF']}?module=settings\">The General Settings page</a><br /><br /><a href=\"{$_SERVER['PHP_SELF']}?module=mods\">Pre-installed modules</a><br /><br /><a href=\"docs/faq.txt\">The FAQ</a><br /><br /><a href=\"docs/performance.txt\">How to get peak performance from Phorum</a><br /><br /><strong>For developers:</strong><br /><br /><a href=\"docs/creating_mods.txt\">Module Creation</a><br /><br /><a href=\"docs/permissions.txt\">How Phorum permisssions work</a><br /><br /><a href=\"docs/CODING-STANDARDS\">The Phorum Team's codings standards</a>";
     break;
 case "modules":
     // Retrieve a list of available modules.
     require_once './include/api/modules.php';
     $list = phorum_api_modules_list();
     $frm = new PhorumInputForm("", "post", "Continue ->");
     $frm->addbreak("Optional modules");
     $frm->hidden("module", "install");
     $frm->hidden("sanity_checks_done", "1");
     $frm->hidden("step", "modules");
     $frm->hidden("do_modules_update", "1");
     $frm->addmessage("Phorum has a very robust module system.  The following modules are\n             included with the distribution.  You can find more modules at the\n             Phorum web site.  Some modules may have additional configuration\n             options, which are not available during install.  To configure the\n             modules, click the \"Modules\" menu item in the admin interface\n             after installation is done.");
     foreach ($list['modules'] as $name => $info) {
         // Skip the compatibility modules.
         // These are enabled automatically by Phorum when required.
         if (!empty($info['compat'])) {
             continue;
         }
         // Should not happen.
         if ($info['version_disabled']) {
             continue;
Пример #28
0
        $submit="Update";
    } else {
        settype($string, "string");
        $title="Add A Profile Field";
        $submit="Add";
        $length=255;
        $html_disabled=1;
    }

    if($error){
        phorum_admin_error($error);
    }

    include_once "./include/admin/PhorumInputForm.php";

    $frm = new PhorumInputForm ("", "post", $submit);

    $frm->hidden("module", "customprofile");

    $frm->hidden("curr", "$curr");

    $frm->addbreak($title);

    $frm->addrow("Field Name", $frm->text_box("string", $string, 50));
    $frm->addrow("Field Length (Max. 65000)", $frm->text_box("length", $length, 50));
    $frm->addrow("Disable HTML", $frm->checkbox("html_disabled",1,"Yes",$html_disabled));

    $frm->show();

    echo "This will only add the field to the list of allowed fields.  You will need to edit the register and profile templates to actually allow users to use the fields.  Use the name you enter here as the name property of the HTML form element.";
Пример #29
0
        }
    }
    if (count($arr) > 1) {
        $frm->addrow($frm->select_tag("new_forum", $arr), $perm_frm);
    }
    ksort($group["permissions"]);
    if (is_array($group["permissions"])) {
        foreach ($group["permissions"] as $forum_id => $perms) {
            $perm_frm = $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $perms & PHORUM_USER_ALLOW_READ) . "&nbsp;&nbsp;" . $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $perms & PHORUM_USER_ALLOW_REPLY) . "&nbsp;&nbsp;" . $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $perms & PHORUM_USER_ALLOW_NEW_TOPIC) . "&nbsp;&nbsp;" . $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_EDIT . "]", 1, "Edit&nbsp;Their&nbsp;Posts", $perms & PHORUM_USER_ALLOW_EDIT) . "<br />" . $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $perms & PHORUM_USER_ALLOW_ATTACH) . "<br />" . $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_MODERATE_MESSAGES . "]", 1, "Moderate Messages", $perms & PHORUM_USER_ALLOW_MODERATE_MESSAGES) . "&nbsp;&nbsp;" . $frm->checkbox("permissions[{$forum_id}][" . PHORUM_USER_ALLOW_MODERATE_USERS . "]", 1, "Moderate Users", $perms & PHORUM_USER_ALLOW_MODERATE_USERS) . "&nbsp;&nbsp;" . $frm->hidden("forums[{$forum_id}]", $forum_id);
            $row = $frm->addrow($forums[$forum_id]["name"] . "<br />" . $frm->checkbox("delforum[{$forum_id}]", 1, "Delete"), $perm_frm);
        }
    }
    $frm->show();
}
if (empty($_REQUEST["edit"])) {
    $frm = new PhorumInputForm("", "post");
    $frm->addbreak("Phorum Group Admin");
    $frm->hidden("module", "groups");
    $frm->hidden("section", "add");
    $frm->addrow("Add A Group:", $frm->text_box("group_name", "", 50));
    $frm->show();
    $frm_url = phorum_admin_build_url();
    echo "<hr class=\"PhorumAdminHR\" />";
    echo "<form action=\"{$frm_url}\" method=\"post\">\n";
    echo "<input type=\"hidden\" name=\"phorum_admin_token\" value=\"{$PHORUM['admin_token']}\">\n";
    echo "<input type=\"hidden\" name=\"module\" value=\"groups\">\n";
    echo "<input type=\"hidden\" name=\"action\" value=\"deleteGroups\">\n";
    echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
    echo "<tr>\n";
    echo "    <td class=\"PhorumAdminTableHead\">Group</td>\n";
    echo "    <td class=\"PhorumAdminTableHead\">Delete</td>\n";
Пример #30
0
// For shorter writing.
$settings =& $GLOBALS["PHORUM"]["mod_event_logging"];
$eventtypes =& $GLOBALS["PHORUM"]["DATA"]["MOD_EVENT_LOGGING"]["EVENT_TYPES"];
if (count($_POST)) {
    $settings["resolve_hostnames"] = isset($_POST["resolve_hostnames"]) ? 1 : 0;
    $settings["max_log_entries"] = (int) $_POST["max_log_entries"];
    $settings["min_log_level"] = (int) $_POST["min_log_level"];
    foreach ($eventtypes as $type => $desc) {
        $settings["do_log_{$type}"] = isset($_POST["do_log_{$type}"]) ? 1 : 0;
    }
    phorum_db_update_settings(array("mod_event_logging" => $settings));
    phorum_admin_okmsg("The settings were successfully saved.");
}
// Create the settings form.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "event_logging");
$frm->hidden("el_action", "settings");
$frm->addbreak("General Settings");
$row = $frm->addrow("Minimum log level", $frm->select_tag("min_log_level", $GLOBALS["PHORUM"]["DATA"]["MOD_EVENT_LOGGING"]["LOGLEVELS"], $settings["min_log_level"]));
$frm->addhelp($row, "Minimum log level", "This option configures the minimum log level for which log messages are written to the event log. Events with a lower log level will not be written.<br/><br/>\"Debug\" is the lowest log level and \"Alert\" the highest, so to log all events, set this option to \"Debug\".");
$row = $frm->addrow("Maximum amount of stored event logs (0 = unlimited)", $frm->text_box("max_log_entries", $settings["max_log_entries"], 5));
$frm->addhelp($row, "Maximum amount of stored event logs", "This option configures the maximum amount of event logs that can be stored in the database at a given time. If the amount of event logs grows larger than this configured maximum, then old entries will be automatically cleaned up.<br/><br/>If you do not want a limit on the number of event logs, then set this option to 0 (zero).");
$row = $frm->addrow("Resolve IP addresses to host names when writing the event log", $frm->checkbox("resolve_hostnames", "1", "", $settings["resolve_hostnames"]));
$frm->addhelp($row, "Resolve IP addresses", "If this option is enabled, the IP address of the visitor will immediately be resolved into its hostname. Enabling this option can result in delays for the user, in case hostname lookups are slow for some reason.<br/><br/><b>Because of the performance penalty, we do not recommend enabling this option, unless you really need it and know what you are doing.</b>");
$row = $frm->addbreak("Which events to log");
$frm->addhelp($row, "Which events to log", "Below, you see the events which the Event Logging module can log for you. Enable the checkbox for each event type that you wish to appear in the event log. You can use this to limit the amount of entries, in case you are not interested in some of them.<br/><br/>Note that other modules can also write entries to the event log. If you need to suppress logging for those, then please consult the settings and documentation of those modules.");
foreach ($eventtypes as $type => $desc) {
    if ($desc === NULL) {
        $frm->addsubbreak($type);