Пример #1
0
    $length = $field['length'];
    $html_disabled = $field['html_disabled'];
    $show_in_admin = isset($field['show_in_admin']) ? $field['show_in_admin'] : 0;
    $field_type = isset($field['field_type']) ? $field['field_type'] : PHORUM_CUSTOM_FIELD_USER;
    $title = "Edit Profile Field";
    $submit = "Update";
}
// Display the custom field editor.
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", $submit);
$frm->hidden("module", "customprofile");
$frm->hidden("curr", "{$curr}");
$frm->addbreak($title);
// don't make this editable - needs deletion and recreation of field
if ($curr == 'NEW') {
    $row = $frm->addrow("Field Type", $frm->select_tag('field_type', $TYPES_ARRAY, $field_type));
} else {
    $frm->hidden('field_type', $field_type);
}
$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 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_CUSTOM_FIELD_LENGTH . ")", $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 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\" />";
    $active_fields = 0;
Пример #2
0
        }
    }
    if ($vroot == $forum_id) {
        $vroot = 1;
    } else {
        $foreign_vroot = $vroot;
        $vroot = 0;
    }
} else {
    $frm->hidden("module", "newfolder");
    $title = "Add A Folder";
    $folders = $folder_data;
    $vroot = 0;
    $active = 1;
    $template = $PHORUM["default_forum_options"]["template"];
}
$frm->hidden("folder_flag", "1");
$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");
$frm->addrow("Folder", $frm->select_tag("parent_id", $folders, $parent_id));
$frm->addrow("Visible", $frm->select_tag("active", array("No", "Yes"), $active));
$frm->addbreak("Display Settings");
$frm->addrow("Template", $frm->select_tag("template", phorum_get_template_info(), $template));
$frm->addrow("Language", $frm->select_tag("language", phorum_get_language_info(), $language));
$frm->addrow("Virtual Root for descending forums/folders", $frm->checkbox("vroot", "1", "enabled", $vroot ? 1 : 0));
if ($foreign_vroot > 0) {
    $frm->addrow("This folder is in the Virtual Root of:", $folders[$foreign_vroot]);
}
phorum_hook("admin_editfolder_form", $frm, $forum_settings);
$frm->show();
Пример #3
0
        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;
            }
            $text = $info["title"];
            if (isset($info["desc"])) {
                $text .= "<div class=\"small\">" . wordwrap($info["desc"], 90, "<br />") . "</div>";
            }
            $frm->addrow($text, $frm->select_tag(base64_encode("mods_{$name}"), array("Off", "On"), $info['enabled']));
        }
        $frm->show();
        break;
}
Пример #4
0
    $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));
    $frm->addrow("Forum 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));
    if ($vroot > 0) {
        $frm->addrow("This forum is in the Virtual Root of:", $folder_list[$vroot]);
    }
    $row = $frm->addrow("Make this forum visible in the forum index?", $frm->select_tag("active", array("No", "Yes"), $active));
    $frm->addhelp($row, "Make this forum visible in the forum index?", 'If this option is set to "No", then this forum will not be visible
         in the forum index. This is mainly an option for temporarily keeping
         a forum hidden to your users (e.g. while you are creating and
         configuring a forum or for testing out features).<br/>
         <br/>
         <b>This is not a security option!</b><br/>
         <br/>
         A forum that is not visible is still accessible by all users
         that have at least read access for it. If you need a forum that is
         only accessible by some of your users, then use the permission system
         for that. Revoke all rights from both public and registered users in
Пример #5
0
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) {
        $category_checkboxes .= '<span style="white-space: nowrap">' . $frm->checkbox("show_category[{$l}]", "1", "", isset($show_category[$l]) ? 1 : 0, "id=\"cacb_{$l}\"") . ' <label for="cacb_' . $l . '">' . $s . '</label></span> ';
    }
    $row = $frm->addrow("Categories to display", $category_checkboxes);
    $frm->addhelp($row, "Categories to display", "By using these checkboxes, you can limit the log categories that are displayed. If you do not check any of them, then no filtering will be applied and all log categories will be displayed.");
    $sources = array("" => "");
Пример #6
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();
Пример #7
0
    $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));

    $frm->show();

    echo "If using PCRE for comparison, \"Sting To Match\" should be a valid PCRE expression. See <a href=\"http://php.net/pcre\">the PHP manual</a> for more information.";

    if($curr=="NEW"){

        echo "<hr class=\"PhorumAdminHR\" />";

        if(count($PHORUM["mod_replace"])){

            echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
            echo "<tr>\n";
            echo "    <td class=\"PhorumAdminTableHead\">Search</td>\n";
            echo "    <td class=\"PhorumAdminTableHead\">Replace</td>\n";
Пример #8
0
    }
}
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->select_tag('rel_no_follow', array('No', 'Yes, always', 'Yes, to external urls and urls not defined below.'), $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("Allowed URLs that won't get the nofollow attribute as defined above", $frm->text_box("follow_urls", $PHORUM["mod_bbcode"]["follow_urls"], 75));
$frm->addhelp($row, "Allowed URLs that won't get the nofollow attribute as defined above", 'If the preceding setting is set to "Yes, to external urls and urls not defined below." this list is checked for allowed URLs which won\'t get the rel=nofollow attribute added. By default only the Phorum URL is allowed. I you want to allow a different URL, then enter that URL here. Multiple URLs can be provided as a comma separated list. All URLs not starting with the URLs listed here, besides the Phorum URL, will get the nofollow attribute added.<br /><br />A full URL should be like http://www.domainname.com/path or http://www.domain.com ... ');
$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.");
$row = $frm->addrow("Enable posting option \"disable BBcode\"", $frm->checkbox("allow_disable_per_post", "1", "Yes", $PHORUM["mod_bbcode"]["allow_disable_per_post"]));
$frm->addhelp($row, "Enable posting option \"disable BBcode\"", "If this feature is enabled, then your users can get an extra option in the posting editor for disabling the BBcode handling for the posted message. This can be useful if the user wants to post a text about BBcode tags or a text that contains strings that unintentionally match BBcode tags.<br/><br/>To make this option visible, you will have to add the code <b>{HOOK \"tpl_editor_disable_bbcode\"}</b> to the posting.tpl template file at an appropriate spot.");
$row = $frm->addrow("Enable BBcode escape sequence \\[...]", $frm->checkbox("enable_bbcode_escape", "1", "Yes", $PHORUM["mod_bbcode"]["enable_bbcode_escape"]));
$frm->addhelp($row, "Enable BBcode escape sequence", "If this feature is enabled, then your users can prepend BBcode tags with a backslash character in order to let the BBcode module ignore the tag. This is mostly useful for posting BBcode examples in a forum message. In the final rendered message, the backslash character will be hidden. For example, the following code could be added to a message:<br/><pre>\\[b]example for bold text\\[/b]<br/>\\[url=http://www.phorum.org]URL example\\[/url]<br/><br/>These would be showed in the final message as:<br/><pre>[b]example for bold text[/b]<br/>[url=http://www.phorum.org]URL example[/url]");
$row = $frm->addbreak("Activation of BBcode tags");
$frm->addhelp($row, "Activation of BBcode tags", "Using the options below, you can configure which BBcode tags you want to make available to your users.<br/><br/>For most of the tags, you can additionally enable the editor tools button. If you have enabled the Editor Tools module, then doing so will add a button to the editor tool bar for that tag.");
foreach ($GLOBALS['PHORUM']['MOD_BBCODE']['BUILTIN'] as $tagname => $tag) {
    if (!isset($tag[BBCODE_INFO_DESCRIPTION])) {
        continue;
    }
Пример #9
0
} elseif (defined("PHORUM_EDIT_FORUM")) {
    $frm->hidden("module", "editforum");
    $frm->hidden("forum_id", $forum_id);
    $title = "Edit Forum";
} else {
    $frm->hidden("module", "newforum");
    $title = "Add A Forum";
    $active = 1;
    // not set in the default forum options
}
$frm->addbreak($title);
if (!defined("PHORUM_DEFAULT_OPTIONS")) {
    $frm->addrow("Forum Title", $frm->text_box("name", $name, 30, 50));
    $frm->addrow("Forum Description", $frm->textarea("description", $description, $cols = 60, $rows = 10, "style=\"width: 100%;\""), "top");
    $folder_list = phorum_get_folder_info();
    $frm->addrow("Folder", $frm->select_tag("parent_id", $folder_list, $parent_id));
    if ($vroot > 0) {
        $frm->addrow("This forum is in the Virtual Root of:", $folder_list[$vroot]);
    }
    $frm->addrow("Visible", $frm->select_tag("active", array("No", "Yes"), $active));
    /*
     * [hook]
     *     admin_editforum_section_edit_forum
     *
     * [description]
     *     Allow injecting custom field logic right before the (possible
     *     inherited) permissions/settings begin.
     *
     * [category]
     *     Admin interface
     *
Пример #10
0
    $check = '<span style="color:red">The Event Logging module ' . 'is currently not activated; logging cannot ' . 'be enabled</span>';
    $disabled = 'disabled="disabled"';
    $PHORUM["mod_spamhurdles"]["log_events"] = 0;
} else {
    $check = '<span style="color:darkgreen">The Event Logging module ' . 'is activated; events can be logged by enabling the ' . 'feature below</span>';
    $disabled = '';
}
$frm->addrow($check, '');
$row = $frm->addrow('Log blocked form posts to the Event Logging module?', $frm->checkbox("log_events", 1, "Yes", $PHORUM["mod_spamhurdles"]["log_events"], $disabled));
$url = phorum_admin_build_url(array('module=modsettings', 'mod=event_logging', 'el_action=logviewer'));
$frm->addhelp($row, "Log blocked form posts to the Event Logging module?", "When both this feature and the Event Logging module are enabled,\n     then the Spam Hurdles module will log information about blocked\n     form posts to the Phorum Event Log. To view this log, go to\n     <a href=\"{$url}\">the Event Log viewer</a>");
// ----------------------------------------------------------------------
// Configure spam hurdles for posting messages
// ----------------------------------------------------------------------
$frm->addbreak("Spam Hurdles for posting new messages");
$row = $frm->addrow('What action has to be taken when a spam message is suspected?', $frm->select_tag('posting_block_action', array('blockerror' => 'Fully block and show an error', 'unapprove' => 'Accept, but make unapproved'), $PHORUM['mod_spamhurdles']['posting']['block_action']));
$frm->addhelp($row, "Action when a spam message is suspected", "You can choose whether you want to fully block suspected spam messages\n     or that you want to have them posted in a moderated state, so they\n     will need approval by a moderator.<br/>\n     <br/>\n     A message is suspicious if it fails one of the spam hurdles:<br/>\n     <ul>\n       <li>Block forms that are submitted multiple times</li>\n       <li>Check if an HTML commented form field is submitted</li>\n       <li>Let the browser sign the form using JavaScript</li>\n     </ul>\n     For the remaining hurdles, an error state might be resolved by\n     the user (e.g. by filling in the correct CAPTCHA code or by\n     resubmitting a too quickly posted form). For those errors,\n     there will always be an error message and a chance for the\n     user to fix the issue to make posting possible.");
create_spamhurdle_options($frm, 'posting', array('posting.tpl', 'posting_messageform.tpl'), 'tpl_editor_before_textarea', array("none" => "Disable hurdle", "anonymous" => "Enable for anonymous users", "all" => "Enable for all users"));
// ----------------------------------------------------------------------
// Configure spam hurdles for user registration
// ----------------------------------------------------------------------
$frm->addbreak("Spam Hurdles for user registration");
create_spamhurdle_options($frm, 'register', array('register.tpl'), 'tpl_register_form', array("none" => "Disable hurdle", "all" => "Enable hurdle"));
// ----------------------------------------------------------------------
// Configure spam hurdles for PM
// ----------------------------------------------------------------------
$frm->addbreak("Spam Hurdles for posting private messages (PM)");
create_spamhurdle_options($frm, 'pm', array('pm_post.tpl'), 'tpl_pm_editor_before_textarea', array("none" => "Disable hurdle", "all" => "Enable hurdle"));
// ----------------------------------------------------------------------
// Utility function for generating spam hurdle configuration options
// ----------------------------------------------------------------------
Пример #11
0
        } else {
            $error = "Database error while updating settings.";
        }
    }
}
if ($error) {
    phorum_admin_error($error);
} elseif ($okmsg) {
    phorum_admin_okmsg($okmsg);
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
$frm->hidden("module", "cache");
$frm->addbreak("Phorum Cache Settings");
$frm->addbreak("Which template data to cache (uses cache directory)");
$row = $frm->addrow("Enable Caching stylesheet data (CSS):", $frm->select_tag("cache_css", array("No", "Yes"), $PHORUM["cache_css"]));
$frm->addhelp($row, "Cache stylesheet", "Phorum uses a system where modules can add data to the main stylesheet\r\n     for the pages. By enabling this feature, Phorum can cache the dynamically\r\n     generated data and improve caching of the stylesheet data in the browsers\r\n     of your visitors. Enabling this feature is highly recommended. Only\r\n     disable it if you are having problems with it.");
$row = $frm->addrow("Enable Caching JavaScript code:", $frm->select_tag("cache_javascript", array("No", "Yes"), $PHORUM["cache_javascript"]));
$frm->addhelp($row, "Cache JavaScript", "Phorum uses a system where modules can provide JavaScript code for the\r\n     pages. By enabling this feature, Phorum can cache the dynamically\r\n     generated data and improve caching of the JavaScript data in the browsers\r\n     of your visitors. Enabling this feature is highly recommended. Only\r\n     disable it if you are having problems with it.");
$frm->addbreak("Which data to cache (uses selected cache layer)");
$row = $frm->addrow("Enable Caching Userdata:", $frm->select_tag("cache_users", array("No", "Yes"), $PHORUM["cache_users"]));
$row = $frm->addrow("Enable Caching Newflags:", $frm->select_tag("cache_newflags", array("No", "Yes"), $PHORUM["cache_newflags"]));
$row = $frm->addrow("Enable Caching Messages:", $frm->select_tag("cache_messages", array("No", "Yes"), $PHORUM["cache_messages"]));
$row = $frm->addrow("Enable Caching Banlists:", $frm->select_tag("cache_banlists", array("No", "Yes"), $PHORUM["cache_banlists"]));
$row = $frm->addrow("Enable Caching RSS-Feeds:", $frm->select_tag("cache_rss", array("No", "Yes"), $PHORUM["cache_rss"]));
$frm->addbreak("Settings that are set from include/config/cache.php");
$row = $frm->addrow("Cache Directory", $PHORUM['CACHECONFIG']['directory']);
$frm->addhelp($row, "Cache Directory", "Caching is used to take some load off the database and web server.\r\n     The cache directory is used for caching preprocessed Phorum templates\r\n     and for caching data in case \"file\" is set as the cache layer.<br/>\r\n     <br/>\r\n     For most installations, it will be fine to use the default temp directory\r\n     for the server (/tmp on UNIX systems and C:\\Windows\\Temp for Windows\r\n     systems).<br/>\r\n     <br/>\r\n     If your server has PHP Safe Mode enabled, you will need to create a\r\n     directory under your Phorum directory and make it writable by the web\r\n     server (you can use the directory \"./cache\" which was included in the\r\n     Phorum distribution for this purpose).");
$frm->addrow("Cache-Layer", $PHORUM['CACHECONFIG']['type']);
// calling mods
$frm = phorum_api_hook("admin_cache", $frm);
Пример #12
0
/*
* SMTP-Mail-Module
* made by Thomas Seifert
* email: thomas (at) phorum.org
*
*/
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']);
    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->show();
Пример #13
0
// create the time zone drop down array
for( $x = -23;$x <= 23;$x++ ) {
    $tz_range[$x] = $x;
}

include_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( "DNS Lookups", $frm->select_tag( "dns_lookup", array( "No", "Yes" ), $PHORUM["dns_lookup"] ) );

$row=$frm->addrow( "Use Cookies", $frm->select_tag( "use_cookies", array( "No", "Yes" ), $PHORUM["SETTINGS"]["use_cookies"] ) );

$row=$frm->addrow( "Hide Forums", $frm->select_tag( "hide_forums", array( "No", "Yes" ), $PHORUM["hide_forums"] ) );
$frm->addhelp($row, "Hide Forums", "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 Count in Forum List", $frm->select_tag( "show_new_on_index", array( "No", "Yes" ), $PHORUM["show_new_on_index"] ) );

$row=$frm->addrow( "Folder/Forum display style", $frm->select_tag( "use_new_folder_style", array( "Classic", "New" ), $PHORUM["use_new_folder_style"] ) );
$frm->addhelp($row, "Folder/Forum display style", "Since version 3, Phorum has included folders.  Until version 5.1, forums inside folders did not show until you clicked on the folder.  In 5.1, the list of forums in a folder can now be shown under that folder in the forum list.  This allows admins to organize a large list of forums all on one page." );

$row=$frm->addrow( "Enable Moderator Notifications", $frm->select_tag( "enable_moderator_notifications", array( "No", "Yes" ), $PHORUM["enable_moderator_notifications"] ) );
$frm->addhelp($row, "Enable Moderator Notifications", "By setting this to Yes, Phorum will display notice to the various kinds of moderators when they have a new item that requires their attention. For example, message moderators will see a notice whenever there is an unapproved message." );

$row=$frm->addrow( "User Post Edit Time Limit (minutes)", $frm->text_box( "user_edit_timelimit", $PHORUM["user_edit_timelimit"], 10) );
Пример #14
0
        $text .= "<div class=\"small\">Created by " . $info["author"] . "</div>";
    }
    if (isset($info["release_date"])) {
        $text .= "<div class=\"small\">Released " . $info["release_date"] . "</div>";
    }
    $moreinfo = array();
    if (isset($info["url"])) {
        $moreinfo[] = "<a href=\"" . $info["url"] . "\">web site</a>";
    }
    foreach (array('README', 'INSTALL', 'Changelog') as $file) {
        if (file_exists("./mods/{$name}/{$file}")) {
            $moreinfo[] = "<a target=\"_blank\" href=\"" . $PHORUM["http_path"] . "/mods/{$name}/{$file}\">{$file}</a>";
        }
    }
    if (!empty($moreinfo)) {
        $text .= "More info: <small>" . implode(" &bull; ", $moreinfo) . "</small>";
    }
    if (!$info['version_disabled']) {
        $frm->addrow($text, $frm->select_tag(base64_encode("mods_{$name}"), array("Off", "On"), $info['enabled']) . $settings_link);
    } else {
        $frm->addrow($text, $frm->select_tag(base64_encode("mods_{$name}"), array("Off"), 0, 'disabled="disabled"') . $settings_link);
        // Disable a module if it's enabled, but should be disabled based
        // on the Phorum version.
        if ($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();
        }
    }
}
$frm->show();
Пример #15
0
    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">
    change_image('<?php 
    print addslashes($smiley);
    ?>
');
    </script><?php 
}
// Show the configured list of smileys.
Пример #16
0
                <input type="submit" name="confirm" value="Yes" />&nbsp;<input type="submit" name="confirm" value="No" />
            </form>
        </div>

        <?php 
} else {
    include_once "./include/admin/PhorumInputForm.php";
    $frm = new PhorumInputForm("", "post", $submit);
    $frm->hidden("module", "banlist");
    $frm->hidden("curr", "{$curr}");
    $frm->addbreak($title);
    if ($curr == "NEW") {
        $frm->addmessage("Ban items can be used to deny new user registrations and\n             posting of (private) messages, based on various criteria.\n             If a ban item applies to a user action, then this action\n             will be fully blocked by Phorum. This can for example be used\n             to block user registrations and postings from certain IP\n             addresses or to prevent certain words from being used in\n             forum messages.<br />\n             <br />\n             If you want to fully ban a user, then it's best to\n             set \"Active\" to \"No\" for the user in the\n             \"Edit Users\" interface.");
    }
    $frm->addrow("String To Match", $frm->text_box("string", $string, 50));
    $row = $frm->addrow("Field To Match", $frm->select_tag("type", $ban_types, $type));
    $frm->addhelp($row, "Field To Match", "\n            Below, you will find an overview of what\n            ban items are used by what Phorum actions:<br/>\n            <br/>\n            <b>User registration</b>:<br/>\n            \"Name/User Name\" checks the new username<br/>\n            \"Email Address\" checks the new email address<br/>\n            \"IP Address/Hostname\" checks the visitor's IP<br/>\n            <br/>\n            <b>Posting forum messages by anonymous users</b><br/>\n            \"Name/User Name\" checks the author's name<br/>\n            \"Email Address\" checks the author's email address<br/>\n            \"Illegal Words (SPAM)\" checks the subject and body<br/>\n            \"IP Address/Hostname\" checks the author's IP<br/>\n            <br/>\n            <b>Posting forum messages by registered users</b><br/>\n            \"Name/User Name\" checks the author's username<br/>\n            \"User-Id (registered User)\" checks the author's user id<br/>\n            \"Email Address\" checks the author's email address<br/>\n            \"IP Address/Hostname\" checks the author's IP<br/>\n            \"Illegal Words (SPAM)\" checks the subject and body<br/>\n            <br/>\n            <b>Posting private messages</b><br/>\n            \"Name/User Name\" checks the sender's username<br/>\n            \"User-Id (registered User)\" checks the sender's user id<br/>\n            \"Email Address\" checks the sender's email address<br/>\n            \"IP Address/Hostname\" checks the sender's IP\n        ");
    $row = $frm->addrow("Compare As", $frm->select_tag("pcre", $match_types, $pcre) . "<div style=\"font-size:x-small\">If using PCRE for comparison, \"String To Match\" should be a valid PCRE expression.<br/>See <a href=\"http://php.net/pcre\" target=\"_blank\">the PHP manual</a> for more information about PCRE.</div>");
    $frm->addhelp($row, "Compare As", "\n            This setting can be used to specify the matching method\n            that has to be used for the ban item. There are two options:<br/>\n            <br/>\n            <ul>\n              <li><b>String</b><br/>\n                  The exact string from the \"String To Match\" field\n                  will be used for matching. Wildcards are not available\n                  for the String field type.<br/><br/></li>\n\n              <li><b>PCRE</b><br/>\n                  The \"String To Match\" field will be treated as\n                  a <a href=\"http://www.php.net/pcre\">Perl Compatible\n                  Regular Expression</a>.</li>\n            </ul>\n        ");
    $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();
    if ($curr == "NEW") {
        $PHORUM['banlists'] = phorum_db_get_banlists(true);
        unset($PHORUM['banlists'][PHORUM_BAD_WORDS]);
        echo "<hr class=\"PhorumAdminHR\" />";
        if (count($PHORUM['banlists'])) {
            echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
            echo "<tr>\n";
            echo "    <td class=\"PhorumAdminTableHead\">String</td>\n";
Пример #17
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();


?>
Пример #18
0
            }
            else{
                $row=$frm->addbreak("Edit Groups");
            }

            $groups= phorum_db_get_groups();
            $usergroups = phorum_user_get_groups($_REQUEST["user_id"]);

            $arr=array("Add A Group...");
            foreach($groups as $group_id=>$group){
                if(!isset($usergroups[$group_id]))
                    $arr[$group_id]=$group["name"];
            }

            if(count($arr)>1)
                $frm->addrow("Add A Group", $frm->select_tag("new_group", $arr));

            if(is_array($usergroups)){
                $group_options = array(PHORUM_USER_GROUP_REMOVE => "< Remove User From Group >",
                        PHORUM_USER_GROUP_SUSPENDED => "Suspended",
                        PHORUM_USER_GROUP_UNAPPROVED => "Unapproved",
                        PHORUM_USER_GROUP_APPROVED => "Approved",
                        PHORUM_USER_GROUP_MODERATOR => "Group Moderator");
                foreach($usergroups as $group_id => $group_perm){
                    $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();
Пример #19
0
    $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\" />";

    if(count($bad_words)){

        echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"PhorumAdminTable\" width=\"100%\">\n";
        echo "<tr>\n";
        echo "    <td class=\"PhorumAdminTableHead\">Word</td>\n";
        echo "    <td class=\"PhorumAdminTableHead\">Valid for Forum</td>\n";
        echo "    <td class=\"PhorumAdminTableHead\">&nbsp;</td>\n";
        echo "</tr>\n";

        foreach($bad_words as $key => $item){
Пример #20
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);
    } else {
        $frm->addrow($desc, $frm->checkbox("do_log_{$type}", "1", "", $settings["do_log_{$type}"]));
    }
}
$frm->show();
Пример #21
0
    $frm->hidden("section", "forums");
    // for getting back to the edit-page
    $frm->hidden('edit', '1');
    $frm->hidden("group_id", $_GET["group_id"]);
    $row = $frm->addbreak("Edit Forum Permissions");
    $frm->addhelp($row, "Forum Permissions", "Permissions given to groups overwrite any permissions granted by the forum properties.  Also, if a user is granted permissions directly to a forum in the user admin, any group permissions he has for that forum will be ignored.  If the user is a member of two or more groups that have permissions in the same forum, the permissions will be combined. (eg. If group A allows read and reply and group B allows create and moderate, the user will receive all four permissions.)");
    $forumpaths = phorum_get_forum_info(1);
    $perm_frm = $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_READ . "]", 1, "Read", $new_forum_permission & PHORUM_USER_ALLOW_READ) . "&nbsp;&nbsp;" . $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_REPLY . "]", 1, "Reply", $new_forum_permission & PHORUM_USER_ALLOW_REPLY) . "&nbsp;&nbsp;" . $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_NEW_TOPIC . "]", 1, "Create&nbsp;New&nbsp;Topics", $new_forum_permission & PHORUM_USER_ALLOW_NEW_TOPIC) . "&nbsp;&nbsp;" . $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_EDIT . "]", 1, "Edit&nbsp;Their&nbsp;Posts", $new_forum_permission & PHORUM_USER_ALLOW_EDIT) . "<br />" . $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_ATTACH . "]", 1, "Attach&nbsp;Files", $new_forum_permission & PHORUM_USER_ALLOW_ATTACH) . "<br />" . $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_MODERATE_MESSAGES . "]", 1, "Moderate Messages", $new_forum_permission & PHORUM_USER_ALLOW_MODERATE_MESSAGES) . "&nbsp;&nbsp;" . $frm->checkbox("new_permissions[" . PHORUM_USER_ALLOW_MODERATE_USERS . "]", 1, "Moderate Users", $new_forum_permission & PHORUM_USER_ALLOW_MODERATE_USERS) . "&nbsp;&nbsp;";
    $arr[] = "Add A Forum...";
    foreach ($forumpaths as $forum_id => $forumname) {
        if (empty($group["permissions"][$forum_id]) && $forums[$forum_id]['folder_flag'] == 0) {
            $arr[$forum_id] = $forumname;
        }
    }
    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");
