Esempio n. 1
0
function phorum_email_moderators($message)
{
    $PHORUM=$GLOBALS["PHORUM"];

    $mail_users = phorum_user_get_moderators($PHORUM['forum_id'],false,true);

    if (count($mail_users)) {
        include_once("./include/format_functions.php");
        if($message["status"] > 0) { // just notification of a new message
            $mailtext = $PHORUM["DATA"]["LANG"]['NewUnModeratedMessage'];
        } else { // posts needing approval
            $mailtext = $PHORUM["DATA"]["LANG"]['NewModeratedMessage'];
        }
        $mail_data = array(
            "mailmessage" => $mailtext,
            "mailsubject" => $PHORUM["DATA"]["LANG"]['NewModeratedSubject'],
            "forumname"   => strip_tags($PHORUM["DATA"]["NAME"]),
            "forum_id"    => $PHORUM['forum_id'],
            "message_id"  => $message['message_id'],
            "author"      => $message['author'],
            "subject"     => $message['subject'],
            "full_body"   => $message['body'],
            "plain_body"  => phorum_strip_body($message['body']),
            "approve_url" => phorum_get_url(PHORUM_PREPOST_URL),
            "read_url"    => phorum_get_url(PHORUM_READ_URL, $message['thread'], $message['message_id'])
        );
        if (isset($_POST[PHORUM_SESSION_LONG_TERM])) {
            // strip any auth info from the read url
            $mail_data["read_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["read_url"]);
            $mail_data["approve_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["approve_url"]);
        }
        phorum_email_user($mail_users, $mail_data);
    }
}
Esempio n. 2
0
$template = "report";

// get the message
if (is_numeric($PHORUM["args"][1])) {
    $message_id = $PHORUM["args"][1];
    $message = phorum_db_get_message($message_id);
}

// check for report requests
if(!empty($_POST["report"])) {
    if ($PHORUM["DATA"]["LOGGEDIN"]){
        if (empty($_POST["explanation"])){
            $_POST["explanation"] = "<" . $PHORUM["DATA"]["LANG"]["None"] . ">";
        }

        $mail_users = phorum_user_get_moderators($PHORUM['forum_id'],false,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"]["username"],
                "author"      => $message["author"],
                "subject"     => $message["subject"],
                "body"        => wordwrap($message["body"], 72),
                "ip"          => $message["ip"],
                "date"        => phorum_date($PHORUM["short_date"], $message["datestamp"]),
                "explanation" => wordwrap($_POST["explanation"], 72),
                "url"         => phorum_get_url(PHORUM_READ_URL, $message["thread"], $message_id),
                "delete_url"  => phorum_get_url(PHORUM_MODERATION_URL, PHORUM_DELETE_MESSAGE, $message_id),