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


PHP phorum_api_hook函数代码示例

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


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

示例1: phorum_mod_editor_tools_common

/**
 * Adds the javascript and CSS for the editor tools to the page header.
 * Sets up internal datastructures for the editor tools module.
 * Allows other modules to register their editor tool buttons.
 */
function phorum_mod_editor_tools_common()
{
    global $PHORUM;
    $lang = $PHORUM["DATA"]["LANG"]["mod_editor_tools"];
    // Initialize the tool data array.
    $PHORUM["MOD_EDITOR_TOOLS"] = array("DO_TOOLS" => false, "STARTED" => false, "TOOLS" => array(), "JSLIBS" => array(), "HELP_CHAPTERS" => array(), "TRANSLATIONS" => $lang);
    // Add a help tool. We add it as the first tool, so we can
    // shift it nicely to the right side of the page using CSS float.
    if (!empty($PHORUM["mod_editor_tools"]["enable_help"])) {
        editor_tools_register_tool('help', $lang['help']);
    }
    // Give other modules a chance to setup their plugged in
    // editor tools. This is done through a standard hook call.
    if (isset($PHORUM["hooks"]["editor_tool_plugin"])) {
        phorum_api_hook('editor_tool_plugin');
    }
    // Keep track that the editor tools have been setup. From here
    // on, the API calls for registering tools, javascript libraries
    // help chapters and language strings are no longer allowed.
    $PHORUM["MOD_EDITOR_TOOLS"]["STARTED"] = true;
}
开发者ID:netovs,项目名称:Core,代码行数:26,代码来源:editor_tools.php

示例2: phorum_api_hook

 *     Same as input.
 *
 * [example]
 *     <hookcode>
 *     function phorum_mod_foo_hide_thread($msgthd_id)
 *     {
 *         global $PHORUM;
 *
 *         // Log the hidden thread id
 *         $PHORUM["mod_foo"]["hidden_threads"][] = $msgthd_id;
 *         $PHORUM['DB']->update_settings(array(
 *             "mod_foo" => $PHORUM["mod_foo"]
 *         ));
 *
 *         return $msgthd_id;
 *     }
 *     </hookcode>
 */
if (isset($PHORUM["hooks"]["hide_thread"])) {
    phorum_api_hook("hide_thread", $msgthd_id);
}
// updating the thread-info
phorum_api_thread_update_metadata($old_message['thread']);
// updating the forum-stats
$PHORUM['DB']->update_forum_stats(false, "-{$num_hidden}");
$PHORUM['DATA']['OKMSG'] = "{$num_hidden} " . $PHORUM['DATA']['LANG']['MsgHiddenOk'];
if (isset($PHORUM['args']["prepost"])) {
    $PHORUM['DATA']["URL"]["REDIRECT"] = phorum_api_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_UNAPPROVED);
} else {
    $PHORUM['DATA']["URL"]["REDIRECT"] = $PHORUM["DATA"]["URL"]["LIST"];
}
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:hide_post.php

示例3: phorum_api_hook

 *     Allow modules to perform custom action whenever the user edits his post.
 *     This can be used to e.g. redirect the user immediately back to the edited
 *     post where he came from.
 *
 * [category]
 *     Message handling
 *
 * [when]
 *     In <filename>action_edit.php</filename> at the end of the file when
 *     everything has been done.
 *
 * [input]
 *     Array containing message data.
 *
 * [output]
 *     Same as input.
 *
 * [example]
 *     <hookcode>
 *     function phorum_mod_foo_posting_action_edit_post ($message)
 *     {
 *         global $PHORUM;
 *
 *         // perform a custom redirect
 *         phorum_redirect_by_url($PHORUM["DATA"]["URL"]["REDIRECT"]);
 *     }
 *     </hookcode>
 */
if (isset($PHORUM["hooks"]["posting_action_edit_post"])) {
    phorum_api_hook("posting_action_edit_post", $message);
}
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:action_edit.php

示例4: phorum_pm_quoteformat

