当前位置: 首页>>代码示例>>PHP>>正文


PHP phorum_admin_error函数代码示例

本文整理汇总了PHP中phorum_admin_error函数的典型用法代码示例。如果您正苦于以下问题:PHP phorum_admin_error函数的具体用法?PHP phorum_admin_error怎么用?PHP phorum_admin_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了phorum_admin_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

         }
         // set the default http_path so we can continue.
         if (!empty($_SERVER["HTTP_REFERER"])) {
             $http_path = $_SERVER["HTTP_REFERER"];
         } elseif (!empty($_SERVER['HTTP_HOST'])) {
             $http_path = "http://" . $_SERVER['HTTP_HOST'];
             $http_path .= $_SERVER['PHP_SELF'];
         } else {
             $http_path = "http://" . $_SERVER['SERVER_NAME'];
             $http_path .= $_SERVER['PHP_SELF'];
         }
         $PHORUM['DB']->update_settings(array("http_path" => dirname($http_path)));
         $PHORUM['DB']->update_settings(array("system_email_from_address" => $_POST["admin_email"]));
         $step = "modules";
     } else {
         phorum_admin_error("Please fill in all fields.");
     }
     break;
 case "modules":
     // Retrieve a list of available modules.
     require_once './include/api/modules.php';
     $list = phorum_api_modules_list();
     // Process posted form data
     if (isset($_POST["do_modules_update"])) {
         foreach ($_POST as $key => $value) {
             $key = base64_decode($key);
             if (substr($key, 0, 5) == "mods_") {
                 $mod = substr($key, 5);
                 if ($value) {
                     phorum_api_modules_enable($mod);
                 } else {
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:install.php

示例2: unset

        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'));
    print "<a href=\"{$users_url}\">" . "Show all users</a> | <a href=\"{$users_add_url}\">Add User</a><br/>";
    if (empty($_REQUEST["user_id"])) {
        $frm = new PhorumInputForm("", "get", "Search");
        $frm->addbreak("User Search");
        $frm->hidden("module", "users");
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:users.php

示例3: basename

<?php

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//   Copyright (C) 2010  Phorum Development Team                              //
//   http://www.phorum.org                                                    //
//                                                                            //
//   This program is free software. You can redistribute it and/or modify     //
//   it under the terms of either the current Phorum License (viewable at     //
//   phorum.org) or the Phorum License that was distributed with this file    //
//                                                                            //
//   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;
}
$mod = basename($_REQUEST["mod"]);
if (file_exists("./mods/{$mod}/settings.php")) {
    if (!isset($PHORUM["mods"][$mod]) || !$PHORUM["mods"][$mod]) {
        $text = "This module is not enabled yet. You can change its settings but the module is only active if you enable it on the previous page.";
        phorum_admin_error($text);
    }
    include_once "./mods/{$mod}/settings.php";
} else {
    echo "There are no settings for this module.";
}
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:modsettings.php

示例4: array

    $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]).");
$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.");
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:settings.php

示例5: array

            <input type="submit" name="create" value="Create new field" />
          </form>
        </div>
        <?php 
            return;
        }
    }
    // $_POST could have been emptied in the previous code.
    if (count($_POST)) {
        // Create or update the custom profile field.
        $field = array('id' => $_POST['curr'] == 'NEW' ? NULL : $_POST['curr'], 'name' => $_POST['name'], 'length' => $_POST['length'], 'html_disabled' => $_POST['html_disabled'], 'show_in_admin' => $_POST['show_in_admin']);
        $field = phorum_api_custom_profile_field_configure($field);
        if ($field === FALSE) {
            $error = phorum_api_strerror();
            $action = $_POST['curr'] == 'NEW' ? "create" : "update";
            phorum_admin_error("Failed to {$action} profile field: " . $error);
        } else {
            $action = $_POST['curr'] == 'NEW' ? "created" : "updated";
            phorum_admin_okmsg("Profile field {$action}");
        }
    }
}
// Confirm deleting a profile field.
if (isset($_GET["curr"]) && isset($_GET["delete"])) {
    ?>
  <div class="PhorumInfoMessage">
    Are you sure you want to delete this custom profile field?
    <br/><br/>
    <form action="<?php 
    echo phorum_admin_build_url('base');
    ?>
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:customprofile.php

示例6: elseif

} elseif (defined("PHORUM_DEFAULT_OPTIONS")) {
    extract($PHORUM["default_forum_options"]);
} else {
    $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");
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:newforum.php

示例7: elseif

                $meta[] = "AND";
                $filtermode = "and";
                continue;
            } elseif ($spec == '|') {
                $meta[] = "OR";
                $filtermode = "or";
                continue;
            }
        }
        trigger_error('Internal error: illegal filter specification (' . 'unexpected token "' . htmlspecialchars($spec) . '")', E_USER_ERROR);
    }
    // Let the database layer turn the metaquery into a real query
    // and run it against the database.
    $messages = phorum_db_metaquery_messagesearch($meta);
    if ($messages === NULL) {
        phorum_admin_error("Internal error: failed to run a message search");
    }
}
// Custom filter preparation for the "date" filter.
function prepare_filter_date($meta, $field, $match, $query)
{
    $start_of_day = null;
    $end_of_day = null;
    global $ruledefs;
    if (!$ruledefs[$field] || !isset($ruledefs[$field]["prepare_filter_date"])) {
        trigger_error("Internal error: no date field configure in rule defs for field " . '"' . htmlspecialchars($field) . '"', E_USER_ERROR);
    }
    $dbfield = $ruledefs[$field]["prepare_filter_date"];
    $query = trim($query);
    if (preg_match('/^(\\d\\d\\d\\d)\\D(\\d\\d?)\\D(\\d\\d?)$/', $query, $m)) {
        $dy = $m[1];
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:message_prune.php

示例8: phorum_admin_gen_compare

 function phorum_admin_gen_compare($txt) {
     $func = 0;
     if($txt == "gt") {
         $func = create_function('$a, $b', 'return $a > $b;');
     } elseif($txt == "gte") {
         $func = create_function('$a, $b', 'return $a >= $b;');
     } elseif($txt == "lt") {
         $func = create_function('$a, $b', 'return $a < $b;');
     } elseif($txt == "lte") {
         $func = create_function('$a, $b', 'return $a <= $b;');
     } elseif($txt == "eq") {
         $func = create_function('$a, $b', 'return $a == $b;');
     }
     if(!$func) {
         phorum_admin_error("Invalid posts comparison operator.");
         return NULL;
     }
     return $func;
 }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:19,代码来源:admin.php

示例9: phorum_api_lang_list

    exit;
}
// Handle updating a language.
if ($action == 'update_lang') {
    $langinfo = phorum_api_lang_list(TRUE);
    return phorum_generate_language_file($language, $langinfo[$language], false);
}
// Handle generating a new language.
if ($action == 'generate_lang') {
    $filename = preg_replace('/\\.php$/i', '', basename($filename));
    if ($filename == '') {
        phorum_admin_error("The basename may not be empty");
    } elseif (!preg_match('/^[\\w_\\.]+$/', $filename)) {
        phorum_admin_error("The basename contains illegal characters. Please, keep the " . "filename simple by using only letters, numbers, underscores and " . "dots. You can't use hyphens, because those are used for " . "separating the basename from the Phorum version for which the " . "language file is used.");
    } elseif ($displayname == '') {
        phorum_admin_error("The display name for the language may not be empty.");
    } else {
        $filename .= "-" . PHORUM;
        return phorum_generate_language_file($filename, $displayname, true);
    }
}
// Handle start page.
$frm = new PhorumInputForm("", "post", "Generate updated language file");
$frm->addmessage(<<<INTRO
  <font color="red">EXPERIMENTAL FEATURE<br/>
  Please backup your existing language file if you replace it with
  one generated by this maintenance tool. We feel pretty confident
  about it, but we wouldn't want you to lose data in case of bugs.</font>
  <hr size="0"/>

  <h2>Manage language files</h2>
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:manage_languages.php

示例10: phorum_admin_okmsg

    phorum_admin_okmsg($okmsg);
}
// Count things.
$total_smileys = 0;
$inactive_smileys = 0;
foreach ($PHORUM["mod_smileys"]["smileys"] as $id => $smiley) {
    $total_smileys++;
    if (!$smiley["active"]) {
        $inactive_smileys++;
    }
}
// Display a warning in case there are no smiley images available.
if (!count($available_smileys)) {
    phorum_admin_error("<strong>Warning:</strong><br/>" . "No smiley images were found in your current smiley prefix " . "path. Please place some smileys in the directory " . htmlspecialchars($PHORUM["mod_smileys"]["prefix"]) . " or change your prefix path to point to a directory " . "containing smiley images.");
} elseif ($inactive_smileys) {
    phorum_admin_error("<strong>Warning:</strong><br/>" . "You have {$inactive_smileys} smiley(s) configured for which the " . "image file was not found (marked as \"UNAVAILBLE\" in the list " . "below). Delete the smiley(s) from the list or place the missing " . "images in the directory \"" . htmlspecialchars($PHORUM["mod_smileys"]["prefix"]) . "\". After " . "placing new smiley images, click \"Save settings\" to update " . "the smiley settings.");
}
// Create the smiley settings form.
if ($smiley_id == "NEW") {
    $frm = new PhorumInputForm("", "post", 'Save settings');
    $frm->hidden("module", "modsettings");
    $frm->hidden("mod", "smileys");
    $frm->hidden("action", "edit_settings");
    $frm->addbreak("Smiley Settings");
    $row = $frm->addrow("Smiley Prefix Path", $frm->text_box("prefix", $PHORUM["mod_smileys"]["prefix"], 30));
    $frm->addhelp($row, "Set the smiley image prefix path", "This option can be used to set the path to the directory where\n         you have stored your smileys. This path must be relative to the\n         directory in which you installed the Phorum software. Absolute\n         paths cannot be used here.");
    $row = $frm->addrow("Enable body smiley button in the editor tools", $frm->checkbox("smileys_tool_enabled", "1", "", $PHORUM["mod_smileys"]["smileys_tool_enabled"]) . ' Yes');
    $frm->addhelp($row, "Body smiley tool button", "If you enable this option, then a smiley button will be added to\n         the editor tools tool bar, which can be used to easily add smileys\n         to the message body. You also have to enable the Editor Tools\n         module to make use of this feature.");
    if (!empty($PHORUM["mod_smileys"]["smileys_tool_enabled"])) {
        $frm->addrow("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The width to use for the smileys popup", $frm->text_box("smiley_popup_width", $PHORUM["mod_smileys"]["smiley_popup_width"], 5) . ' pixels');
        $frm->addrow("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How far to shift the smileys popup to the left", $frm->text_box("smiley_popup_offset", $PHORUM["mod_smileys"]["smiley_popup_offset"], 5) . ' pixels');
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:settings.php

示例11: array

<?php

if (!defined("PHORUM_ADMIN")) {
    return;
}
require_once 'defaults.php';
// save settings
if (count($_POST)) {
    $PHORUM['mod_sphinx_search'] = array('hostname' => $_POST['hostname'], 'port' => $_POST['port']);
    if (!phorum_db_update_settings(array('mod_sphinx_search' => $PHORUM['mod_sphinx_search']))) {
        phorum_admin_error("Updating the settings in the database failed.");
    } else {
        phorum_admin_okmsg("Settings updated");
    }
}
?>
<div style="font-size: xx-large; font-weight: bold">Sphinx Search Module</div>
 This module uses the sphinx fulltext search engine to gather the results of the phorum-search.<br />
 On this page you can set the hostname and port of your sphinx search daemon.

<br style="clear:both" />
<?php 
include_once PHORUM_INCLUDES_DIR . '/admin/PhorumInputForm.php';
$frm = new PhorumInputForm("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "sphinx_search");
$frm->addbreak("Hostname and port");
$row = $frm->addrow("What is the hostname of the sphinx daemon? (e.g. 127.0.0.1){$warn}", $frm->text_box("hostname", $PHORUM["mod_sphinx_search"]["hostname"], 30));
$row = $frm->addrow("What is the port of the sphinx daemon? (e.g. 9312){$warn}", $frm->text_box("port", $PHORUM["mod_sphinx_search"]["port"], 30));
$frm->show();
开发者ID:raul72,项目名称:phorum-sphinx_search,代码行数:30,代码来源:settings.php

示例12: phorum_admin_error

        phorum_admin_error($problem);
    }
}
// ----------------------------------------------------------------------
// Build the form
// ----------------------------------------------------------------------
// Just used for building form elements.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm("", "post", "");
$frm_url = phorum_admin_build_url();
$html = "<form id=\"modules_form\" " . "action=\"{$frm_url}\" method=\"post\">" . "<input type=\"hidden\" name=\"phorum_admin_token\"\n                value=\"{$PHORUM['admin_token']}\" />" . "<input style=\"display:none\" type=\"submit\" " . "value=\"catch [enter] key\" onclick=\"return false\"/>" . "<input type=\"hidden\" name=\"module\" value=\"mods\" />" . "<input type=\"hidden\" name=\"do_module_updates\" value=\"1\" />" . "<div class=\"PhorumAdminTitle\">Phorum module settings</div>" . "<div class=\"modules_filter\">" . "<strong>Filter:</strong> " . "show " . $frm->select_tag('filter_status', array(0 => 'all', 1 => 'enabled', 2 => 'disabled'), isset($_POST['filter_status']) ? $_POST['filter_status'] : 0, 'onchange="filter_modules(this.form)"') . " modules, matching " . $frm->text_box('filter_text', isset($_POST['filter_text']) ? $_POST['filter_text'] : '', 30, NULL, FALSE, 'onkeyup="filter_modules(this.form)" id="filter_text"') . $frm->checkbox('hide_description', 1, 'hide descriptions', isset($_POST['hide_description']) ? 1 : 0, 'style="margin-left:1em" ' . 'onchange="filter_modules(this.form)" ' . 'id="hide_descriptions"') . "</div>";
foreach ($list['modules'] as $name => $info) {
    // Disable a module if it's enabled, but should be disabled based
    // on the Phorum version.
    if ($info['version_disabled'] && $info['enabled']) {
        phorum_admin_error("Minimum Phorum-Version requirement not met for " . "module \"" . htmlspecialchars($name) . "\"<br/>" . "It requires at least version " . "\"" . htmlspecialchars($info['required_version']) . "\", " . "but the current version is \"" . PHORUM . "\".<br />" . "The module was disabled to avoid malfunction of " . "your Phorum because of that requirement.<br/>");
        phorum_api_modules_disable($name);
        phorum_api_modules_save();
        $info['version_disabled'] = TRUE;
    }
    $id = base64_encode("mods_{$name}");
    $title = $info["title"];
    if (isset($info["version"])) {
        $title .= " (version " . $info["version"] . ")";
    }
    // Compatibility modules are handles in a special way. These are
    // not enabled from the admin panel. Instead, they are automatically
    // loaded when required from the start of common.php.
    $is_compat = FALSE;
    if (!empty($info['compat'])) {
        foreach ($info['compat'] as $function => $extension) {
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:mods.php

示例13: define

<?php

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//   Copyright (C) 2007  Phorum Development Team                              //
//   http://www.phorum.org                                                    //
//                                                                            //
//   This program is free software. You can redistribute it and/or modify     //
//   it under the terms of either the current Phorum License (viewable at     //
//   phorum.org) or the Phorum License that was distributed with this file    //
//                                                                            //
//   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;
}
define("PHORUM_EDIT_FOLDER", 1);
if (empty($_REQUEST["forum_id"])) {
    phorum_admin_error("forum_id not set");
} else {
    include "./include/admin/newfolder.php";
}
开发者ID:sleepy909,项目名称:cpassman,代码行数:27,代码来源:editfolder.php

示例14: array

<?php

if (!defined("PHORUM_ADMIN")) {
    return;
}
require_once "./mods/spamhurdles/defaults.php";
// A list of available CAPTCHAs.
$captchaspec = array('javascript' => 'Code, drawn using JavaScript', 'image' => 'Code, drawn using a GIF image', 'asciiart' => 'Code, drawn using ASCII art', 'plaintext' => 'Code, plain text format', 'maptcha' => 'Solve a simple math question', 'recaptcha' => 'Code, using the reCAPTCHA service');
// Save settings.
if (count($_POST)) {
    $captcha_type = basename($_POST['captcha_type']);
    if (!isset($captchaspec[$captcha_type])) {
        trigger_error('Illegal CAPTCHA specified.', E_USER_ERROR);
    }
    if ($captcha_type === 'image' && !function_exists('imagecreatetruecolor')) {
        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) . '"');
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:settings.php

示例15: array

            <input type="submit" name="create" value="Create new field" />
          </form>
        </div>
        <?php 
            return;
        }
    }
    // $_POST could have been emptied in the previous code.
    if (count($_POST)) {
        // Create or update the custom field.
        $field = array('id' => $_POST['curr'] == 'NEW' ? NULL : $_POST['curr'], 'name' => $_POST['name'], 'field_type' => $_POST['field_type'], 'length' => $_POST['length'], 'html_disabled' => $_POST['html_disabled'], 'show_in_admin' => $_POST['show_in_admin']);
        $field = phorum_api_custom_field_configure($field);
        if ($field === FALSE) {
            $error = phorum_api_error_message();
            $action = $_POST['curr'] == 'NEW' ? "create" : "update";
            phorum_admin_error("Failed to {$action} custom field: " . $error);
        } else {
            $action = $_POST['curr'] == 'NEW' ? "created" : "updated";
            phorum_admin_okmsg("Custom field {$action}");
        }
    }
}
// Confirm deleting a profile field.
if (isset($_GET["curr"]) && isset($_GET["delete"])) {
    ?>
  <div class="PhorumInfoMessage">
    Are you sure you want to delete this custom field?
    <br/><br/>
    <form action="<?php 
    echo phorum_admin_build_url();
    ?>
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:customprofile.php


注:本文中的phorum_admin_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。