本文整理汇总了PHP中PhorumInputForm::addbreak方法的典型用法代码示例。如果您正苦于以下问题:PHP PhorumInputForm::addbreak方法的具体用法?PHP PhorumInputForm::addbreak怎么用?PHP PhorumInputForm::addbreak使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhorumInputForm
的用法示例。
在下文中一共展示了PhorumInputForm::addbreak方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: phorum_htmlpurifier_show_form
function phorum_htmlpurifier_show_form()
{
if (phorum_htmlpurifier_config_file_exists()) {
phorum_htmlpurifier_show_config_info();
return;
}
global $PHORUM;
$config = phorum_htmlpurifier_get_config();
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "htmlpurifier");
// this is the directory name that the Settings file lives in
if (!empty($error)) {
echo "{$error}<br />";
}
$frm->addbreak("Edit settings for the HTML Purifier module");
$frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'wysiwyg\']</code>.
When checked, contents sent for edit are now purified and the
informative message is disabled. If your WYSIWYG editor is disabled for
admin edits, you can safely keep this unchecked.</p>');
$frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM['mod_htmlpurifier']['wysiwyg']));
$frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'suppress_message\']</code>,
which removes the big how-to use
HTML Purifier message.</p>');
$frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM['mod_htmlpurifier']['suppress_message']));
$frm->addMessage('<p>Click on directive links to read what each option does
(links do not open in new windows).</p>
<p>For more flexibility (for instance, you want to edit the full
range of configuration directives), you can create a <tt>config.php</tt>
file in your <tt>mods/htmlpurifier/</tt> directory. Doing so will,
however, make the web configuration interface unavailable.</p>');
require_once 'HTMLPurifier/Printer/ConfigForm.php';
$htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s');
$htmlpurifier_form->setTextareaDimensions(23, 7);
// widen a little, since we have space
$frm->addMessage($htmlpurifier_form->render($config, $PHORUM['mod_htmlpurifier']['directives'], false));
$frm->addMessage("<strong>Warning: Changing HTML Purifier's configuration will invalidate\r\n the cache. Expect to see a flurry of database activity after you change\r\n any of these settings.</strong>");
$frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false));
// hack to include extra styling
echo '<style type="text/css">' . $htmlpurifier_form->getCSS() . '
.hp-config {margin-left:auto;margin-right:auto;}
</style>';
$js = $htmlpurifier_form->getJavaScript();
echo '<script type="text/javascript">' . "<!--\n{$js}\n//-->" . '</script>';
$frm->show();
}
示例2: phorum_htmlpurifier_show_migrate_sigs_form
function phorum_htmlpurifier_show_migrate_sigs_form()
{
$frm = new PhorumInputForm('', "post", "Migrate");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "htmlpurifier");
$frm->hidden("migrate-sigs", "1");
$frm->addbreak("Migrate user signatures to HTML");
$frm->addMessage('This operation will migrate your users signatures
to HTML. <strong>This process is irreversible and must only be performed once.</strong>
Type in yes in the confirmation field to migrate.');
if (!file_exists(dirname(__FILE__) . '/../migrate.php')) {
$frm->addMessage('Migration file does not exist, cannot migrate signatures.
Please check <tt>migrate.bbcode.php</tt> on how to create an appropriate file.');
} else {
$frm->addrow('Confirm:', $frm->text_box("confirmation", ""));
}
$frm->show();
}
示例3: interactive
</div>
This module sets up some hurdles for forum spammers. It implements
both interactive (CAPTCHA) and non-interactive anti-spam methods
to keep away spam bots. On this page, you can control exactly
what spam hurdles to enable.
<br style="clear:both" />
<?php
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "spamhurdles");
// ----------------------------------------------------------------------
// Configure log settings
// ----------------------------------------------------------------------
$frm->addbreak("Log settings");
if (!file_exists('./mods/event_logging')) {
$check = '<span style="color:red">The Event Logging module ' . 'is currently not installed; logging cannot ' . 'be enabled</span>';
$disabled = 'disabled="disabled"';
$PHORUM["mod_spamhurdles"]["log_events"] = 0;
} elseif (empty($PHORUM['mods']['event_logging'])) {
$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'));
示例4: PhorumInputForm
$frm->addrow("Admin Email Address", $frm->text_box("admin_email", $admin_email, 30));
$frm->addrow("Admin Password", $frm->text_box("admin_pass", "", 30, 0, true));
$frm->addrow("(again)", $frm->text_box("admin_pass2", "", 30, 0, true));
$frm->show();
break;
case "done":
$cont_url = phorum_admin_build_url();
$PHORUM['DB']->update_settings(array("installed" => 1));
echo "The setup is complete. You can now go to <a href=\"{$cont_url}\">the admin</a> and start making Phorum all your own.<br /><br /><strong>Here are some things you will want to look at:</strong><br /><br /><a href=\"{$_SERVER['PHP_SELF']}?module=settings\">The General Settings page</a><br /><br /><a href=\"{$_SERVER['PHP_SELF']}?module=mods\">Pre-installed modules</a><br /><br /><a href=\"docs/faq.txt\">The FAQ</a><br /><br /><a href=\"docs/performance.txt\">How to get peak performance from Phorum</a><br /><br /><strong>For developers:</strong><br /><br /><a href=\"docs/creating_mods.txt\">Module Creation</a><br /><br /><a href=\"docs/permissions.txt\">How Phorum permisssions work</a><br /><br /><a href=\"docs/CODING-STANDARDS\">The Phorum Team's codings standards</a>";
break;
case "modules":
// Retrieve a list of available modules.
require_once './include/api/modules.php';
$list = phorum_api_modules_list();
$frm = new PhorumInputForm("", "post", "Continue ->");
$frm->addbreak("Optional modules");
$frm->hidden("module", "install");
$frm->hidden("sanity_checks_done", "1");
$frm->hidden("step", "modules");
$frm->hidden("do_modules_update", "1");
$frm->addmessage("Phorum has a very robust module system. The following modules are\n included with the distribution. You can find more modules at the\n Phorum web site. Some modules may have additional configuration\n options, which are not available during install. To configure the\n modules, click the \"Modules\" menu item in the admin interface\n after installation is done.");
foreach ($list['modules'] as $name => $info) {
// Skip the compatibility modules.
// These are enabled automatically by Phorum when required.
if (!empty($info['compat'])) {
continue;
}
// Should not happen.
if ($info['version_disabled']) {
continue;
}
示例5: 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();
示例6: PhorumInputForm
$nr_of_enabled_tags++;
}
}
}
// Store the new settings array.
$PHORUM['DB']->update_settings(array('mod_bbcode' => $PHORUM['mod_bbcode']));
phorum_admin_okmsg("The settings were successfully saved.");
if ($nr_of_enabled_tags > 0 && empty($PHORUM['mods']['editor_tools'])) {
phorum_admin_error("<b>Notice:</b> You have configured one or more BBcode tags to add a button to the editor tool bar. However, you have not enabled the Editor Tools module. If you want to use the tool buttons, then remember to activate the Editor Tools module.");
}
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "bbcode");
$frm->addbreak("General settings for the BBcode module");
$row = $frm->addrow("Open links in new window", $frm->checkbox("links_in_new_window", "1", "Yes", $PHORUM["mod_bbcode"]["links_in_new_window"]));
$frm->addhelp($row, "Open links in new window", "When users post links on your forum, you can choose whether to open these in a new window or not.");
$row = $frm->addrow("Turn bare URLs into clickable links", $frm->checkbox("process_bare_urls", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_urls"]));
$frm->addhelp($row, "Turn bare URLs into clickable links", "If you enable this option, then the BBcode module will try to detect bare URLs in the message (URLs that are not surrounded by [url]...[/url] BBcode tags) and turn those into clickable links (as if they were surrounded by [url]...[/url]).");
$row = $frm->addrow("Turn bare email addresses into clickable links", $frm->checkbox("process_bare_email", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_email"]));
$frm->addhelp($row, "Turn bare email addresses into clickable links", "If you enable this option, then the BBcode module will try to detect bare email addresses in the message (addresses that are not surrounded by [email]...[/email] BBcode tags) and turn those into clickable links (as if they were surrounded by [email]...[/email]).");
$row = $frm->addrow("Show full URLs", $frm->checkbox("show_full_urls", "1", "Yes", $PHORUM["mod_bbcode"]["show_full_urls"]));
$frm->addhelp($row, "Show full URLs", "By default, URLs are truncated by phorum to show only [www.example.com]. This is done to prevent very long URLs from cluttering and distrurbing the web site layout. By enabling this feature, you can suppress the truncation, so full URLs are shown.");
$row = $frm->addrow("Add 'rel=nofollow' to links that are posted in your forum", $frm->checkbox("rel_no_follow", "1", "Yes", $PHORUM["mod_bbcode"]["rel_no_follow"]));
$frm->addhelp($row, "Add 'rel=nofollow' to links", 'You can enable Google\'s rel="nofollow" tag for links that are posted in your forums. This tag is used to discourage spamming links to web sites in forums (which can be done to influence search engines by implying that the site is a popular one, because of all the links).<br/><br/>Note that this does not stop spam links from being posted, but it does mean that spammers do not get any credit from Google for that link.');
$row = $frm->addrow("Enable BBcode quoting using the [quote] tag", $frm->checkbox("quote_hook", "1", "Yes", $PHORUM["mod_bbcode"]["quote_hook"]));
$frm->addhelp($row, "Enable BBcode [quote]", "If this feature is enabled, then quoting of messages is not done using the standard Phorum method (which resembles email message quoting), but using the BBcode module's quoting method instead. This means that the quoted text is placed within a [quote Author]...[/quote] bbcode block.<br/><br/>Two of the advantages of using this quote method is that the quoted message can be styles though CSS code and that no word wrapping is applied to the text.");
$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"]));
示例7: isset
$submit = "Add";
// Setup data for edit mode.
} else {
$name = $field['name'];
$length = $field['length'];
$html_disabled = $field['html_disabled'];
$show_in_admin = isset($field['show_in_admin']) ? $field['show_in_admin'] : 0;
$title = "Edit Profile Field";
$submit = "Update";
}
// Display the custom profile field editor.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", $submit);
$frm->hidden("module", "customprofile");
$frm->hidden("curr", "{$curr}");
$frm->addbreak($title);
$row = $frm->addrow("Field Name", $frm->text_box('name', $name, 50));
$frm->addhelp($row, "Field Name", "This is the name to assign to the custom profile field. Because it must be possible to use this name as the name property for an input element in an HTML form, there are a few restrictions to it:<br/><ul><li>it can only contain letters, numbers<br/> and underscores (_);</li><li>it must start with a letter.</li></ul>");
$frm->addrow("Field Length (Max. " . PHORUM_MAX_CPLENGTH . ")", $frm->text_box("length", $length, 50));
$row = $frm->addrow("Disable HTML", $frm->checkbox("html_disabled", 1, "Yes", $html_disabled));
$frm->addhelp($row, "Disable HTML", "\n If this option is enabled, then HTML code will not be usable\n in this field. When displaying the custom field's data,\n Phorum will automatically replace special HTML characters\n with their safe HTML counter parts.<br/>\n <br/>\n There are two possible reasons for disabling it:<br/>\n <ol>\n <li>You need HTML in this field and run a module which formats\n the field data into safe html (before storing it to the database\n or before displaying it on screen).\n <li>You run a module that needs to store an array in the field.\n </ol>\n So in practice, you only disable this option if module documentation tells\n you to do so or if you are writing a module which needs this. If you don't\n understand what's going on here, then don't disable the option.<br/>\n <br/>\n To learn about the security risks involved, search for \"XSS\" and\n \"cross site scripting\" on the internet.");
$row = $frm->addrow("Show in user admin", $frm->checkbox("show_in_admin", 1, "Yes", $show_in_admin));
$frm->addhelp($row, "Show in user admin", "If this option is enabled, then the contents of the field will be displayed on the user details page in the Phorum admin interface (section \"Edit Users\").");
$frm->show();
// If we are not in edit mode, we show the list of available profile fields.
if ($curr == "NEW") {
print "Creating a custom profile field here merely allows for the use\n of the field. If you want to use it as an extra info field for\n your users, you will need to edit the register, control center\n and profile templates to actually allow users to enter data in\n the fields and have it stored. You will have to use the name\n you enter here as the name property of the HTML form element.\n <hr class=\"PhorumAdminHR\" />";
if (isset($PHORUM['PROFILE_FIELDS']["num_fields"])) {
unset($PHORUM['PROFILE_FIELDS']["num_fields"]);
}
$active_fields = 0;
示例8: count
if (!defined("PHORUM_ADMIN")) {
return;
}
include_once "./include/format_functions.php";
include_once "./include/api/file_storage.php";
// Execute file purging for real?
if (count($_POST)) {
$deleted = phorum_api_file_purge_stale(TRUE);
phorum_admin_okmsg("Purged " . count($deleted) . " files");
}
// Retrieve a list of stale files.
$purge_files = phorum_api_file_purge_stale(FALSE);
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", count($purge_files) ? "Purge stale files now" : "Refresh screen");
$frm->hidden("module", "file_purge");
$frm->addbreak("Purging stale files...");
$frm->addmessage("It's possible that there are files stored in the Phorum system,\n which no longer are linked to anything. For example, if users\n write messages with attachments, but do not post them in the end,\n the attachment files will be left behind in the database.\n Using this maintenance tool, you can purge those stale files\n from the system.");
$prev_reason = '';
if (count($purge_files)) {
$frm->addbreak("There are currently " . count($purge_files) . " stale files in the database");
foreach ($purge_files as $id => $file) {
if ($file['reason'] != $prev_reason) {
$prev_reason = $file['reason'];
$frm->addsubbreak("Reason: " . $file['reason']);
}
$frm->addrow(htmlspecialchars($file["filename"]), phorum_filesize($file["filesize"]));
}
} else {
$frm->addmessage("There are currently no stale files in the database");
}
$frm->show();
示例9: PhorumInputForm
if (!isset($PHORUM["mod_example_settings"]["displaytext"])) {
$PHORUM["mod_example_settings"]["displaytext"] = "";
}
if (!isset($PHORUM["mod_example_settings"]["displaycount"])) {
$PHORUM["mod_example_settings"]["displaycount"] = 1;
}
// We build the settings form by using the PhorumInputForm object. When
// creating your own settings screen, you'll only have to change the
// "mod" hidden parameter to the name of your own module.
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "example_settings");
// Here we display an error in case one was set by saving
// the settings before.
if (!empty($error)) {
echo "{$error}<br />";
}
// This adds a break line to your form, with a description on it.
// You can use this to separate your form into multiple sections.
$frm->addbreak("Edit settings for the example_settings module");
// This adds a text message to your form. You can use this to
// explain things to the user.
$frm->addmessage("This is the settings screen for the example_settings module. This module is only written for demonstrating the use of a settings screen for you own modules. The module itself will display a configurable text for a configurable number of times on screen.");
// This adds a row with a form field for entering the display text.
$frm->addrow("Text to display (default: Hello, world!)", $frm->text_box('displaytext', $PHORUM["mod_example_settings"]["displaytext"], 50));
// This adds another row with a form field for entering the display count.
$frm->addrow("Number of times to display", $frm->text_box('displaycount', $PHORUM["mod_example_settings"]["displaycount"], 5));
// We are done building the settings screen.
// By calling show(), the screen will be displayed.
$frm->show();
示例10: array
<?php
if (!defined("PHORUM_ADMIN")) {
return;
}
// Apply default settings.
require_once './mods/editor_tools/defaults.php';
// Save the settings to the database.
if (count($_POST)) {
$PHORUM["mod_editor_tools"] = array("enable_help" => $_POST["enable_help"] ? 1 : 0);
$PHORUM['DB']->update_settings(array("mod_editor_tools" => $PHORUM["mod_editor_tools"]));
phorum_admin_okmsg("The settings were successfully saved.");
}
// Build the settings form.
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "editor_tools");
$frm->addbreak("Edit settings for the Editor Tools module");
$row = $frm->addrow("Enable Help tool", $frm->checkbox("enable_help", "1", "", $PHORUM["mod_editor_tools"]["enable_help"]) . ' Yes');
$frm->addhelp($row, "Enable Help tool", "If you enable this option, then a help button will be added to\n the tool bar. This help button can be used to open help pages\n that are registered by other modules (e.g. to show a list of\n smileys or available BBcode tags).");
$frm->show();
示例11: isset
$settings["resolve_hostnames"] = isset($_POST["resolve_hostnames"]) ? 1 : 0;
$settings["max_log_entries"] = (int) $_POST["max_log_entries"];
$settings["min_log_level"] = (int) $_POST["min_log_level"];
foreach ($eventtypes as $type => $desc) {
$settings["do_log_{$type}"] = isset($_POST["do_log_{$type}"]) ? 1 : 0;
}
phorum_db_update_settings(array("mod_event_logging" => $settings));
phorum_admin_okmsg("The settings were successfully saved.");
}
// Create the settings form.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "event_logging");
$frm->hidden("el_action", "settings");
$frm->addbreak("General Settings");
$row = $frm->addrow("Minimum log level", $frm->select_tag("min_log_level", $GLOBALS["PHORUM"]["DATA"]["MOD_EVENT_LOGGING"]["LOGLEVELS"], $settings["min_log_level"]));
$frm->addhelp($row, "Minimum log level", "This option configures the minimum log level for which log messages are written to the event log. Events with a lower log level will not be written.<br/><br/>\"Debug\" is the lowest log level and \"Alert\" the highest, so to log all events, set this option to \"Debug\".");
$row = $frm->addrow("Maximum amount of stored event logs (0 = unlimited)", $frm->text_box("max_log_entries", $settings["max_log_entries"], 5));
$frm->addhelp($row, "Maximum amount of stored event logs", "This option configures the maximum amount of event logs that can be stored in the database at a given time. If the amount of event logs grows larger than this configured maximum, then old entries will be automatically cleaned up.<br/><br/>If you do not want a limit on the number of event logs, then set this option to 0 (zero).");
$row = $frm->addrow("Resolve IP addresses to host names when writing the event log", $frm->checkbox("resolve_hostnames", "1", "", $settings["resolve_hostnames"]));
$frm->addhelp($row, "Resolve IP addresses", "If this option is enabled, the IP address of the visitor will immediately be resolved into its hostname. Enabling this option can result in delays for the user, in case hostname lookups are slow for some reason.<br/><br/><b>Because of the performance penalty, we do not recommend enabling this option, unless you really need it and know what you are doing.</b>");
$row = $frm->addbreak("Which events to log");
$frm->addhelp($row, "Which events to log", "Below, you see the events which the Event Logging module can log for you. Enable the checkbox for each event type that you wish to appear in the event log. You can use this to limit the amount of entries, in case you are not interested in some of them.<br/><br/>Note that other modules can also write entries to the event log. If you need to suppress logging for those, then please consult the settings and documentation of those modules.");
foreach ($eventtypes as $type => $desc) {
if ($desc === NULL) {
$frm->addsubbreak($type);
} else {
$frm->addrow($desc, $frm->checkbox("do_log_{$type}", "1", "", $settings["do_log_{$type}"]));
}
}
示例12: PhorumInputForm
$frm->show();
echo "<br /><hr class=\"PhorumAdminHR\" /><br /><a name=\"groups\"></a>";
$frm = new PhorumInputForm ("", "post", "Update");
$frm->hidden("user_id", $_REQUEST["user_id"]);
$frm->hidden("module", "users");
$frm->hidden("section", "groups");
$extra_opts = "";
// if its an admin, let the user know that the admin will be able to act as a moderator no matter what
if ($user["admin"]){
$row=$frm->addbreak("Edit Groups (Admins can act as a moderator of every group, regardless of these values)");
}
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)
示例13: list
list($status, $error, $solution) = call_user_func($check["function"], $is_install);
$PHORUM["SANITY_CHECKS"]["CHECKS"][] = array('id' => $check["id"], 'description' => $check["description"], 'status' => $status, 'error' => $error, 'solution' => $solution);
$PHORUM["SANITY_CHECKS"]["COUNTERS"][$status]++;
}
// If the sanity checks are called from the installation,
// the we're done.
if ($module == "install") {
return;
}
// ========================================================================
// Build the sanity checking admin page.
// ========================================================================
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Restart sanity checks");
$frm->hidden("module", "sanity_checks");
$frm->addbreak("Phorum System Sanity Checks");
$frm->addmessage("Below you will find the results for a number of sanity checks\n that have been performed on your system. If you see any\n warnings or errors, then read the comments for them and \n try to resolve the issues.");
// Show sanity check results.
foreach ($PHORUM["SANITY_CHECKS"]["CHECKS"] as $check) {
if ($check["status"] != PHORUM_SANITY_SKIP) {
if (isset($check["error"])) {
$check["error"] = str_replace("\n", " ", $check["error"]);
}
if (isset($check["solution"])) {
$check["solution"] = str_replace("\n", " ", $check["solution"]);
}
$display = $status2display[$check["status"]];
$block = "<div style=\"color:{$display[1]};background-color:{$display[0]};text-align:center;border:1px solid black;\">{$display[2]}</div>";
$row = $frm->addrow($check['description'], $block);
if (!empty($check["error"])) {
if (!empty($check["solution"])) {
示例14: while
// Handle batch.
$updated = 0;
while ($user = phorum_db_fetch_row($res, DB_RETURN_ASSOC)) {
$updated++;
// We save an empty user, to make sure that the display name in the
// database is up-to-date. This will already run needed updates in
// case the display name changed ...
phorum_api_user_save(array("user_id" => $user["user_id"]));
// ... but still we run the name updates here, so inconsitencies
// are flattened out.
$user = phorum_api_user_get($user["user_id"]);
phorum_db_user_display_name_updates(array("user_id" => $user["user_id"], "display_name" => $user["display_name"]));
}
if ($updated == 0) {
$frm = new PhorumInputForm("", "post", "Finish");
$frm->addbreak("Display names updated");
$frm->addmessage("The display names are all updated successfully.");
$frm->show();
return;
}
}
// Retrieve user count.
$user_count = isset($_REQUEST['user_count']) ? (int) $_REQUEST['user_count'] : phorum_db_user_count();
$perc = floor(($batch + 1) * $batchsize / $user_count * 100);
if ($perc > 100) {
$perc = 100;
}
?>
<strong>Running display name updates.</strong><br/>
<strong>This might take a while ...</strong><br/><br/>
示例15: elseif
$PHORUM[$key] = $val;
}
} 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']);