function phorum_pm_quoteformat($orig_author, $orig_author_id, $message, $inreplyto = NULL)
{
    global $PHORUM;
    // Build the reply subject.
    if (substr($message["subject"], 0, 3) != "Re:") {
        $message["subject"] = "Re: " . $message["subject"];
    }
    // Lookup the plain text name that we have to use for the author that we reply to.
    $author = phorum_api_user_get_display_name($orig_author_id, '', PHORUM_FLAG_PLAINTEXT);
    // TODO we'll have to handle anonymous users in the PM box. Those are
    // TODO users which sent a PM to somebody, but signed out afterwards.
    // TODO Currently, there's no graceful handling for that I think
    // TODO (maybe it's handled already, but that would only be by accident).
    if (isset($PHORUM["hooks"]["quote"])) {
        $quote = phorum_api_hook("quote", array($author, $message["message"], $orig_author_id));
    }
    if (empty($quote) || is_array($quote)) {
        // Build a quoted version of the message body.
        $quote = phorum_api_format_strip($message["message"]);
        $quote = str_replace("\n", "\n> ", $quote);
        $quote = wordwrap(trim($quote), 50, "\n> ", true);
        $quote = "{$author} {$PHORUM['DATA']['LANG']['Wrote']}:\n" . str_repeat("-", 55) . "\n> {$quote}\n\n\n";
    }
    $quote = ($inreplyto != NULL ? "{$PHORUM['DATA']['LANG']['InReplyTo']} {$inreplyto}\n\n" : '') . $quote;
    $message["message"] = $quote;
    return $message;
}
开发者ID:netovs,项目名称:Core,代码行数:27,代码来源:pm.php

示例5: phorum_api_hook

 * [when]
 *     Right before the <literal>PhorumInputForm</literal> object is shown.
 *
 * [input]
 *     The <literal>PhorumInputForm</literal> object.
 *
 * [output]
 *     Same as input.
 *
 * [example]
 *     <hookcode>
 *     function phorum_mod_foo_admin_general ($frm) 
 *     {
 *         // Add a section for the foo settings
 *         $frm->addbreak( "Foo Module Settings" );
 *
 *         // Add the option to cache the bar
 *         $row=$frm->addrow( "Enable Bar Caching:", $frm->select_tag( "mod_foo[enable_bar_caching]", array( "No", "Yes" ), $PHORUM["mod_foo"]["enable_bar_caching"] ) );
 *         $frm->addhelp($row, "Enable Bar Caching", "If you select yes for this option, then the bar will be cached." );
 *
 *         // Return the modified PhorumInputForm
 *         return $frm;
 *
 *     }
 *     </hookcode>
 */
$frm = phorum_api_hook("admin_general", $frm);
$frm->show();
?>

开发者ID:netovs,项目名称:Core,代码行数:29,代码来源:settings.php

示例6: phorum_api_hook

     *             case 'unapproved':
     *                 $log = 'No new password generated for ' .
     *                        'unapproved user ' . $user['username'];
     *                 break;
     *         }
     *
     *         if ($log !== NULL) {
     *             log_the_password_reset($log);
     *         }
     *
     *         return $user;
     *     }
     *     </hookcode>
     */
    if ($hook_args && isset($PHORUM['hooks']['password_reset'])) {
        phorum_api_hook("password_reset", $hook_args);
    }
}
// ----------------------------------------------------------------------------
// Build template data and output the page
// ----------------------------------------------------------------------------
$redir = htmlspecialchars($redir, ENT_COMPAT, $PHORUM['DATA']['HCHARSET']);
// Fill the breadcrumbs-info.
$PHORUM['DATA']['BREADCRUMBS'][] = array('URL' => '', 'TEXT' => $PHORUM['DATA']['LANG']['LogIn'], 'TYPE' => 'login');
// Fill the page heading info.
$PHORUM['DATA']['HEADING'] = $heading;
$PHORUM['DATA']['HTML_DESCRIPTION'] = '';
$PHORUM['DATA']['DESCRIPTION'] = '';
// Setup template data.
$PHORUM['DATA']['LOGIN']['redir'] = $redir;
$PHORUM['DATA']['URL']['REGISTER'] = phorum_api_url(PHORUM_REGISTER_URL);
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:login.php