Пример #22
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"] . ")";
    }
    // Compatibility modules are handles in a special way. These are
Пример #23
0
$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.");
$row = $frm->addrow("Enable posting option \"disable BBcode\"", $frm->checkbox("allow_disable_per_post", "1", "Yes", $PHORUM["mod_bbcode"]["allow_disable_per_post"]));
$frm->addhelp($row, "Enable posting option \"disable BBcode\"", "If this feature is enabled, then your users can get an extra option in the posting editor for disabling the BBcode handling for the posted message. This can be useful if the user wants to post a text about BBcode tags or a text that contains strings that unintentionally match BBcode tags.<br/><br/>To make this option visible, you will have to add the code <b>{HOOK \"tpl_editor_disable_bbcode\"}</b> to the posting.tpl template file at an appropriate spot.");
$row = $frm->addrow("Enable BBcode escape sequence \\[...]", $frm->checkbox("enable_bbcode_escape", "1", "Yes", $PHORUM["mod_bbcode"]["enable_bbcode_escape"]));
$frm->addhelp($row, "Enable BBcode escape sequence", "If this feature is enabled, then your users can prepend BBcode tags with a backslash character in order to let the BBcode module ignore the tag. This is mostly useful for posting BBcode examples in a forum message. In the final rendered message, the backslash character will be hidden. For example, the following code could be added to a message:<br/><pre>\\[b]example for bold text\\[/b]<br/>\\[url=http://www.phorum.org]URL example\\[/url]<br/><br/>These would be showed in the final message as:<br/><pre>[b]example for bold text[/b]<br/>[url=http://www.phorum.org]URL example[/url]");
$row = $frm->addbreak("Activation of BBcode tags");
$frm->addhelp($row, "Activation of BBcode tags", "Using the options below, you can configure which BBcode tags you want to make available to your users.<br/><br/>For most of the tags, you can additionally enable the editor tools button. If you have enabled the Editor Tools module, then doing so will add a button to the editor tool bar for that tag.");
foreach ($GLOBALS['PHORUM']['MOD_BBCODE']['BUILTIN'] as $tagname => $tag) {
    if (!isset($tag[BBCODE_INFO_DESCRIPTION])) {
        continue;
    }
    $options = $tag[BBCODE_INFO_HASEDITORTOOL] ? $options_with_editor_tools : $options_without_editor_tools;
    $value = isset($PHORUM['mod_bbcode']['enabled'][$tagname]) ? $PHORUM['mod_bbcode']['enabled'][$tagname] : $tag[BBCODE_INFO_DEFAULTSTATE];
    $frm->addrow($tag[BBCODE_INFO_DESCRIPTION], $frm->select_tag("enabled[{$tagname}]", $options, $value), "top");
}
$frm->show();
Пример #24
0
$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));
$frm->addrow("Make this forum visible in the forum index?", $frm->select_tag("active", array("No", "Yes"), $active));
$row = $frm->addrow("Virtual Root for descending forums/folders", $frm->checkbox("vroot", "1", "enabled", $vroot ? 1 : 0));
$frm->addhelp($row, "Virtual Root for descending forums/folders", "If you enable the virtual root feature for a folder, then this folder\n     will act as a separate Phorum installation. The folder will not be\n     visible in its parent folder anymore and if you visit the folder, it will\n     behave as if it were a Phorum root folder. This way you can run\n     multiple separated forums on a single Phorum installation.<br/><br/>\n     The users will be able to access all virtual root folders, unless you\n     use the permission system to setup different access rules.");
if ($foreign_vroot > 0) {
    $frm->addrow("This folder is in the Virtual Root of:", $folders[$foreign_vroot]);
}
$frm->addbreak("Inherit Folder Settings");
$inherit_id_options = phorum_api_forums_get_inherit_id_options($forum_id);
$row = $frm->addrow("Inherit the settings below this option from", $frm->select_tag("inherit_id", $inherit_id_options, $inherit_id) . $add_inherit_text);
$frm->addbreak("Display Settings");
$frm->addrow("Template", $frm->select_tag("template", phorum_api_template_list(TRUE), $template, $disabled_form_input));
$frm->addrow("Language", $frm->select_tag("language", phorum_api_lang_list(TRUE), $language, $disabled_form_input));
phorum_api_hook("admin_editfolder_form", $frm, $forum_settings);
$frm->show();
?>
Пример #25
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();
Пример #26
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)) {
    $frm->addbreak("Announcement Forums for Virtual Root Folders");
    foreach ($vroot_folders as $vroot_folder_id => $vroot_path) {
        $forum_list_vroot = phorum_get_forum_info(1, $vroot_folder_id);
        $forum_list_vroot[0] = 'No Announcements for this Virtual Root';
        asort($forum_list_vroot);
        $frm->addrow('VROOT "' . $vroot_path . '"', $frm->select_tag("vroot_forum_id[{$vroot_folder_id}]", $forum_list_vroot, isset($PHORUM["mod_announcements"]["vroot"][$vroot_folder_id]) ? $PHORUM["mod_announcements"]["vroot"][$vroot_folder_id] : 0));
    }
}
$frm->show();
Пример #27
0
    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"]));
