$PHORUM["DATA"]["MESSAGE"]=$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_user_unsubscribe( $PHORUM['user']['user_id'], $thread ); phorum_user_subscribe( $PHORUM['user']['user_id'], $message["forum_id"], $thread, PHORUM_SUBSCRIPTION_BOOKMARK ); $PHORUM["DATA"]["MESSAGE"]=$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 = (isset($_POST["send_email"])) ? PHORUM_SUBSCRIPTION_MESSAGE : PHORUM_SUBSCRIPTION_BOOKMARK; phorum_user_subscribe( $PHORUM['user']['user_id'], $message["forum_id"], $thread, $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"]["MESSAGE"]=$PHORUM["DATA"]["LANG"]["BookmarkedThread"]; $template="message"; } else { // we are following a new thread $PHORUM["DATA"]["URL"]["ACTION"]=phorum_get_url(PHORUM_FOLLOW_ACTION_URL); $PHORUM["DATA"]["SUBJECT"]=htmlspecialchars($message["subject"]); $PHORUM["DATA"]["THREAD"]=$thread; $PHORUM["DATA"]["FORUM_ID"]=$PHORUM["forum_id"]; $template="follow"; } // set all our common URL's
if(!defined("PHORUM_CONTROL_CENTER")) return; // remove threads fromlist if(isset($_POST["delthreads"])){ foreach($_POST["delthreads"] as $thread){ phorum_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_user_unsubscribe( $PHORUM['user']['user_id'], $thread ); phorum_user_subscribe( $PHORUM['user']['user_id'], $_POST["thread_forum_id"][$thread], $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 = 2; } $PHORUM['DATA']['SELECTED'] = $subdays;
/** * Subscribe the author of the message to the thread. * @return void */ public function subscribeToThread() { // Subscribe user to the thread if requested. phorum_user_subscribe($this->m_data['user_id'], $this->m_data['forum_id'], $this->m_data["thread"], PHORUM_SUBSCRIPTION_MESSAGE); } // fn subscribeToThread
// format (otherwise it's a bit messed up in the // post-function). Do merge back data which is not // stored in the database, but which we might need later on. $message = phorum_db_get_message($message["message_id"]); foreach ($message_copy as $key => $val) { if (! isset($message[$key])) { $message[$key] = $val; } } phorum_update_thread_info($message["thread"]); // Subscribe user to the thread if requested. if ($message["email_notify"] && $message["user_id"]) { phorum_user_subscribe( $message["user_id"], $PHORUM["forum_id"], $message["thread"], PHORUM_SUBSCRIPTION_MESSAGE ); } // Mark own message read. if ($PHORUM["DATA"]["LOGGEDIN"]) { phorum_db_newflag_add_read(array(0=>array( "id" => $message["message_id"], "forum" => $message["forum_id"], ))); phorum_user_addpost(); } // Actions for messages which are approved. if ($message["status"] > 0) {