示例7: phorum_api_hook

  *         // Set the type of list page to use, based on a cookie.
  *         if (empty($_COOKIE['list_style'])) {
  *             $PHORUM['threaded_list'] = PHORUM_THREADED_DEFAULT;
  *         } elseif ($_COOKIE['list_style'] == 'threaded') {
  *             $PHORUM['threaded_list'] = PHORUM_THREADED_ON;
  *         } elseif ($_COOKIE['list_style'] == 'flat') {
  *             $PHORUM['threaded_list'] = PHORUM_THREADED_OFF;
  *         } elseif ($_COOKIE['list_style'] == 'hybrid') {
  *             $PHORUM['threaded_list'] = PHORUM_THREADED_HYBRID;
  *         }
  *     }
  *     </hookcode>
  */
 $page_hook = 'page_' . phorum_page;
 if (isset($PHORUM["hooks"][$page_hook])) {
     phorum_api_hook($page_hook, "");
 }
 $formatted = phorum_api_format_users(array($PHORUM['user']));
 $PHORUM['DATA']['USER'] = $formatted[0];
 $PHORUM['DATA']['PHORUM_PAGE'] = phorum_page;
 $PHORUM['DATA']['USERTRACK'] = $PHORUM['track_user_activity'];
 $PHORUM['DATA']['VROOT'] = $PHORUM['vroot'];
 $PHORUM['DATA']['POST_VARS'] .= "<input type=\"hidden\" name=\"forum_id\" value=\"{$PHORUM["forum_id"]}\" />\n";
 if (!empty($PHORUM['ref_thread_id'])) {
     $PHORUM['DATA']['POST_VARS'] .= "<input type=\"hidden\" name=\"ref_thread_id\" value=\"{$PHORUM["ref_thread_id"]}\" />\n";
 }
 if (!empty($PHORUM['ref_message_id'])) {
     $PHORUM['DATA']['POST_VARS'] .= "<input type=\"hidden\" name=\"ref_message_id\" value=\"{$PHORUM["ref_message_id"]}\" />\n";
 }
 if (!empty($PHORUM['use_rss'])) {
     if ($PHORUM["default_feed"] == "rss") {
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:common.php

示例8: phorum_shutdown

/**
 * The Phorum shutdown function, which will always be called when a
 * Phorum script ends.
 */
function phorum_shutdown()
{
    global $PHORUM;
    // Strange things happen during shutdown
    // Make sure that we are in the Phorum dir.
    /**
     * @todo Still needed now we include files using absolute paths?
     */
    $working_dir = getcwd();
    chdir(PHORUM_PATH);
    /*
     * [hook]
     *     phorum_shutdown
     *
     * [description]
     *     This hook gives modules a chance to easily hook into
     *     PHP's <phpfunc>register_shutdown_function</phpfunc>
     *     functionality.<sbr/>
     *     <sbr/>
     *     Code that you put in a phorum_shutdown hook will be run after
     *     running a Phorum script finishes. This hook can be considered
     *     an expert hook. Only use it if you really need it and if you
     *     are aware of implementation details of PHP's shutdown
     *     functionality.
     *
     * [category]
     *     Page output
     *
     * [when]
     *     After running a Phorum script finishes.
     *
     * [input]
     *     No input.
     *
     * [output]
     *     No output.
     */
    if (isset($PHORUM["hooks"]["shutdown"])) {
        phorum_api_hook("shutdown");
    }
    // Shutdown the database connection.
    $PHORUM['DB']->close_connection();
    if ($working_dir !== FALSE) {
        chdir($working_dir);
    }
}
开发者ID:samuell,项目名称:Core,代码行数:50,代码来源:api.php

示例9: phorum_api_hook

 * {
 *     // An optional name=.... argument can be used in the request.
 *     $name = phorum_ajax_getarg('name', 'string', 'Anonymous Person');
 *
 *     // This will return a JSON encoded string to the client.
 *     phorum_ajax_return("Hello, $name");
 * }
 * </hookcode>
 *
 * For this hook implementation, a GET based URL to fire this
 * Ajax call could look like
 * <literal>http://example.com/ajax.php?call=sayhello,name=JohnDoe</literal>.
 */
$call_hook = 'ajax_' . $ajax_call;
if (isset($PHORUM['hooks'][$call_hook])) {
    phorum_api_hook($call_hook, $PHORUM['ajax_args']);
}
// Check if the Ajax call has a core handler script.
if (file_exists("./include/ajax/call.{$ajax_call}.php")) {
    include "./include/ajax/call.{$ajax_call}.php";
    exit;
}
// No handler script available. Bail out.
phorum_ajax_error('Unknown call "' . $ajax_call . '" in Ajax POST request');
// ----------------------------------------------------------------------
// Utility functions that can be used by Ajax call implementations
// ----------------------------------------------------------------------
/**
 * Return an Ajax error to the caller.
 *
 * This will send an error (500 HTTP status code) message to the client,
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:ajax.php

示例10: phorum_api_hook

     *
     * [when]
     *     Right after the javascript.php script has generated a new
     *     JavaScript file and right before storing that file in the cache.
     *     The filter hook will not be run for every request to
     *     javascript.php, but only in case the JavaScript code has
     *     to be refreshed.
     *
     * [input]
     *     The generated JavaScript code.
     *
     * [output]
     *     The filtered JavaScript code.
     */
    if (isset($PHORUM['hooks']['javascript_filter'])) {
        $content = phorum_api_hook('javascript_filter', $content);
    }
    if (!empty($PHORUM['cache_javascript'])) {
        $cache_time = time();
        phorum_cache_put('js', $cache_key, array($cache_time, $content), 86400);
    }
    // Send the JavaScript to the browser.
    header("Content-Type: text/javascript");
    print "/* FRESH */";
    print $content;
    // Exit here explicitly for not giving back control to portable and
    // embedded Phorum setups.
    exit(0);
}
// Find the modification time for the cache file.
$last_modified = $cache_time;
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:javascript.php

示例11: phorum_api_user_get_display_name

    $message["thread"] = $dbmessage["thread"];
    // Create Re: subject prefix.
    if (substr($dbmessage["subject"], 0, 4) != "Re: ") {
        $dbmessage["subject"] = "Re: " . $dbmessage["subject"];
    }
    $message["subject"] = $dbmessage["subject"];
    // Add a quoted version of the body for quoted reply messages.
    if ($mode == "quote") {
        // Lookup the name that we have to use for the author, if the
        // author is a registered user. The author field could be used
        // directly, but it can contain HTML formatting code, in case
        // some module uses the custom display name functionality.
        $author = phorum_api_user_get_display_name($dbmessage["user_id"], $dbmessage['author'], PHORUM_FLAG_PLAINTEXT);
        $quoted = 0;
        if (isset($PHORUM["hooks"]["quote"])) {
            $quoted = phorum_api_hook("quote", array($author, $dbmessage["body"], $dbmessage["user_id"]));
        }
        if (empty($quoted) || is_array($quoted)) {
            $quoted = phorum_api_format_strip($dbmessage["body"]);
            $quoted = str_replace("\n", "\n> ", $quoted);
            $quoted = wordwrap(trim($quoted), 50, "\n> ", true);
            $quoted = "{$author} " . "{$PHORUM["DATA"]["LANG"]["Wrote"]}:\n" . str_repeat("-", 55) . "\n> {$quoted}\n\n\n";
        }
        $message["body"] = $quoted;
    }
}
// Set message data for editing posts.
if ($mode == "edit" || $mode == "moderation") {
    // Transfer all database fields to the form fields.
    $message = phorum_posting_merge_db2form($message, $dbmessage, ALLFIELDS);
}
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:request_first.php