$frm->addhelp($row, "Enable Moderator Notifications", "By setting this to Yes, Phorum will display notice to the various kinds of moderators when they have a new item that requires their attention. For example, message moderators will see a notice whenever there is an unapproved message.");
$row = $frm->addrow("User Post Edit Time Limit (minutes)", $frm->text_box("user_edit_timelimit", $PHORUM["user_edit_timelimit"], 10));
$frm->addhelp($row, "User Post Edit Time Limit (minutes)", "If set to a value larger then 0, this acts as a time limit for post editing. Users will only be able to edit their own posts within this time limit. This only applies if a user has the necessary permissions to edit their post, and does not affect moderators.");
$row = $frm->addrow("Track Edit Changes", $frm->select_tag("track_edits", array("No", "Yes", "Yes, Moderator Only"), $PHORUM["track_edits"]));
$frm->addhelp($row, "Track Edit Changes", "When enabled, the changes made to a message will be stored and viewed by users.  It can optionaly only be viewed by moderators.");
Пример #28
0
  <hr size="0"/>

  <h2>Manage language files</h2>
  This is a tool which can be used for easy maintenance of
  language files for Phorum. It will collect all actual used
  language strings from the Phorum software and generate an
  updated langage file for your language of choice based on
  those strings. In the generated language file, missing and
  deprecated strings will be clearly marked, so you can
  update the language file to match the running Phorum distribution.
