Ejemplo n.º 1
0
////////////////////////////////////////////////////////////////////////////////
if (!defined("PHORUM_CONTROL_CENTER")) {
    return;
}
// remove threads fromlist
if (isset($_POST["delthreads"])) {
    foreach ($_POST["delthreads"] as $thread) {
        phorum_api_user_unsubscribe($PHORUM['user']['user_id'], $thread);
    }
}
// change any email settings
if (isset($_POST["sub_type"])) {
    foreach ($_POST["sub_type"] as $thread => $type) {
        if ($type != $_POST["old_sub_type"][$thread]) {
            phorum_api_user_unsubscribe($PHORUM['user']['user_id'], $thread);
            phorum_api_user_subscribe($PHORUM['user']['user_id'], $thread, $_POST["thread_forum_id"][$thread], $type);
        }
    }
}
// the number of days to show
if (isset($_POST['subdays']) && is_numeric($_POST['subdays'])) {
    $subdays = $_POST['subdays'];
} elseif (isset($PHORUM['args']['subdays']) && !empty($PHORUM["args"]['subdays']) && is_numeric($PHORUM["args"]['subdays'])) {
    $subdays = $PHORUM['args']['subdays'];
} else {
    $subdays = phorum_api_user_get_setting('cc_subscriptions_subdays');
}
if ($subdays === NULL) {
    $subdays = 2;
}
$PHORUM['DATA']['SELECTED'] = $subdays;
Ejemplo n.º 2
0
                $subscribe_type = PHORUM_SUBSCRIPTION_MESSAGE;
            }
            break;
        case "":
            if ($PHORUM["DATA"]["OPTION_ALLOWED"]["subscribe_mail"]) {
                $subscribe_type = PHORUM_SUBSCRIPTION_NONE;
            }
            break;
        default:
            trigger_error("Illegal message subscription type: " . htmlspecialchars($message["subscription"]));
            break;
    }
    if ($subscribe_type === NULL) {
        phorum_api_user_unsubscribe($message["user_id"], $message["thread"]);
    } else {
        phorum_api_user_subscribe($message["user_id"], $message["thread"], $PHORUM["forum_id"], $subscribe_type);
    }
}
$PHORUM["posting_template"] = "message";
$PHORUM["DATA"]["OKMSG"] = $PHORUM["DATA"]["LANG"]["MsgModEdited"];
$PHORUM['DATA']["BACKMSG"] = $PHORUM['DATA']["LANG"]["BackToThread"];
$PHORUM["DATA"]["URL"]["REDIRECT"] = phorum_api_url(PHORUM_READ_URL, $message["thread"], $message["message_id"]);
/*
 * [hook]
 *     posting_action_edit_post
 *
 * [description]
 *     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.
 *
Ejemplo n.º 3
0
    $PHORUM["DATA"]["OKMSG"] = $PHORUM["DATA"]["LANG"]["RemoveFollowed"];
    $PHORUM["DATA"]["URL"]["REDIRECT"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $thread);
    $PHORUM["DATA"]["BACKMSG"] = $PHORUM["DATA"]["LANG"]["BackToThread"];
    $template = "message";
} elseif (isset($PHORUM["args"]["noemail"])) {
    // we are stopping emails for this thread
    phorum_api_user_unsubscribe($PHORUM['user']['user_id'], $thread);
    phorum_api_user_subscribe($PHORUM['user']['user_id'], $thread, $message["forum_id"], PHORUM_SUBSCRIPTION_BOOKMARK);
    $PHORUM["DATA"]["OKMSG"] = $PHORUM["DATA"]["LANG"]["NoMoreEmails"];
    $PHORUM["DATA"]["URL"]["REDIRECT"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $thread);
    $PHORUM["DATA"]["BACKMSG"] = $PHORUM["DATA"]["LANG"]["BackToThread"];
    $template = "message";
} elseif (!empty($_POST)) {
    // the user has submitted the form
    $type = !empty($PHORUM["allow_email_notify"]) && isset($_POST["send_email"]) ? PHORUM_SUBSCRIPTION_MESSAGE : PHORUM_SUBSCRIPTION_BOOKMARK;
    phorum_api_user_subscribe($PHORUM['user']['user_id'], $thread, $message["forum_id"], $type);
    $PHORUM["DATA"]["URL"]["REDIRECT"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $thread);
    $PHORUM["DATA"]["BACKMSG"] = $PHORUM["DATA"]["LANG"]["BackToThread"];
    $PHORUM["DATA"]["OKMSG"] = $PHORUM["DATA"]["LANG"]["BookmarkedThread"];
    $template = "message";
} else {
    // we are following a new thread
    require_once "include/format_functions.php";
    $messages = phorum_format_messages(array(1 => $message));
    $message = $messages[1];
    $PHORUM["DATA"]["URL"]["ACTION"] = phorum_get_url(PHORUM_FOLLOW_ACTION_URL);
    $PHORUM["DATA"]["SUBJECT"] = $message["subject"];
    $PHORUM["DATA"]["AUTHOR"] = $message["author"];
    $PHORUM["DATA"]["THREAD"] = $thread;
    $PHORUM["DATA"]["FORUM_ID"] = $PHORUM["forum_id"];
    $PHORUM["DATA"]["ALLOW_EMAIL_NOTIFY"] = !empty($PHORUM["allow_email_notify"]);