示例12: phorum_api_hook

 *
 * [description]
 *     This hook can be used for performing actions like sending
 *     notifications or making log entries after making a message sticky.
 *
 * [category]
 *     Moderation
 *
 * [when]
 *     In <filename>include/moderation/make_sticky.php</filename>,
 *     right after a message has been made sticky by a moderator.
 *
 * [input]
 *     The id of the thread that has to be made sticky.
 *
 * [output]
 *     Same as input.
 *
 * [example]
 *     <hookcode>
 *     function phorum_mod_foo_make_sticky($msgthd_id)
 *     {
 *         // ... extra processing for make_sticky operations goes here ...
 *
 *         return $msgthd_id;
 *     }
 *     </hookcode>
 */
if (isset($PHORUM["hooks"]["make_sticky"])) {
    phorum_api_hook("make_sticky", $msgthd_id);
}
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:make_unsticky.php

示例13: phorum_api_hook

 *     Allow modules to perform custom action whenever the user cancels editing
 *     of his post. This can be used to e.g. redirect the user immediately back
 *     to the edited post where he came from.
 *
 * [category]
 *     Message handling
 *
 * [when]
 *     In <filename>action_cancel.php</filename> at the end of the file when 
 *     everything has been done.
 *
 * [input]
 *     Array containing message data.
 *
 * [output]
 *     Same as input.
 *
 * [example]
 *     <hookcode>
 *     function phorum_mod_foo_posting_action_cancel_post ($message)
 *     {
 *         global $PHORUM;
 *
 *         // perform a custom redirect
 *         phorum_redirect_by_url($PHORUM["DATA"]["URL"]["REDIRECT"]);
 *     }
 *     </hookcode>
 */