INTRO
);
$frm->hidden("module", "manage_languages");
$frm->hidden("action", "update_lang");
$frm->addbreak("Update existing language file");
$frm->addrow("Generate updated version of an existing language file", $frm->select_tag("language", phorum_api_lang_list(), $language, 0));
$frm->show();
$frm = new PhorumInputForm("", "post", "Generate new language file");
$frm->addmessage(<<<INTRO
  In case there is no language file available for your language or
  if you want to create a new language file all of your own, you can
  generate a new language file using the form below.
INTRO
);
$frm->hidden("module", "manage_languages");
$frm->hidden("action", "generate_lang");
$frm->addbreak("Generate a new language file");
$frm->addrow("The basename for the generated file", $frm->text_box('filename', $filename, 20));
$frm->addrow("The display name for the language", $frm->text_box('displayname', $displayname, 20));
$frm->show();
exit;
Пример #29
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();
}
Пример #30
0
    uasort($plugins, "plugin_sort");

    foreach($plugins as $name => $plugin){

        if(isset($mods[$name])){
            $thisval=$mods[$name];
        } elseif(isset($PHORUM["mods"]["$name"])){
            $thisval=$PHORUM["mods"]["$name"];
        } else {
            $thisval=0;
        }

        if($plugin["settings"]){
            if($thisval==0){
                $settings_link="<br /><a href=\"javascript:alert('You can not edit settings for a module unless it is turned On.');\">Settings</a>";
            } else {
                $settings_link="<br /><a href=\"$_SERVER[PHP_SELF]?module=modsettings&mod=$name\">Settings</a>";
            }
        } else {
            $settings_link="";
        }

        $frm->hidden(base64_encode("hooks_$name"), $plugin["hooks"]);
        $frm->addrow("$plugin[title]<div class=\"small\">".wordwrap($plugin["desc"], 90, "<br />")."</div>", $frm->select_tag(base64_encode("mods_$name"), array("Off", "On"), $thisval).$settings_link);

    }

    $frm->show();

?>