本文整理汇总了PHP中PhorumInputForm::select_tag方法的典型用法代码示例。如果您正苦于以下问题:PHP PhorumInputForm::select_tag方法的具体用法?PHP PhorumInputForm::select_tag怎么用?PHP PhorumInputForm::select_tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhorumInputForm
的用法示例。
在下文中一共展示了PhorumInputForm::select_tag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$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: array
}
}
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: PhorumInputForm
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: elseif
$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: PhorumInputForm
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()"') . "  \n <input type=\"submit\" name=\"prevpage\" value=\"<<\"/>\n page " . $frm->select_tag("page", $pagelist, $page, 'onchange="this.form.submit()"') . " of {$pages}\n <input type=\"submit\" name=\"nextpage\" value=\">>\"/>\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: isset
$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: PhorumInputForm
$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: PhorumInputForm
}
}
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: elseif
} 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: messages
$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: elseif
} 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: array
/*
* 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: PhorumInputForm
// 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: array
$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(" • ", $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: PhorumInputForm
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);\"") . " <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.