if (isset($PHORUM["hooks"]["posting_action_cancel_post"])) {
    phorum_api_hook("posting_action_cancel_post", $message);
}
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:action_cancel.php

示例14: phorum_api_format_messages


//.........这里部分代码省略.........
            // Convert legacy <...> URLs into bare URLs.
            $body = preg_replace("/<(\n                    (?:http|https|ftp):\\/\\/\n                    [a-z0-9;\\/\\?:@=\\&\$\\-_\\.\\+!*'\\(\\),~%]+?\n                  )>/xi", "\$1", $body);
            // Escape special HTML characters.
            $escaped_body = htmlspecialchars($body, ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
            // When there is a charset mismatch between the database
            // and the language file, then bodies might get crippled
            // because of the htmlspecialchars() call. Here we try to
            // correct this issue. It's not perfect, but we do what
            // we can ...
            if ($escaped_body == '') {
                if (function_exists("iconv")) {
                    // We are gonna guess and see if we get lucky.
                    $escaped_body = iconv("ISO-8859-1", $PHORUM["DATA"]["HCHARSET"], $body);
                } else {
                    // We let htmlspecialchars use its defaults.
                    $escaped_body = htmlspecialchars($body);
                }
            }
            $body = $escaped_body;
            // Replace newlines with $phorum_br temporarily.
            // This way the mods know what breaks were added by
            // Phorum and what breaks by the user.
            $body = str_replace("\n", "{$phorum_br}\n", $body);
            // Censor bad words in the body.
            if ($censor_search !== NULL) {
                $body = preg_replace($censor_search, $censor_replace, $body);
            }
            $messages[$id]['body'] = $body;
        }
        // -----------------------------------------------------------------
        // Message subject
        // -----------------------------------------------------------------
        // Censor bad words in the subject.
        if (isset($message['subject']) && $censor_search !== NULL) {
            $messages[$id]['subject'] = preg_replace($censor_search, $censor_replace, $message['subject']);
        }
        // Escape special HTML characters.
        if (isset($message['subject'])) {
            $messages[$id]['subject'] = htmlspecialchars($messages[$id]['subject'], ENT_COMPAT, $PHORUM['DATA']['HCHARSET']);
        }
        // -----------------------------------------------------------------
        // Message author
        // -----------------------------------------------------------------
        // Escape special HTML characters in the email address.
        if (isset($message['email'])) {
            $messages[$id]['email'] = htmlspecialchars($message['email'], ENT_COMPAT, $PHORUM['DATA']['HCHARSET']);
        }
        // Do author formatting for all provided author fields.
        foreach ($author_specs as $spec) {
            // Use "Anonymous user" as the author name if there's no author
            // name available for some reason.
            if (!isset($message[$spec[1]]) || $message[$spec[1]] == '') {
                $messages[$id][$spec[3]] = $PHORUM["DATA"]["LANG"]["AnonymousUser"];
            } elseif (!empty($message[$spec[0]])) {
                $url = str_replace('%spec_data%', $message[$spec[0]], $profile_url_template);
                $messages[$id]["URL"][$spec[4]] = $url;
                $messages[$id][$spec[3]] = empty($PHORUM["custom_display_name"]) ? htmlspecialchars($message[$spec[1]], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]) : $message[$spec[1]];
            } elseif ($spec[2] !== NULL && !empty($message[$spec[2]]) && (empty($PHORUM['hide_email_addr']) || !empty($PHORUM["user"]["admin"]) || phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_MESSAGES) && PHORUM_MOD_EMAIL_VIEW || phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_USERS) && PHORUM_MOD_EMAIL_VIEW)) {
                $messages[$id][$spec[3]] = htmlspecialchars($message[$spec[1]], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
                $email_url = phorum_api_format_html_encode("mailto:" . $message[$spec[2]]);
                $messages[$id]["URL"]["PROFILE"] = $email_url;
            } else {
                $messages[$id][$spec[3]] = htmlspecialchars($message[$spec[1]], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
            }
            if ($censor_search !== NULL) {
                $messages[$id][$spec[3]] = preg_replace($censor_search, $censor_replace, $messages[$id][$spec[3]]);
            }
        }
    }
    // A hook for module writers to apply custom message formatting.
    if (isset($PHORUM["hooks"]["format"])) {
        $messages = phorum_api_hook("format", $messages);
    }
    // A hook for module writers for doing post formatting fixups.
    if (isset($PHORUM["hooks"]["format_fixup"])) {
        $messages = phorum_api_hook("format_fixup", $messages);
    }
    // Clean up after the mods are done.
    foreach ($messages as $id => $message) {
        // Clean up line breaks inside pre and xmp tags. These tags
        // take care of showing newlines as breaks themselves.
        if (isset($message['body']) && $message['body'] != '') {
            foreach (array('pre', 'goep', 'xmp') as $tagname) {
                if (preg_match_all("/(<{$tagname}.*?>).+?(<\\/{$tagname}>)/si", $message['body'], $matches)) {
                    foreach ($matches[0] as $match) {
                        $stripped = str_replace($phorum_br, '', $match);
                        $message['body'] = str_replace($match, $stripped, $message['body']);
                    }
                }
            }
            // Remove line break after div, quote and code tags. These
            // tags have their own line break. Without this, there would
            // be to many white lines.
            $message['body'] = preg_replace("/\\s*(<\\/?(?:div|xmp|blockquote|pre)[^>]*>)\\s*\\Q{$phorum_br}\\E/", '$1', $message['body']);
            // Normalize the Phorum line breaks that are left.
            $messages[$id]['body'] = str_replace($phorum_br, "<br />", $message['body']);
        }
    }
    return $messages;
}
开发者ID:samuell,项目名称:Core,代码行数:101,代码来源:messages.php

