本文整理汇总了PHP中phorum_admin_okmsg函数的典型用法代码示例。如果您正苦于以下问题:PHP phorum_admin_okmsg函数的具体用法?PHP phorum_admin_okmsg怎么用?PHP phorum_admin_okmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phorum_admin_okmsg函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: phorum_admin_build_url
$redir = phorum_admin_build_url(array('module=settings', 'message=success'), TRUE);
if ($need_display_name_updates) {
$redir = phorum_admin_build_url(array('module=update_display_names'), TRUE);
}
phorum_api_redirect($redir);
exit;
} else {
$error = "Database error while updating settings.";
}
}
}
if ($error) {
phorum_admin_error($error);
} elseif (isset($_GET['message']) && $_GET['message'] == 'success') {
$okmsg = "Settings updated";
phorum_admin_okmsg($okmsg);
}
// create the time zone drop down array
for ($x = -23; $x <= 23; $x++) {
$tz_range[$x] = $x;
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
$frm->addbreak("Phorum General Settings");
$frm->hidden("module", "settings");
$row = $frm->addrow("Phorum Title", $frm->text_box("title", $PHORUM["title"], 50));
$row = $frm->addrow("Phorum Description", $frm->textarea("description", $PHORUM["description"], 30, 5, "style='width: 100%'"));
$row = $frm->addrow("DNS Lookups", $frm->select_tag("dns_lookup", array("No", "Yes"), $PHORUM["dns_lookup"]));
$frm->addhelp($row, "DNS Lookups", "DNS is the system that (amongsts other things) is responsible for\n translating host names into IP addresses and vice versa.\n If DNS lookups are enabled, phorum will use DNS lookups for:\n <ul>\n <li>logging the hostname from which a message was posted, instead of\n the plain IP address;</li>\n <li>being able to create IP ban items based on host and domain names;</li>\n <li>checking the email address that is for user registrations.</li>\n </ul>\n If Phorum keeps reporting illegal email addresses during signup or\n if you are suffering from massive delays during posting messages,\n then there might be DNS problems on your server. In that case, disable\n DNS lookups as a work around.");
$row = $frm->addrow("Hide inaccessible Forums on the Index Page", $frm->select_tag("hide_forums", array("No", "Yes"), $PHORUM["hide_forums"]));
$frm->addhelp($row, "Hide inaccessible Forums on the Index Page", "By setting this to Yes, forums that users are not allowed to read will be hidden from them in the forums list.");
示例2: unset
unset($user_data["module"]);
unset($user_data["section"]);
unset($user_data["password1"]);
unset($user_data["password2"]);
unset($user_data["submit"]);
unset($user_data["phorum_admin_token"]);
if (empty($error)) {
$user_data = phorum_hook("admin_users_form_save", $user_data);
if (isset($user_data["error"])) {
$error = $user_data["error"];
unset($user_data["error"]);
}
}
if (empty($error)) {
phorum_api_user_save($user_data);
phorum_admin_okmsg("User Saved");
}
}
}
if ($error) {
phorum_admin_error($error);
}
include_once "./include/admin/PhorumInputForm.php";
include_once "./include/profile_functions.php";
if (!defined("PHORUM_ORIGINAL_USER_CODE") || PHORUM_ORIGINAL_USER_CODE !== true) {
echo "Phorum User Admin only works with the Phorum User System.";
return;
}
if (!isset($_GET["edit"]) && !isset($_GET["add"]) && !isset($addUser_error) && !isset($_POST['section'])) {
$users_url = phorum_admin_build_url(array('module=users'));
$users_add_url = phorum_admin_build_url(array('module=users', 'add=1'));
示例3: urlencode
$filter[$fld] = $_POST[$fld];
$filter_base .= "&{$fld}=" . urlencode($_POST[$fld]);
}
}
}
// ----------------------------------------------------------------------
// Handle delete actions.
// ----------------------------------------------------------------------
// Clear logs requested?
if (isset($_POST["clear"])) {
if ($filter_mode) {
event_logging_clearlogs($filter);
phorum_admin_okmsg("The filtered event logs have been deleted.");
} else {
event_logging_clearlogs();
phorum_admin_okmsg("All event logs have been deleted.");
}
}
// ----------------------------------------------------------------------
// Collect data to display.
// ----------------------------------------------------------------------
// Which page to show?
if (isset($_POST["prevpage"])) {
$page = (int) $_POST["curpage"] - 1;
} elseif (isset($_POST["nextpage"])) {
$page = (int) $_POST["curpage"] + 1;
} else {
$page = isset($_POST["page"]) ? (int) $_POST["page"] : 1;
}
// What page length to use?
$pagelength = isset($_POST["pagelength"]) ? (int) $_POST["pagelength"] : $default_pagelength;
示例4: array
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
// //
// You should have received a copy of the Phorum License //
// along with this program. //
// //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_ADMIN")) {
return;
}
$error = "";
if (count($_POST)) {
// some sanity checking would be nice ;)
$PHORUM["smtp_mail"] = array('host' => $_POST['host'], 'port' => empty($_POST['port']) ? "25" : $_POST['port'], 'auth' => $_POST['auth'], 'username' => $_POST['auth_username'], 'password' => $_POST['auth_password'], 'conn' => $_POST['conn'], 'log_successful' => $_POST['log_successful'], 'show_errors' => $_POST['show_errors']);
if (empty($error)) {
phorum_db_update_settings(array("smtp_mail" => $PHORUM["smtp_mail"]));
phorum_admin_okmsg("Settings updated");
}
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "smtp_mail");
$frm->addbreak("Settings for the SMTP Mail Module");
$frm->addrow("Hostname of mailserver", $frm->text_box("host", $PHORUM['smtp_mail']['host'], 50));
$frm->addrow("Port of mailserver", $frm->text_box("port", $PHORUM['smtp_mail']['port'], 5) . " (Default Port is 25, unencrypted. Encrypted Port is usually 465)");
$frm->addrow("Connection Type", $frm->select_tag("conn", array('plain' => 'Plain Connection', 'ssl' => 'SSL-Encryption', 'tls' => 'TLS-Encryption'), $PHORUM['smtp_mail']['conn']) . " (e.g. Google-Mail connection needs TLS)");
$frm->addrow("Use SMTP Auth", $frm->select_tag("auth", array(1 => 'Yes', 0 => 'No'), $PHORUM['smtp_mail']['auth']));
$frm->addrow("SMTP Auth Username", $frm->text_box("auth_username", $PHORUM['smtp_mail']['username'], 50));
$frm->addrow("SMTP Auth Password", $frm->text_box("auth_password", $PHORUM['smtp_mail']['password'], 50, 0, true));
$frm->addsubbreak("Logging / Errorhandling");
$row = $frm->addrow("Show errors on screen", $frm->select_tag("show_errors", array(1 => "Yes", 0 => "No"), $PHORUM['smtp_mail']['show_errors']));
示例5: phorum_api_forums_save
$parent_id = $PHORUM['vroot'];
if (!empty($_GET['parent_id'])) {
$parent_id = (int) $_GET['parent_id'];
}
// Prepare a forum data array for initializing the form.
$forum = phorum_api_forums_save(array('forum_id' => NULL, 'folder_flag' => 0, 'inherit_id' => 0, 'parent_id' => $parent_id, 'name' => ''), PHORUM_FLAG_PREPARE);
extract($forum);
}
// ----------------------------------------------------------------------
// Handle displaying the forum settings form
// ----------------------------------------------------------------------
if ($errors) {
phorum_admin_error(join("<br/>", $errors));
}
if (isset($_GET['okmsg'])) {
phorum_admin_okmsg(htmlspecialchars($_GET['okmsg']));
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post");
if (defined("PHORUM_DEFAULT_OPTIONS")) {
$frm->hidden("module", "forum_defaults");
$title = "Edit the default forum settings";
} elseif (defined("PHORUM_EDIT_FORUM")) {
$frm->hidden("module", "editforum");
$frm->hidden("forum_id", $forum_id);
$title = "Edit settings for forum \"{$name}\" (Id: {$forum_id})";
} else {
$frm->hidden("module", "newforum");
$title = "Create a new forum";
}
$frm->addbreak($title);
示例6: array
$PHORUM["mod_bbcode"] = array("links_in_new_window" => empty($_POST["links_in_new_window"]) ? 0 : 1, "rel_no_follow" => empty($_POST["rel_no_follow"]) ? 0 : 1, "quote_hook" => empty($_POST["quote_hook"]) ? 0 : 1, "show_full_urls" => empty($_POST["show_full_urls"]) ? 0 : 1, "process_bare_urls" => empty($_POST["process_bare_urls"]) ? 0 : 1, "process_bare_email" => empty($_POST["process_bare_email"]) ? 0 : 1, "allow_disable_per_post" => empty($_POST["allow_disable_per_post"]) ? 0 : 1, "enable_bbcode_escape" => empty($_POST["enable_bbcode_escape"]) ? 0 : 1);
// Add enable / disable status for individual tags.
$nr_of_enabled_tags = 0;
$PHORUM['mod_bbcode']['enabled'] = array();
foreach ($GLOBALS['PHORUM']['MOD_BBCODE']['BUILTIN'] as $tagname => $tag) {
if (isset($_POST['enabled'][$tagname])) {
$value = (int) $_POST['enabled'][$tagname];
$PHORUM['mod_bbcode']['enabled'][$tagname] = $value;
if ($value == 2) {
$nr_of_enabled_tags++;
}
}
}
// Store the new settings array.
$PHORUM['DB']->update_settings(array('mod_bbcode' => $PHORUM['mod_bbcode']));
phorum_admin_okmsg("The settings were successfully saved.");
if ($nr_of_enabled_tags > 0 && empty($PHORUM['mods']['editor_tools'])) {
phorum_admin_error("<b>Notice:</b> You have configured one or more BBcode tags to add a button to the editor tool bar. However, you have not enabled the Editor Tools module. If you want to use the tool buttons, then remember to activate the Editor Tools module.");
}
}
require_once './include/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save settings");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "bbcode");
$frm->addbreak("General settings for the BBcode module");
$row = $frm->addrow("Open links in new window", $frm->checkbox("links_in_new_window", "1", "Yes", $PHORUM["mod_bbcode"]["links_in_new_window"]));
$frm->addhelp($row, "Open links in new window", "When users post links on your forum, you can choose whether to open these in a new window or not.");
$row = $frm->addrow("Turn bare URLs into clickable links", $frm->checkbox("process_bare_urls", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_urls"]));
$frm->addhelp($row, "Turn bare URLs into clickable links", "If you enable this option, then the BBcode module will try to detect bare URLs in the message (URLs that are not surrounded by [url]...[/url] BBcode tags) and turn those into clickable links (as if they were surrounded by [url]...[/url]).");
$row = $frm->addrow("Turn bare email addresses into clickable links", $frm->checkbox("process_bare_email", "1", "Yes", $PHORUM["mod_bbcode"]["process_bare_email"]));
$frm->addhelp($row, "Turn bare email addresses into clickable links", "If you enable this option, then the BBcode module will try to detect bare email addresses in the message (addresses that are not surrounded by [email]...[/email] BBcode tags) and turn those into clickable links (as if they were surrounded by [email]...[/email]).");
示例7: phorum_api_file_purge_stale
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY, without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
// //
// You should have received a copy of the Phorum License //
// along with this program. //
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_ADMIN")) {
return;
}
include_once "./include/format_functions.php";
include_once "./include/api/file_storage.php";
// Execute file purging for real?
if (count($_POST)) {
$deleted = phorum_api_file_purge_stale(TRUE);
phorum_admin_okmsg("Purged " . count($deleted) . " files");
}
// Retrieve a list of stale files.
$purge_files = phorum_api_file_purge_stale(FALSE);
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", count($purge_files) ? "Purge stale files now" : "Refresh screen");
$frm->hidden("module", "file_purge");
$frm->addbreak("Purging stale files...");
$frm->addmessage("It's possible that there are files stored in the Phorum system,\n which no longer are linked to anything. For example, if users\n write messages with attachments, but do not post them in the end,\n the attachment files will be left behind in the database.\n Using this maintenance tool, you can purge those stale files\n from the system.");
$prev_reason = '';
if (count($purge_files)) {
$frm->addbreak("There are currently " . count($purge_files) . " stale files in the database");
foreach ($purge_files as $id => $file) {
if ($file['reason'] != $prev_reason) {
$prev_reason = $file['reason'];
$frm->addsubbreak("Reason: " . $file['reason']);
示例8: print
<input type="hidden" name="curr" value="<?php
print (int) $_GET['curr'];
?>
" />
<input type="hidden" name="delete" value="1" />
<input type="submit" name="confirm" value="Yes" />
<input type="submit" name="confirm" value="No" />
</form>
</div>
<?php
return;
}
// Delete a custom profile field after confirmation.
if (isset($_POST["curr"]) && isset($_POST["delete"]) && $_POST["confirm"] == "Yes") {
phorum_api_custom_profile_field_delete((int) $_POST["curr"]);
phorum_admin_okmsg("Profile field deleted");
}
// Check if we are in create or edit mode.
$curr = isset($_GET['curr']) ? (int) $_GET['curr'] : "NEW";
$field = $curr != 'NEW' && isset($PHORUM['PROFILE_FIELDS'][$curr]) ? $PHORUM['PROFILE_FIELDS'][$curr] : NULL;
// Setup data for create mode.
if ($field === NULL) {
$name = '';
$length = 255;
$html_disabled = 1;
$show_in_admin = 0;
$title = "Add A Profile Field";
$submit = "Add";
// Setup data for edit mode.
} else {
$name = $field['name'];
示例9: phorum_db_mod_banlists
} else {
$ret = phorum_db_mod_banlists(PHORUM_BAD_WORDS, 0, $_POST["string"], $_POST['forum_id'], $_POST['comments'], 0);
}
if (!$ret) {
$error = "Database error while updating badwords.";
} else {
if ($_POST["curr"] != "NEW") {
phorum_admin_okmsg("Bad Word Updated");
} else {
phorum_admin_okmsg("Bad Word Added");
}
}
}
if (isset($_POST["curr"]) && isset($_POST["delete"]) && $_POST["confirm"] == "Yes") {
phorum_db_del_banitem((int) $_POST['curr']);
phorum_admin_okmsg("Bad Word Deleted");
}
if (isset($_GET["curr"])) {
$curr = $_GET["curr"];
}
if ($curr != "NEW") {
extract(phorum_db_get_banitem($curr));
$title = "Edit Bad Word Item";
$submit = "Update";
} else {
$title = "Add A Bad Word";
$submit = "Add";
}
settype($comments, "string");
settype($forum_id, "int");
settype($string, "string");
示例10: phorum_hook
}
}
}
}
// Run a hook for performing custom actions after cleanup.
phorum_hook("delete", $delids);
// Keep track of deleted messages ids for counting the deleted
// messages at the end. We can't simply add the number of messages
// in the message array, because there might be overlap between
// messages and threads here.
foreach ($delids as $id) {
$delete_messages[$id] = 1;
}
}
$delete_count = count($delete_messages);
phorum_admin_okmsg("Deleted {$delete_count} message(s) from the database.");
}
// If a filterdesc field is in the post data, then query the database
// based on this filterdesc. The results will be shown later on,
// below the filter form.
if (isset($_POST["filterdesc"])) {
// The filter rules are separated by "&" or "|" based on
// respectively an "AND" or an "OR" query.
$split = preg_split('/([&|])/', $_POST["filterdesc"], -1, PREG_SPLIT_DELIM_CAPTURE);
// The $split array should now contain an alternating list of
// rules and AND/OR specifications. Walk over the list and
// try to construct a metaquery to find messages based on
// this filter.
$meta = array();
foreach ($split as $index => $spec) {
// Even indexes contain a rule.
示例11: foreach
if ((int) $_POST["number_to_show"] == 0) {
$_POST["number_to_show"] = 5;
}
if (isset($_POST['vroot_forum_id']) && is_array($_POST['vroot_forum_id'])) {
foreach ($_POST['vroot_forum_id'] as $vroot_id => $vroot_forum_id) {
$PHORUM["mod_announcements"]["vroot"][$vroot_id] = (int) $vroot_forum_id;
}
}
$PHORUM["mod_announcements"]["forum_id"] = (int) $_POST["forum_id"];
$PHORUM["mod_announcements"]["pages"] = $_POST["pages"];
$PHORUM["mod_announcements"]["disable_autodisplay"] = isset($_POST["disable_autodisplay"]) ? 1 : 0;
$PHORUM["mod_announcements"]["only_show_unread"] = isset($_POST["only_show_unread"]) ? 1 : 0;
$PHORUM["mod_announcements"]["number_to_show"] = (int) $_POST["number_to_show"];
$PHORUM["mod_announcements"]["days_to_show"] = (int) $_POST["days_to_show"];
phorum_db_update_settings(array("mod_announcements" => $PHORUM["mod_announcements"]));
phorum_admin_okmsg("Announcement settings updated");
}
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "announcements");
$frm->addbreak("Announcement Settings");
$page_list = $frm->checkbox("pages[home]", 1, "Home page, root level forum list (index.php)", $PHORUM["mod_announcements"]["pages"]["home"]) . "<br/>" . $frm->checkbox("pages[index]", 1, "Any forum List (index.php)", $PHORUM["mod_announcements"]["pages"]["index"]) . "<br/>" . $frm->checkbox("pages[list]", 1, "Message List (list.php)", $PHORUM["mod_announcements"]["pages"]["list"]) . "<br/>" . $frm->checkbox("pages[read]", 1, "Read Message (read.php)", $PHORUM["mod_announcements"]["pages"]["read"]);
$frm->addrow("Announcements Appear On", $page_list);
$row = $frm->addrow("Disable automatic displaying of announcements?", $frm->checkbox("disable_autodisplay", 1, "Disable automatic displaying", $PHORUM["mod_announcements"]["disable_autodisplay"]));
$frm->addhelp($row, "Disable automatic displaying", "By default, the announcements will be displayed after the page header automatically. If you need more control over the exact placement, then enable this option. Then you can specify where you want the announcements to appear yourself by placing the code {MOD_ANNOUNCEMENTS} in your templates.");
$frm->addrow("Show only unread messages to the user?", $frm->checkbox("only_show_unread", 1, "Show only unread", $PHORUM["mod_announcements"]["only_show_unread"]));
$frm->addrow("Number To Show", $frm->text_box("number_to_show", $PHORUM["mod_announcements"]["number_to_show"], 10));
$frm->addrow("Maximum Days To Show", $frm->text_box("days_to_show", $PHORUM["mod_announcements"]["days_to_show"], 10) . " (0 = forever)");
$forum_list_global = phorum_get_forum_info(1, 0);
$frm->addrow("Announcement Forum", $frm->select_tag("forum_id", $forum_list_global, $PHORUM["mod_announcements"]["forum_id"]));
示例12: phorum_admin_error
} else {
phorum_admin_error("Denied access to illegal module information file request!");
}
return;
}
if (!empty($_POST['do_module_updates'])) {
foreach ($list['modules'] as $mod => $info) {
$key = base64_encode('mods_' . $mod);
if (isset($_POST[$key])) {
phorum_api_modules_enable($mod);
} else {
phorum_api_modules_disable($mod);
}
}
phorum_api_modules_save();
phorum_admin_okmsg("The module settings were successfully updated.");
// Retrieve a fresh module list.
$list = phorum_api_modules_list();
}
// ----------------------------------------------------------------------
// Display status information about possible module problems
// ----------------------------------------------------------------------
// Show module problems to the admin.
if (count($list['problems'])) {
foreach ($list['problems'] as $problem) {
phorum_admin_error($problem);
}
}
// ----------------------------------------------------------------------
// Build the form
// ----------------------------------------------------------------------
示例13: phorum_cache_remove
// remove the one for that forum
phorum_cache_remove('banlist', $_POST['forum_id']);
}
}
} else {
$ret = phorum_db_mod_banlists($_POST['type'], $_POST['pcre'], $_POST['string'], $_POST['forum_id'], $_POST['comments'], 0);
}
if (!$ret) {
$error = "Database error while updating settings.";
} else {
phorum_admin_okmsg("Ban Item Updated");
}
}
if (isset($_POST["curr"]) && isset($_POST["delete"]) && $_POST["confirm"] == "Yes") {
phorum_db_del_banitem((int) $_POST['curr']);
phorum_admin_okmsg("Ban Item Deleted");
}
if (isset($_GET["curr"])) {
$curr = (int) $_GET["curr"];
}
if ($curr != "NEW") {
extract(phorum_db_get_banitem($curr));
$title = "Edit Ban Item";
$submit = "Update";
} else {
$title = "Add A Ban Item";
$submit = "Add";
}
settype($string, "string");
settype($comments, "string");
settype($type, "int");
示例14: phorum_admin_error
phorum_admin_error("The settings were not saved. " . "PHP on your webserver lacks GD support, which is required " . "for using GIF image CAPTCHAs. Please contact your hosting " . "provider to enable GD support.");
} else {
$PHORUM["mod_spamhurdles"] = array('log_events' => isset($_POST['log_events']) ? 1 : 0, 'captcha' => array('type' => $captcha_type, 'flite_location' => trim($_POST['flite_location']), 'spoken_captcha' => isset($_POST['spoken_captcha']) ? 1 : 0, 'recaptcha_pubkey' => $_POST['recaptcha_pubkey'], 'recaptcha_prvkey' => $_POST['recaptcha_prvkey']), 'posting' => array('block_action' => $_POST['posting_block_action'], 'hurdles' => $_POST['posting']), 'register' => array('hurdles' => $_POST['register']), 'pm' => array('hurdles' => $_POST['pm']), 'config_version' => 2);
$PHORUM['DB']->update_settings(array("mod_spamhurdles" => $PHORUM["mod_spamhurdles"]));
phorum_admin_okmsg('The settings were successfully saved');
}
} else {
// If Flite is installed after this module was installed, then
// we might be able to find the flite binary. If we do, then update
// the flite path in the settings.
if (trim($PHORUM['mod_spamhurdles']['captcha']['flite_location']) == '') {
$flite_location = spamhurdles_find_flite();
if ($flite_location) {
$PHORUM['mod_spamhurdles']['captcha']['flite_location'] = $flite_location;
$PHORUM['DB']->update_settings(array("mod_spamhurdles" => $PHORUM["mod_spamhurdles"]));
phorum_admin_okmsg('The "flite" binary was found on the server.<br/>' . 'The path was automatically set to ' . '"' . htmlspecialchars($flite_location) . '"');
}
}
}
$image_url = $PHORUM['http_path'] . '/mods/spamhurdles/images/' . 'datasphorum_thumb.jpg';
?>
<a href="http://geekandpoke.typepad.com" target="_blank">
<img style="border:none; padding:5px;float:right"
title="Click here for more Geek and Poke cartoons!"
alt="Geek and Poke cartoon"
src="<?php
print $image_url;
?>
"/>
</a>
<div style="font-size: xx-large; font-weight: bold">Spam Hurdles Module</div>