本文整理汇总了PHP中PhorumInputForm::text_box方法的典型用法代码示例。如果您正苦于以下问题:PHP PhorumInputForm::text_box方法的具体用法?PHP PhorumInputForm::text_box怎么用?PHP PhorumInputForm::text_box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhorumInputForm
的用法示例。
在下文中一共展示了PhorumInputForm::text_box方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: PhorumInputForm
phorum_admin_error( $error );
}
// 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." );
示例3: PhorumInputForm
$frm->addmessage($message);
$frm->hidden("step", "create_tables");
$frm->hidden("module", "install");
$frm->hidden("sanity_checks_done", "1");
$frm->show();
break;
case "create_admin_user":
$frm = new PhorumInputForm("", "post");
$frm->hidden("step", "create_admin_user");
$frm->hidden("module", "install");
$frm->hidden("sanity_checks_done", "1");
$frm->addbreak("Creating An Administrator");
$frm->addmessage("Please enter the following information. This can be your user information or you can create an administrator that is separate from yourself.<br /><br />Note: If you are using a pre-existing authentication database, please enter the username and password of the admin user that already exists.");
$admin_user = isset($_POST["admin_user"]) ? $_POST["admin_user"] : "";
$admin_email = isset($_POST["admin_email"]) ? $_POST["admin_email"] : "";
$frm->addrow("Admin User Name", $frm->text_box("admin_user", $admin_user, 30));
$frm->addrow("Admin Email Address", $frm->text_box("admin_email", $admin_email, 30));
$frm->addrow("Admin Password", $frm->text_box("admin_pass", "", 30, 0, true));
$frm->addrow("(again)", $frm->text_box("admin_pass2", "", 30, 0, true));
$frm->show();
break;
case "done":
$cont_url = phorum_admin_build_url();
$PHORUM['DB']->update_settings(array("installed" => 1));
echo "The setup is complete. You can now go to <a href=\"{$cont_url}\">the admin</a> and start making Phorum all your own.<br /><br /><strong>Here are some things you will want to look at:</strong><br /><br /><a href=\"{$_SERVER['PHP_SELF']}?module=settings\">The General Settings page</a><br /><br /><a href=\"{$_SERVER['PHP_SELF']}?module=mods\">Pre-installed modules</a><br /><br /><a href=\"docs/faq.txt\">The FAQ</a><br /><br /><a href=\"docs/performance.txt\">How to get peak performance from Phorum</a><br /><br /><strong>For developers:</strong><br /><br /><a href=\"docs/creating_mods.txt\">Module Creation</a><br /><br /><a href=\"docs/permissions.txt\">How Phorum permisssions work</a><br /><br /><a href=\"docs/CODING-STANDARDS\">The Phorum Team's codings standards</a>";
break;
case "modules":
// Retrieve a list of available modules.
require_once './include/api/modules.php';
$list = phorum_api_modules_list();
$frm = new PhorumInputForm("", "post", "Continue ->");
示例4: 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();
示例5: PhorumInputForm
$frm = new PhorumInputForm("", "post");
if (defined("PHORUM_DEFAULT_OPTIONS")) {
$frm->hidden("module", "forum_defaults");
$title = "Edit the default forum settings";
} elseif (defined("PHORUM_EDIT_FORUM")) {
$frm->hidden("module", "editforum");
$frm->hidden("forum_id", $forum_id);
$title = "Edit settings for forum \"{$name}\" (Id: {$forum_id})";
} else {
$frm->hidden("module", "newforum");
$title = "Create a new forum";
}
$frm->addbreak($title);
// Options that are only required when editing or creating a forum.
if (!defined("PHORUM_DEFAULT_OPTIONS")) {
$frm->addrow("Forum Title", $frm->text_box("name", $name, 30, 50));
$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
示例6: PhorumInputForm
if($error){
phorum_admin_error($error);
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm ("", "post", $submit);
$frm->hidden("module", "customprofile");
$frm->hidden("curr", "$curr");
$frm->addbreak($title);
$frm->addrow("Field Name", $frm->text_box("string", $string, 50));
$frm->addrow("Field Length (Max. 65000)", $frm->text_box("length", $length, 50));
$frm->addrow("Disable HTML", $frm->checkbox("html_disabled",1,"Yes",$html_disabled));
$frm->show();
echo "This will only add the field to the list of allowed fields. You will need to edit the register and profile templates to actually allow users to use the fields. Use the name you enter here as the name property of the HTML form element.";
if($curr=="NEW"){
echo "<hr class=\"PhorumAdminHR\" />";
if(isset($PHORUM['PROFILE_FIELDS']["num_fields"]))
unset($PHORUM['PROFILE_FIELDS']["num_fields"]);
if(count($PHORUM["PROFILE_FIELDS"])){
示例7: isset
$settings["min_length"] = (int) $_POST["min_length"];
$settings["only_lowercase"] = isset($_POST["only_lowercase"]) ? 1 : 0;
// Valid chars is a bit special.
$settings["valid_chars"] = isset($_POST["valid_chars"]) ? implode("", array_keys($_POST["valid_chars"])) : "";
// Take care of applying sane settings.
if ($settings["min_length"] < 0) {
$settings["min_length"] = 0;
}
if ($settings["max_length"] < $settings["min_length"] && $settings["max_length"] != 0) {
$settings["max_length"] = $settings["min_length"];
}
// Save settings array.
$PHORUM["mod_username_restrictions"] = $settings;
phorum_db_update_settings(array("mod_username_restrictions" => $settings));
phorum_admin_okmsg("The module settings were successfully saved.");
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "username_restrictions");
$frm->addbreak("Edit settings for the username restrictions module");
$frm->addrow("Minimum username length (0 = no restriction)", $frm->text_box('min_length', $PHORUM["mod_username_restrictions"]["min_length"], 6));
$frm->addrow("Maximum username length (0 = no restriction)", $frm->text_box('max_length', $PHORUM["mod_username_restrictions"]["max_length"], 6));
$checkboxes = '';
foreach ($valid_chars_options as $k => $v) {
$enabled = strpos($PHORUM["mod_username_restrictions"]["valid_chars"], $k) === FALSE ? 0 : 1;
$checkboxes .= $frm->checkbox("valid_chars[{$k}]", "1", "", $enabled) . " {$v}<br/>";
}
$frm->addrow("Valid username characters (check none for no restrictions)", $checkboxes);
$frm->addrow("Allow only lower case characters", $frm->checkbox("only_lowercase", "1", "", $PHORUM["mod_username_restrictions"]["only_lowercase"]) . ' Yes');
$frm->show();
示例8: foreach
$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();
示例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: time
if ($user_id && phorum_api_user_set_active_user(PHORUM_ADMIN_SESSION, $user_id) && phorum_api_user_session_create(PHORUM_ADMIN_SESSION)) {
// update the token and time
$GLOBALS["PHORUM"]["user"]['settings_data']['admin_token_time'] = time();
$sig_data = $GLOBALS["PHORUM"]["user"]['user_id'] . time() . $GLOBALS["PHORUM"]["user"]['username'];
$GLOBALS["PHORUM"]["user"]['settings_data']['admin_token'] = phorum_api_sign($sig_data);
$GLOBALS["PHORUM"]['admin_token'] = $GLOBALS["PHORUM"]["user"]['settings_data']['admin_token'];
$tmp_user = array('user_id' => $GLOBALS["PHORUM"]["user"]['user_id'], 'settings_data' => $GLOBALS["PHORUM"]["user"]['settings_data']);
phorum_api_user_save($tmp_user);
if (!empty($_POST["target"])) {
$target_url = phorum_admin_build_url($_POST['target'], TRUE);
phorum_api_redirect($target_url);
} else {
$redir_url = phorum_admin_build_url(NULL, TRUE);
phorum_api_redirect($redir_url);
}
exit;
} else {
/**
* TODO Move to User API.
*/
phorum_api_hook("failed_login", array("username" => $_POST["username"], "password" => $_POST["password"], "location" => "admin"));
}
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
if (!empty($_SERVER["QUERY_STRING"])) {
$frm->hidden("target", htmlspecialchars($_SERVER["QUERY_STRING"], ENT_COMPAT, $PHORUM["DATA"]['CHARSET']));
}
$frm->addrow("Username", $frm->text_box("username", "", 30));
$frm->addrow("Password", $frm->text_box("password", "", 30, 0, true));
$frm->show();
示例11: PhorumInputForm
$frm = new PhorumInputForm ("", "post", "Update");
$frm->hidden("module", "users");
$frm->hidden("section", "main");
$frm->hidden("user_id", $_REQUEST["user_id"]);
$frm->hidden("fk_campsite_user_id", $user["fk_campsite_user_id"]);
$frm->addbreak("Edit User");
$frm->addrow("User Name", htmlspecialchars($user["username"])." <a href=\"#forums\">Edit Forum Permissions</a> <a href=\"#groups\">Edit Groups</a>");
$frm->addrow("Email", $frm->text_box("email", $user["email"], 50));
$frm->addrow("Password (Enter to change)", $frm->text_box("password1",""));
$frm->addrow("Password (Confirmation)", $frm->text_box("password2",""));
$frm->addrow("Signature", $frm->textarea("signature", htmlspecialchars($user["signature"])));
$frm->addrow("Active", $frm->select_tag("active", array("No", "Yes"), $user["active"]));
$frm->addrow("Administrator", $frm->select_tag("admin", array("No", "Yes"), $user["admin"]));
$frm->addrow("Registration Date", phorum_date("%m/%d/%Y %I:%M%p",$user['date_added']));
$row=$frm->addrow("Date last active", phorum_date("%m/%d/%Y %I:%M%p",$user['date_last_active']));
$frm->addhelp($row, "Date last active", "This shows the date, when the user was last seen in the forum. Check your setting on \"Track user usage\" in the \"General Settings\". As long as this setting is not enabled, the activity will not be tracked.");
示例12: PhorumInputForm
<input type="hidden" name="delete" value="1" />
<input type="submit" name="confirm" value="Yes" /> <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";
示例13: elseif
$frm->hidden("module", "forum_defaults");
$frm->hidden("forum_id", 0);
$title = "Default Forum Settings";
} 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.
*
示例14: 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;
}
$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];
示例15: foreach
$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("" => "");
$sources = array_merge($sources, event_logging_getsources());
$row = $frm->addrow("Source to display", $frm->select_tag("source", $sources, isset($_POST["source"]) ? $_POST["source"] : ""));
$row = $frm->addrow("Filter by user", "User ID " . $frm->text_box("user_id", isset($_POST["user_id"]) ? $_POST["user_id"] : "", 10) . " Username " . $frm->text_box("username", isset($_POST["username"]) ? $_POST["username"] : "", 20));
$frm->addhelp($row, "Filter by user", "Using these fields, you can specify for what user you want to display the event logs.<br/><br/>The User ID must be the exact numeric id for the user.<br/><br/>In the username field, you can use the \"*\" wildcard (e.g. searching for \"john*\" would find both the users \"johndoe\" and \"johnny\").");
$row = $frm->addrow("Filter by IP address", $frm->text_box("ip", isset($_POST["ip"]) ? $_POST["ip"] : "", 20));
$frm->addhelp($row, "Filter by IP address", "Using this field, you can specify for what IP address you want to display the event logs.<br/><br/>In the field, you can use the \"*\" wildcard (e.g. searching for \"172.16.12.*\" will find both the IP addresses \"172.16.12.1\" and \"172.16.12.211\").");
}
$frm->show();
// Use some javascript to create an additional submit button,
// which can be used for clearing logs from the database.
?>
<script type="text/javascript">
var buttons = document.getElementsByTagName('input');
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].type == 'submit' && (
buttons[i].value == 'Refresh page' ||
buttons[i].value == 'Apply filter'
)) {