示例15: phorum_api_user_list_moderators

         if (empty($_POST["explanation"])) {
             $_POST["explanation"] = "<" . $PHORUM["DATA"]["LANG"]["None"] . ">";
         }
         $mail_users = phorum_api_user_list_moderators($PHORUM['forum_id'], $PHORUM['email_ignore_admin'], TRUE);
         if (count($mail_users)) {
             $mail_data = array("mailmessage" => $PHORUM["DATA"]["LANG"]['ReportPostEmailBody'], "mailsubject" => $PHORUM["DATA"]["LANG"]['ReportPostEmailSubject'], "forumname" => $PHORUM["DATA"]["NAME"], "reportedby" => $PHORUM["user"]["display_name"], "author" => $message["author"], "subject" => $message["subject"], "body" => wordwrap($message["body"], 72), "ip" => $message["ip"], "raw_date" => $message["datestamp"], "date" => phorum_api_format_date($PHORUM["short_date_time"], $message["datestamp"]), "explanation" => wordwrap($_POST["explanation"], 72), "url" => phorum_api_url(PHORUM_READ_URL, $message["thread"], $message_id), "delete_url" => phorum_api_url(PHORUM_MODERATION_URL, PHORUM_DELETE_MESSAGE, $message_id), "hide_url" => phorum_api_url(PHORUM_MODERATION_URL, PHORUM_HIDE_POST, $message_id), "edit_url" => phorum_api_url(PHORUM_POSTING_URL, 'moderation', $message_id), "reporter_url" => phorum_api_url(PHORUM_PROFILE_URL, $PHORUM["user"]["user_id"]), "message" => $message);
             if (isset($_POST[PHORUM_SESSION_LONG_TERM])) {
                 // strip any auth info from the created urls
                 $mail_data["url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["url"]);
                 $mail_data["delete_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["delete_url"]);
                 $mail_data["hide_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["hide_url"]);
                 $mail_data["edit_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["edit_url"]);
                 $mail_data["reporter_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["reporter_url"]);
             }
             if (isset($PHORUM["hooks"]["report"])) {
                 $mail_data = phorum_api_hook("report", $mail_data);
             }
             phorum_api_mail($mail_users, $mail_data);
             $PHORUM["DATA"]["URL"]["REDIRECT"] = phorum_api_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $message["thread"], $message['message_id']);
             $PHORUM["DATA"]["BACKMSG"] = $PHORUM["DATA"]["LANG"]["BackToThread"];
             $PHORUM["DATA"]["OKMSG"] = $PHORUM["DATA"]["LANG"]["ReportPostSuccess"];
             $template = "message";
             $report = true;
         }
     } else {
         $PHORUM["DATA"]["ReportPostMessage"] = $PHORUM["DATA"]["LANG"]['ReportPostNotAllowed'];
     }
 }
 // format message
 list($message) = phorum_api_format_messages(array($message));
 $PHORUM["DATA"]["PostSubject"] = $message["subject"];
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:report.php


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