Index: includes/common/functions.php
===================================================================
--- includes/common/functions.php	(revision 5155)
+++ includes/common/functions.php	(working copy)
@@ -982,7 +982,7 @@
 /** Subscriptions *************************************************************/
 
 /**
- * Sends notification emails for new posts
+ * Sends notification emails for new replies to subscribed topics
  *
  * Gets new post's ID and check if there are subscribed users to that topic, and
  * if there are, send notifications
@@ -992,22 +992,26 @@
  * @param int $reply_id ID of the newly made reply
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
  * @uses bbp_get_reply_id() To validate the reply ID
+ * @uses bbp_get_topic_id() To validate the topic ID
+ * @uses bbp_get_forum_id() To validate the forum ID
  * @uses bbp_get_reply() To get the reply
- * @uses bbp_get_reply_topic_id() To get the topic ID of the reply
  * @uses bbp_is_reply_published() To make sure the reply is published
  * @uses bbp_get_topic_id() To validate the topic ID
  * @uses bbp_get_topic() To get the reply's topic
  * @uses bbp_is_topic_published() To make sure the topic is published
- * @uses get_the_author_meta() To get the author's display name
- * @uses do_action() Calls 'bbp_pre_notify_subscribers' with the reply id and
- *                    topic id
+ * @uses bbp_get_reply_author_display_name() To get the reply author's display name
+ * @uses do_action() Calls 'bbp_pre_notify_subscribers' with the reply id,
+ *                    topic id and user id
  * @uses bbp_get_topic_subscribers() To get the topic subscribers
  * @uses apply_filters() Calls 'bbp_subscription_mail_message' with the
- *                        message, reply id, topic id and user id
+ *                    message, reply id, topic id and user id
+ * @uses apply_filters() Calls 'bbp_subscription_mail_title' with the
+ *                    topic title, reply id, topic id and user id
+ * @uses apply_filters() Calls 'bbp_subscription_mail_headers'
  * @uses get_userdata() To get the user data
  * @uses wp_mail() To send the mail
- * @uses do_action() Calls 'bbp_post_notify_subscribers' with the reply id
- *                    and topic id
+ * @uses do_action() Calls 'bbp_post_notify_subscribers' with the reply id,
+ *                    topic id and user id
  * @return bool True on success, false on failure
  */
 function bbp_notify_subscribers( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $reply_author = 0 ) {
@@ -1036,7 +1040,7 @@
 
 	/** User ******************************************************************/
 
-	// Get subscribers and bail if empty
+	// Get topic subscribers and bail if empty
 	$user_ids = bbp_get_topic_subscribers( $topic_id, true );
 	if ( empty( $user_ids ) )
 		return false;
@@ -1108,6 +1112,126 @@
 	return true;
 }
 
+/**
+ * Sends notification emails for new topics to subscribed forums
+ *
+ * @since bbPress (r5155)
+ *
+ * Gets new post's ID and check if there are subscribed users to that topic, and
+ * if there are, send notifications
+ *
+ * @since bbPress (r5155)
+ *
+ * @param int $topic_id ID of the newly made reply
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
+ * @uses bbp_get_topic_id() To validate the topic ID
+ * @uses bbp_get_forum_id() To validate the forum ID
+ * @uses bbp_is_topic_published() To make sure the topic is published
+ * @uses bbp_get_forum_subscribers() To get the forum subscribers
+ * @uses bbp_get_topic_author_display_name() To get the topic author's display name
+ * @uses do_action() Calls 'bbp_pre_notify_forum_subscribers' with the topic id,
+ *                    forum id and user id
+ * @uses apply_filters() Calls 'bbp_forum_subscription_mail_message' with the
+ *                    message, topic id, forum id and user id
+ * @uses apply_filters() Calls 'bbp_forum_subscription_mail_title' with the
+ *                    topic title, topic id, forum id and user id
+ * @uses apply_filters() Calls 'bbp_forum_subscription_mail_headers'
+ * @uses get_userdata() To get the user data
+ * @uses wp_mail() To send the mail
+ * @uses do_action() Calls 'bbp_post_notify_forum_subscribers' with the topic,
+ *                    id, forum id and user id
+ * @return bool True on success, false on failure
+ */
+function bbp_notify_forum_subscribers( $topic_id = 0, $forum_id = 0, $anonymous_data = false, $topic_author = 0 ) {
+
+	// Bail if subscriptions are turned off
+	if ( !bbp_is_subscriptions_active() )
+		return false;
+
+	/** Validation ************************************************************/
+
+	$topic_id = bbp_get_topic_id( $topic_id );
+	$forum_id = bbp_get_forum_id( $forum_id );
+
+	/** Topic *****************************************************************/
+
+	// Bail if topic is not published
+	if ( ! bbp_is_topic_published( $topic_id ) )
+		return false;
+
+	/** User ******************************************************************/
+
+	// Get forum subscribers and bail if empty
+	$user_ids = bbp_get_forum_subscribers( $forum_id, true );
+	if ( empty( $user_ids ) )
+		return false;
+
+	// Poster name
+	$topic_author_name = bbp_get_topic_author_display_name( $topic_id );
+
+	/** Mail ******************************************************************/
+
+	do_action( 'bbp_pre_notify_forum_subscribers', $topic_id, $forum_id, $user_ids );
+
+	// Remove filters from reply content and topic title to prevent content
+	// from being encoded with HTML entities, wrapped in paragraph tags, etc...
+	remove_all_filters( 'bbp_get_topic_content' );
+	remove_all_filters( 'bbp_get_topic_title'   );
+
+	// Strip tags from text
+	$topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
+	$topic_content = strip_tags( bbp_get_topic_content( $topic_id ) );
+	$topic_url     = get_permalink( $topic_id );
+	$blog_name     = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
+
+	// Loop through users
+	foreach ( (array) $user_ids as $user_id ) {
+
+		// Don't send notifications to the person who made the post
+		if ( !empty( $topic_author ) && (int) $user_id === (int) $topic_author )
+			continue;
+
+		// For plugins to filter messages per reply/topic/user
+		$message = sprintf( __( '%1$s wrote:
+
+%2$s
+
+Topic Link: %3$s
+
+-----------
+
+You are receiving this email because you subscribed to a forum.
+
+Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
+
+			$topic_author_name,
+			$topic_content,
+			$topic_url
+		);
+		$message = apply_filters( 'bbp_forum_subscription_mail_message', $message, $topic_id, $forum_id, $user_id );
+		if ( empty( $message ) )
+			continue;
+
+		// For plugins to filter titles per reply/topic/user
+		$subject = apply_filters( 'bbp_forum_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $topic_id, $forum_id, $user_id );
+		if ( empty( $subject ) )
+			continue;
+
+		// Custom headers
+		$headers = apply_filters( 'bbp_forum_subscription_mail_headers', array() );
+
+		// Get user data of this user
+		$user = get_userdata( $user_id );
+
+		// Send notification email
+		wp_mail( $user->user_email, $subject, $message, $headers );
+	}
+
+	do_action( 'bbp_post_notify_forum_subscribers', $topic_id, $forum_id, $user_ids );
+
+	return true;
+}
+
 /** Login *********************************************************************/
 
 /**
Index: includes/common/template.php
===================================================================
--- includes/common/template.php	(revision 5155)
+++ includes/common/template.php	(working copy)
@@ -2344,6 +2344,62 @@
 		return apply_filters( 'bbp_get_breadcrumb', $trail, $crumbs, $r );
 	}
 
+/** Forum Subscriptions ******************************************************/
+
+/**
+ * Output the forum subscription link
+ *
+ * @since bbPress (r5155)
+ *
+ * @uses bbp_get_forum_subscription_link()
+ */
+function bbp_forum_subscription_link( $args = array() ) {
+	echo bbp_get_forum_subscription_link( $args );
+}
+
+	/**
+	 * Get the forum subscription link
+	 *
+	 * @since bbPress (r5155)
+	 *
+	 * @uses bbp_parse_args()
+	 * @uses bbp_get_user_subscribe_link()
+	 * @uses apply_filters() Calls 'bbp_get_forum_subscribe_link'
+	 */
+	function bbp_get_forum_subscription_link( $args = array() ) {
+
+		// Parse args
+		$r = bbp_parse_args( $args, array(
+
+			// Forum
+			'forum_id'    => 0,
+
+			// User
+			'user_id'     => 0,
+
+			// HTML
+			'before'      => '<div class="bbp-forum-subscription"><p>',
+			'after'       => '</p></div>',
+
+			// Text
+			'subscribe'   => __( 'Subscribe to Forum', 'bbpress' ),
+			'unsubscribe' => __( 'Unsubscribe from Forum', 'bbpress' ),
+
+		), 'get_forum_subscribe_link' );
+
+		$link = $r['before'];
+
+		$link .= bbp_get_user_subscribe_link( array(
+			'before'      => '',
+			'subscribe'   => $r['subscribe'],
+			'unsubscribe' => $r['unsubscribe']
+		) );
+
+		$link .= $r['after'];
+
+		return apply_filters( 'bbp_get_forum_subscribe_link', $link, $r );
+	}
+
 /** Topic Tags ***************************************************************/
 
 /**
Index: includes/core/actions.php
===================================================================
--- includes/core/actions.php	(revision 5155)
+++ includes/core/actions.php	(working copy)
@@ -37,21 +37,21 @@
  *
  *           v--WordPress Actions        v--bbPress Sub-actions
  */
-add_action( 'plugins_loaded',           'bbp_loaded',                   10    );
-add_action( 'init',                     'bbp_init',                     0     ); // Early for bbp_register
-add_action( 'parse_query',              'bbp_parse_query',              2     ); // Early for overrides
-add_action( 'widgets_init',             'bbp_widgets_init',             10    );
-add_action( 'generate_rewrite_rules',   'bbp_generate_rewrite_rules',   10    );
-add_action( 'wp_enqueue_scripts',       'bbp_enqueue_scripts',          10    );
-add_action( 'wp_head',                  'bbp_head',                     10    );
-add_action( 'wp_footer',                'bbp_footer',                   10    );
-add_action( 'set_current_user',         'bbp_setup_current_user',       10    );
-add_action( 'setup_theme',              'bbp_setup_theme',              10    );
-add_action( 'after_setup_theme',        'bbp_after_setup_theme',        10    );
-add_action( 'template_redirect',        'bbp_template_redirect',        8     ); // Before BuddyPress's 10 [BB2225]
-add_action( 'login_form_login',         'bbp_login_form_login',         10    );
-add_action( 'profile_update',           'bbp_profile_update',           10, 2 ); // user_id and old_user_data
-add_action( 'user_register',            'bbp_user_register',            10    );
+add_action( 'plugins_loaded',           'bbp_loaded',                 10    );
+add_action( 'init',                     'bbp_init',                   0     ); // Early for bbp_register
+add_action( 'parse_query',              'bbp_parse_query',            2     ); // Early for overrides
+add_action( 'widgets_init',             'bbp_widgets_init',           10    );
+add_action( 'generate_rewrite_rules',   'bbp_generate_rewrite_rules', 10    );
+add_action( 'wp_enqueue_scripts',       'bbp_enqueue_scripts',        10    );
+add_action( 'wp_head',                  'bbp_head',                   10    );
+add_action( 'wp_footer',                'bbp_footer',                 10    );
+add_action( 'set_current_user',         'bbp_setup_current_user',     10    );
+add_action( 'setup_theme',              'bbp_setup_theme',            10    );
+add_action( 'after_setup_theme',        'bbp_after_setup_theme',      10    );
+add_action( 'template_redirect',        'bbp_template_redirect',      8     ); // Before BuddyPress's 10 [BB2225]
+add_action( 'login_form_login',         'bbp_login_form_login',       10    );
+add_action( 'profile_update',           'bbp_profile_update',         10, 2 ); // user_id and old_user_data
+add_action( 'user_register',            'bbp_user_register',          10    );
 
 /**
  * bbp_loaded - Attached to 'plugins_loaded' above
@@ -118,8 +118,8 @@
 add_action( 'bbp_register', 'bbp_register_shortcodes',     10 );
 
 // Autoembeds
-add_action( 'bbp_init', 'bbp_reply_content_autoembed', 8   );
-add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8   );
+add_action( 'bbp_init', 'bbp_reply_content_autoembed', 8 );
+add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 );
 
 /**
  * bbp_ready - attached to end 'bbp_init' above
@@ -224,7 +224,10 @@
 // Subscriptions
 add_action( 'bbp_trash_topic',  'bbp_remove_topic_from_all_subscriptions'       );
 add_action( 'bbp_delete_topic', 'bbp_remove_topic_from_all_subscriptions'       );
+add_action( 'bbp_trash_forum',  'bbp_remove_forum_from_all_subscriptions'       );
+add_action( 'bbp_delete_forum', 'bbp_remove_forum_from_all_subscriptions'       );
 add_action( 'bbp_new_reply',    'bbp_notify_subscribers',                 11, 5 );
+add_action( 'bbp_new_topic',    'bbp_notify_forum_subscribers',           11, 4 );
 
 // Sticky
 add_action( 'bbp_trash_topic',  'bbp_unstick_topic' );
@@ -297,11 +300,12 @@
 add_action( 'bbp_post_request', 'bbp_new_topic_handler',      10 );
 
 // Theme-side GET requests
-add_action( 'bbp_get_request', 'bbp_toggle_topic_handler',    1  );
-add_action( 'bbp_get_request', 'bbp_toggle_reply_handler',    1  );
-add_action( 'bbp_get_request', 'bbp_favorites_handler',       1  );
-add_action( 'bbp_get_request', 'bbp_subscriptions_handler',   1  );
-add_action( 'bbp_get_request', 'bbp_search_results_redirect', 10 );
+add_action( 'bbp_get_request', 'bbp_toggle_topic_handler',        1  );
+add_action( 'bbp_get_request', 'bbp_toggle_reply_handler',        1  );
+add_action( 'bbp_get_request', 'bbp_favorites_handler',           1  );
+add_action( 'bbp_get_request', 'bbp_subscriptions_handler',       1  );
+add_action( 'bbp_get_request', 'bbp_forum_subscriptions_handler', 1  );
+add_action( 'bbp_get_request', 'bbp_search_results_redirect',     10 );
 
 // Maybe convert the users password
 add_action( 'bbp_login_form_login', 'bbp_user_maybe_convert_pass' );
Index: includes/forums/functions.php
===================================================================
--- includes/forums/functions.php	(revision 5155)
+++ includes/forums/functions.php	(working copy)
@@ -961,6 +961,46 @@
 	return true;
 }
 
+/** Subscriptions *************************************************/
+
+/**
+ * Remove a deleted forum from all users' subscriptions
+ *
+ * @since bbPress (r5155)
+ *
+ * @param int $forum_id Get the forum ID to remove
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
+ * @uses bbp_get_forum_id To get the forum id
+ * @uses bbp_get_forum_subscribers() To get the forum subscribers
+ * @uses bbp_remove_user_subscription() To remove the user subscription
+ */
+function bbp_remove_forum_from_all_subscriptions( $forum_id = 0 ) {
+
+	// Subscriptions are not active
+	if ( ! bbp_is_subscriptions_active() )
+		return;
+
+	$forum_id = bbp_get_forum_id( $forum_id );
+
+	// Bail if no forum
+	if ( empty( $forum_id ) )
+		return;
+
+	// Get users
+	$users = (array) bbp_get_forum_subscribers( $forum_id );
+
+	// Users exist
+	if ( !empty( $users ) ) {
+
+		// Loop through users
+		foreach ( $users as $user ) {
+
+			// Remove each user
+			bbp_remove_user_subscription( $user, $forum_id );
+		}
+	}
+}
+
 /** Count Bumpers *************************************************************/
 
 /**
Index: includes/forums/template.php
===================================================================
--- includes/forums/template.php	(revision 5155)
+++ includes/forums/template.php	(working copy)
@@ -442,6 +442,66 @@
 }
 
 /**
+ * Output checked value of forum subscription
+ *
+ * @since bbPress (r5155)
+ *
+ * @uses bbp_get_form_forum_subscribed() To get the subscribed checkbox value
+ */
+function bbp_form_forum_subscribed() {
+	echo bbp_get_form_forum_subscribed();
+}
+	/**
+	 * Return checked value of forum subscription
+	 *
+	 * @since bbPress (r5155)
+	 *
+	 * @uses bbp_is_forum_edit() To check if it's the forum edit page
+	 * @uses bbp_get_global_post_field() To get current post author
+	 * @uses bbp_get_current_user_id() To get the current user id
+	 * @uses bbp_is_user_subscribed() To check if the user is subscribed to
+	 *                the forum
+	 * @uses apply_filters() Calls 'bbp_get_form_forum_subscribed' with the
+	 *                option
+	 * @return string Checked value of forum subscription
+	 */
+	function bbp_get_form_forum_subscribed() {
+
+		// Get _POST data
+		if ( bbp_is_post_request() && isset( $_POST['bbp_forum_subscription'] ) ) {
+			$forum_subscribed = (bool) $_POST['bbp_forum_subscription'];
+
+		// Get edit data
+		} elseif ( bbp_is_forum_edit() || bbp_is_reply_edit() ) {
+
+			// Get current posts author
+			$post_author = bbp_get_global_post_field( 'post_author', 'raw' );
+
+			// Post author is not the current user
+			if ( bbp_get_current_user_id() !== $post_author ) {
+				$forum_subscribed = bbp_is_user_subscribed( $post_author );
+
+			// Post author is the current user
+			} else {
+				$forum_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id() );
+			}
+
+		// Get current status
+		} elseif ( bbp_is_single_forum() ) {
+			$forum_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id() );
+
+		// No data
+		} else {
+			$forum_subscribed = false;
+		}
+
+		// Get checked output
+		$checked = checked( $forum_subscribed, true, false );
+
+		return apply_filters( 'bbp_get_form_forum_subscribed', $checked, $forum_subscribed );
+	}
+
+/**
  * Output the forums last active ID
  *
  * @since bbPress (r2860)
Index: includes/topics/functions.php
===================================================================
--- includes/topics/functions.php	(revision 5155)
+++ includes/topics/functions.php	(working copy)
@@ -2200,7 +2200,8 @@
  *
  * @since bbPress (r2652)
  *
- * @param int $topic_id Topic ID to remove
+ * @param int $topic_id Get the topic id to remove
+ * @uses bbp_get_topic_id To get the topic id
  * @uses bbp_get_topic_favoriters() To get the topic's favoriters
  * @uses bbp_remove_user_favorite() To remove the topic from user's favorites
  */
@@ -2231,8 +2232,9 @@
  *
  * @since bbPress (r2652)
  *
- * @param int $topic_id Topic ID to remove
+ * @param int $topic_id Get the topic id to remove
  * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
+ * @uses bbp_get_topic_id To get the topic id
  * @uses bbp_get_topic_subscribers() To get the topic subscribers
  * @uses bbp_remove_user_subscription() To remove the user subscription
  */
Index: includes/users/functions.php
===================================================================
--- includes/users/functions.php	(revision 5155)
+++ includes/users/functions.php	(working copy)
@@ -313,7 +313,7 @@
 	$favorites = bbp_get_user_favorites_topic_ids( $user_id );
 
 	if ( !empty( $favorites ) ) {
-		
+
 		// Checking a specific topic id
 		if ( !empty( $topic_id ) ) {
 			$topic    = bbp_get_topic( $topic_id );
@@ -512,6 +512,33 @@
 /** Subscriptions *************************************************************/
 
 /**
+ * Get the users who have subscribed to the forum
+ *
+ * @since bbPress (r2668)
+ *
+ * @param int $forum_id Optional. forum id
+ * @uses wpdb::get_col() To execute our query and get the column back
+ * @uses apply_filters() Calls 'bbp_get_forum_subscribers' with the subscribers
+ * @return array|bool Results if the forum has any subscribers, otherwise false
+ */
+function bbp_get_forum_subscribers( $forum_id = 0 ) {
+	$forum_id = bbp_get_forum_id( $forum_id );
+	if ( empty( $forum_id ) )
+		return;
+
+	global $wpdb;
+
+	$key   = $wpdb->prefix . '_bbp_forum_subscriptions';
+	$users = wp_cache_get( 'bbp_get_forum_subscribers_' . $forum_id, 'bbpress_users' );
+	if ( false === $users ) {
+		$users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$forum_id}', meta_value) > 0" );
+		wp_cache_set( 'bbp_get_forum_subscribers_' . $forum_id, $users, 'bbpress_users' );
+	}
+
+	return apply_filters( 'bbp_get_forum_subscribers', $users );
+}
+
+/**
  * Get the users who have subscribed to the topic
  *
  * @since bbPress (r2668)
@@ -569,6 +596,29 @@
 }
 
 /**
+ * Get a user's subscribed forum ids
+ *
+ * @since bbPress (r2668)
+ *
+ * @param int $user_id Optional. User id
+ * @uses bbp_get_user_id() To get the user id
+ * @uses get_user_option() To get the user's subscriptions
+ * @uses apply_filters() Calls 'bbp_get_user_subscribed_forum_ids' with
+ *                        the subscriptions and user id
+ * @return array|bool Results if user has subscriptions, otherwise false
+ */
+function bbp_get_user_subscribed_forum_ids( $user_id = 0 ) {
+	$user_id = bbp_get_user_id( $user_id );
+	if ( empty( $user_id ) )
+		return false;
+
+	$subscriptions = get_user_option( '_bbp_forum_subscriptions', $user_id );
+	$subscriptions = array_filter( wp_parse_id_list( $subscriptions ) );
+
+	return (array) apply_filters( 'bbp_get_user_subscribed_forum_ids', $subscriptions, $user_id );
+}
+
+/**
  * Get a user's subscribed topics' ids
  *
  * @since bbPress (r2668)
@@ -592,11 +642,102 @@
 }
 
 /**
- * Check if a topic is in user's subscription list or not
+ * Check if a user's subscription list or not
  *
+ * @param int $user_id Optional. User id
+ * @param int $forum_id Optional. Topic id
+ * @uses get_post() To get the post object
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's forum subscriptions
+ * @uses bbp_get_user_subscribed_topic_ids() To get the user's topic subscriptions
+ * @uses bbp_get_forum_post_type() To get the forum post type
+ * @uses bbp_get_topic_post_type() To get the topic post type
+ * @uses apply_filters() Calls 'bbp_is_user_subscribed' with the bool, user id,
+ *                        forum/topic id and subsriptions
+ * @return bool True if the forum or topic is in user's subscriptions, otherwise false
+ */
+function bbp_is_user_subscribed( $user_id = 0, $object_id = 0 ) {
+	if ( empty( $user_id ) || empty( $object_id ) )
+		return false;
+
+	$object = get_post( $object_id );
+	if( ! $object )
+		return false;
+
+	$post_type = $object->post_type;
+
+	switch( $post_type ) {
+
+		case bbp_get_forum_post_type() :
+
+			$subscriptions = bbp_get_user_subscribed_forum_ids( $user_id );
+			$retval        = bbp_is_user_subscribed_to_forum( $user_id, $object_id );
+			break;
+
+		case bbp_get_topic_post_type() :
+		default :
+
+			$subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
+			$retval        = bbp_is_user_subscribed_to_topic( $user_id, $object_id );
+			break;
+	}
+
+	return (bool) apply_filters( 'bbp_is_user_subscribed', $retval, $user_id, $object_id, $subscriptions );
+}
+
+/**
+ * Check if a forum is in user's subscription list or not
+ *
  * @since bbPress (r2668)
  *
  * @param int $user_id Optional. User id
+ * @param int $forum_id Optional. Topic id
+ * @uses bbp_get_user_id() To get the user id
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
+ * @uses bbp_get_forum() To get the forum
+ * @uses bbp_get_forum_id() To get the forum id
+ * @uses apply_filters() Calls 'bbp_is_user_subscribed' with the bool, user id,
+ *                        forum id and subsriptions
+ * @return bool True if the forum is in user's subscriptions, otherwise false
+ */
+function bbp_is_user_subscribed_to_forum( $user_id = 0, $forum_id = 0 ) {
+
+	// Validate user
+	$user_id = bbp_get_user_id( $user_id, true, true );
+	if ( empty( $user_id ) )
+		return false;
+
+	$retval        = false;
+	$subscriptions = bbp_get_user_subscribed_forum_ids( $user_id );
+
+	if ( ! empty( $subscriptions ) ) {
+
+		// Checking a specific forum id
+		if ( ! empty( $forum_id ) ) {
+			$forum    = bbp_get_forum( $forum_id );
+			$forum_id = ! empty( $forum ) ? $forum->ID : 0;
+
+		// Using the global forum id
+		} elseif ( bbp_get_forum_id() ) {
+			$forum_id = bbp_get_forum_id();
+
+		// Use the current post id
+		} elseif ( ! bbp_get_forum_id() ) {
+			$forum_id = get_the_ID();
+		}
+
+		// Is forum_id in the user's favorites
+		if ( ! empty( $forum_id ) ) {
+			$retval = in_array( $forum_id, $subscriptions );
+		}
+	}
+
+	return (bool) apply_filters( 'bbp_is_user_subscribed_to_forum', (bool) $retval, $user_id, $forum_id, $subscriptions );
+}
+
+/**
+ * Check if a topic is in user's subscription list or not
+ *
+ * @param int $user_id Optional. User id
  * @param int $topic_id Optional. Topic id
  * @uses bbp_get_user_id() To get the user id
  * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
@@ -606,7 +747,7 @@
  *                        topic id and subsriptions
  * @return bool True if the topic is in user's subscriptions, otherwise false
  */
-function bbp_is_user_subscribed( $user_id = 0, $topic_id = 0 ) {
+function bbp_is_user_subscribed_to_topic( $user_id = 0, $topic_id = 0 ) {
 
 	// Validate user
 	$user_id = bbp_get_user_id( $user_id, true, true );
@@ -616,12 +757,12 @@
 	$retval        = false;
 	$subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
 
-	if ( !empty( $subscriptions ) ) {
+	if ( ! empty( $subscriptions ) ) {
 
 		// Checking a specific topic id
-		if ( !empty( $topic_id ) ) {
-			$topic     = bbp_get_topic( $topic_id );
-			$topic_id = !empty( $topic ) ? $topic->ID : 0;
+		if ( ! empty( $topic_id ) ) {
+			$topic    = bbp_get_topic( $topic_id );
+			$topic_id = ! empty( $topic ) ? $topic->ID : 0;
 
 		// Using the global topic id
 		} elseif ( bbp_get_topic_id() ) {
@@ -633,12 +774,12 @@
 		}
 
 		// Is topic_id in the user's favorites
-		if ( !empty( $topic_id ) ) {
+		if ( ! empty( $topic_id ) ) {
 			$retval = in_array( $topic_id, $subscriptions );
 		}
 	}
 
-	return (bool) apply_filters( 'bbp_is_user_subscribed', (bool) $retval, $user_id, $topic_id, $subscriptions );
+	return (bool) apply_filters( 'bbp_is_user_subscribed_to_topic', (bool) $retval, $user_id, $topic_id, $subscriptions );
 }
 
 /**
@@ -648,13 +789,109 @@
  *
  * @param int $user_id Optional. User id
  * @param int $topic_id Optional. Topic id
+ * @uses get_post() To get the post object
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's forum subscriptions
+ * @uses bbp_get_user_subscribed_topic_ids() To get the user's topic subscriptions
+ * @uses bbp_get_forum_post_type() To get the forum post type
+ * @uses bbp_get_topic_post_type() To get the topic post type
+ * @uses update_user_option() To update the user's subscriptions
+ * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id
+ * @return bool Always true
+ */
+function bbp_add_user_subscription( $user_id = 0, $object_id = 0 ) {
+	if ( empty( $user_id ) || empty( $object_id ) )
+		return false;
+
+	$object = get_post( $object_id );
+	if( ! $object )
+		return false;
+
+	$post_type = $object->post_type;
+
+	switch( $post_type ) {
+
+		case bbp_get_forum_post_type() :
+
+			$subscriptions = bbp_get_user_subscribed_forum_ids( $user_id );
+
+			if ( ! in_array( $object_id, $subscriptions ) ) {
+				$subscriptions[] = $object_id;
+				$subscriptions   = implode( ',', wp_parse_id_list( array_filter( $subscriptions ) ) );
+				update_user_option( $user_id, '_bbp_forum_subscriptions', $subscriptions );
+
+				wp_cache_delete( 'bbp_get_forum_subscribers_' . $object_id, 'bbpress_users' );
+			}
+
+			break;
+
+		case bbp_get_topic_post_type() :
+		default :
+
+			$subscriptions = bbp_get_user_subscribed_topic_ids( $user_id );
+
+			if ( ! in_array( $object_id, $subscriptions ) ) {
+				$subscriptions[] = $object_id;
+				$subscriptions   = implode( ',', wp_parse_id_list( array_filter( $subscriptions ) ) );
+				update_user_option( $user_id, '_bbp_subscriptions', $subscriptions );
+
+				wp_cache_delete( 'bbp_get_topic_subscribers_' . $object_id, 'bbpress_users' );
+			}
+
+			break;
+	}
+
+	do_action( 'bbp_add_user_subscription', $user_id, $object_id, $post_type );
+
+	return true;
+}
+
+/**
+ * Add a forum to user's subscriptions
+ *
+ * @param int $user_id Optional. User id
+ * @param int $forum_id Optional. forum id
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
+ * @uses bbp_get_forum() To get the forum
+ * @uses update_user_option() To update the user's subscriptions
+ * @uses do_action() Calls 'bbp_add_user_subscription' with the user & forum id
+ * @return bool Always true
+ */
+function bbp_add_user_forum_subscription( $user_id = 0, $forum_id = 0 ) {
+	if ( empty( $user_id ) || empty( $forum_id ) )
+		return false;
+
+	$forum = bbp_get_forum( $forum_id );
+	if ( empty( $forum ) )
+		return false;
+
+	$subscriptions = (array) bbp_get_user_subscribed_forum_ids( $user_id );
+	if ( !in_array( $forum_id, $subscriptions ) ) {
+		$subscriptions[] = $forum_id;
+		$subscriptions   = implode( ',', wp_parse_id_list( array_filter( $subscriptions ) ) );
+		update_user_option( $user_id, '_bbp_forum_subscriptions', $subscriptions );
+
+		wp_cache_delete( 'bbp_get_forum_subscribers_' . $forum_id, 'bbpress_users' );
+	}
+
+	do_action( 'bbp_add_user_forum_subscription', $user_id, $forum_id );
+
+	return true;
+}
+
+/**
+ * Add a topic to user's subscriptions
+ *
+ * @since bbPress (r2668)
+ *
+ * @param int $user_id Optional. User id
+ * @param int $topic_id Optional. Topic id
  * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
  * @uses bbp_get_topic() To get the topic
  * @uses update_user_option() To update the user's subscriptions
  * @uses do_action() Calls 'bbp_add_user_subscription' with the user & topic id
  * @return bool Always true
  */
-function bbp_add_user_subscription( $user_id = 0, $topic_id = 0 ) {
+function bbp_add_user_topic_subscription( $user_id = 0, $topic_id = 0 ) {
 	if ( empty( $user_id ) || empty( $topic_id ) )
 		return false;
 
@@ -671,7 +908,7 @@
 		wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
 	}
 
-	do_action( 'bbp_add_user_subscription', $user_id, $topic_id );
+	do_action( 'bbp_add_user_topic_subscription', $user_id, $topic_id );
 
 	return true;
 }
@@ -683,15 +920,99 @@
  *
  * @param int $user_id Optional. User id
  * @param int $topic_id Optional. Topic id
+ * @uses get_post() To get the post object
+ * @uses bbp_get_forum_post_type() To get the forum post type
+ * @uses bbp_get_topic_post_type() To get the topic post type
+ * @uses bbp_remove_user_forum_subscription() To remove the user's subscription
+ * @uses bbp_remove_user_topic_subscription() To remove the user's subscription
+ * @uses do_action() Calls 'bbp_remove_user_subscription' with the user id and
+ *                    topic id
+ * @return bool True if the topic was removed from user's subscriptions,
+ *               otherwise false
+ */
+function bbp_remove_user_subscription( $user_id = 0, $object_id = 0 ) {
+	if ( empty( $user_id ) || empty( $object_id ) )
+		return false;
+
+	$post_type = get_post_type( $object_id );
+
+	switch( $post_type ) {
+
+		case bbp_get_forum_post_type() :
+
+			bbp_remove_user_forum_subscription( $user_id, $object_id );
+
+			break;
+
+		case bbp_get_topic_post_type() :
+		default :
+
+			bbp_remove_user_topic_subscription( $user_id, $object_id );
+
+			break;
+	}
+
+	do_action( 'bbp_remove_user_subscription', $user_id, $object_id, $post_type );
+
+	return true;
+}
+
+/**
+ * Remove a forum from user's subscriptions
+ *
+ * @param int $user_id Optional. User id
+ * @param int $forum_id Optional. forum id
+ * @uses bbp_get_user_subscribed_forum_ids() To get the user's subscriptions
+ * @uses update_user_option() To update the user's subscriptions
+ * @uses delete_user_option() To delete the user's subscriptions meta
+ * @uses do_action() Calls 'bbp_remove_user_subscription' with the user id and
+ *                    forum id
+ * @return bool True if the forum was removed from user's subscriptions,
+ *               otherwise false
+ */
+function bbp_remove_user_forum_subscription( $user_id, $forum_id ) {
+	if ( empty( $user_id ) || empty( $forum_id ) )
+		return false;
+
+	$subscriptions = (array) bbp_get_user_subscribed_forum_ids( $user_id );
+
+	if ( empty( $subscriptions ) )
+		return false;
+
+	$pos = array_search( $forum_id, $subscriptions );
+	if ( is_numeric( $pos ) ) {
+		array_splice( $subscriptions, $pos, 1 );
+		$subscriptions = array_filter( $subscriptions );
+
+		if ( !empty( $subscriptions ) ) {
+			$subscriptions = implode( ',', wp_parse_id_list( $subscriptions ) );
+			update_user_option( $user_id, '_bbp_forum_subscriptions', $subscriptions );
+		} else {
+			delete_user_option( $user_id, '_bbp_forum_subscriptions' );
+		}
+
+		wp_cache_delete( 'bbp_get_forum_subscribers_' . $forum_id, 'bbpress_users' );
+	}
+
+	do_action( 'bbp_remove_user_forum_subscription', $user_id, $forum_id );
+
+	return true;
+}
+
+/**
+ * Remove a topic from user's subscriptions
+ *
+ * @param int $user_id Optional. User id
+ * @param int $topic_id Optional. Topic id
  * @uses bbp_get_user_subscribed_topic_ids() To get the user's subscriptions
  * @uses update_user_option() To update the user's subscriptions
  * @uses delete_user_option() To delete the user's subscriptions meta
- * @uses do_action() Calls 'bbp_remove_user_subscription' with the user id and
+ * @uses do_action() Calls 'bbp_remove_user_topic_subscription' with the user id and
  *                    topic id
  * @return bool True if the topic was removed from user's subscriptions,
  *               otherwise false
  */
-function bbp_remove_user_subscription( $user_id, $topic_id ) {
+function bbp_remove_user_topic_subscription( $user_id, $topic_id ) {
 	if ( empty( $user_id ) || empty( $topic_id ) )
 		return false;
 
@@ -715,12 +1036,114 @@
 		wp_cache_delete( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' );
 	}
 
-	do_action( 'bbp_remove_user_subscription', $user_id, $topic_id );
+	do_action( 'bbp_remove_user_topic_subscription', $user_id, $topic_id );
 
 	return true;
 }
 
 /**
+ * Handles the front end subscribing and unsubscribing forums
+ *
+ * @param string $action The requested action to compare this function to
+ * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
+ * @uses bbp_get_user_id() To get the user id
+ * @uses bbp_verify_nonce_request() To verify the nonce and check the request
+ * @uses current_user_can() To check if the current user can edit the user
+ * @uses bbPress:errors:add() To log the error messages
+ * @uses bbp_is_user_subscribed() To check if the forum is in user's
+ *                                 subscriptions
+ * @uses bbp_remove_user_subscription() To remove the user subscription
+ * @uses bbp_add_user_subscription() To add the user subscription
+ * @uses do_action() Calls 'bbp_subscriptions_handler' with success, user id,
+ *                    forum id and action
+ * @uses bbp_is_subscription() To check if it's the subscription page
+ * @uses bbp_get_subscription_link() To get the subscription page link
+ * @uses bbp_get_forum_permalink() To get the forum permalink
+ * @uses wp_safe_redirect() To redirect to the url
+ */
+function bbp_forum_subscriptions_handler( $action = '' ) {
+
+	if ( !bbp_is_subscriptions_active() )
+		return false;
+
+	// Bail if no forum ID is passed
+	if ( empty( $_GET['forum_id'] ) )
+		return;
+
+	// Setup possible get actions
+	$possible_actions = array(
+		'bbp_subscribe',
+		'bbp_unsubscribe',
+	);
+
+	// Bail if actions aren't meant for this function
+	if ( !in_array( $action, $possible_actions ) )
+		return;
+
+	// Get required data
+	$user_id  = bbp_get_user_id( 0, true, true );
+	$forum_id = intval( $_GET['forum_id'] );
+
+	// Check for empty forum
+	if ( empty( $forum_id ) ) {
+		bbp_add_error( 'bbp_subscription_forum_id', __( '<strong>ERROR</strong>: No forum was found! Which forum are you subscribing/unsubscribing to?', 'bbpress' ) );
+
+	// Check nonce
+	} elseif ( ! bbp_verify_nonce_request( 'toggle-subscription_' . $forum_id ) ) {
+		bbp_add_error( 'bbp_subscription_forum_id', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
+
+	// Check current user's ability to edit the user
+	} elseif ( !current_user_can( 'edit_user', $user_id ) ) {
+		bbp_add_error( 'bbp_subscription_permissions', __( '<strong>ERROR</strong>: You don\'t have the permission to edit favorites of that user!', 'bbpress' ) );
+	}
+
+	// Bail if we have errors
+	if ( bbp_has_errors() )
+		return;
+
+	/** No errors *************************************************************/
+
+	$is_subscription = bbp_is_user_subscribed( $user_id, $forum_id );
+	$success         = false;
+
+	if ( true === $is_subscription && 'bbp_unsubscribe' === $action )
+		$success = bbp_remove_user_subscription( $user_id, $forum_id );
+	elseif ( false === $is_subscription && 'bbp_subscribe' === $action )
+		$success = bbp_add_user_subscription( $user_id, $forum_id );
+
+	// Do additional subscriptions actions
+	do_action( 'bbp_subscriptions_handler', $success, $user_id, $forum_id, $action );
+
+	// Success!
+	if ( true === $success ) {
+
+		// Redirect back from whence we came
+		if ( bbp_is_subscriptions() ) {
+			$redirect = bbp_get_subscriptions_permalink( $user_id );
+		} elseif ( bbp_is_single_user() ) {
+			$redirect = bbp_get_user_profile_url();
+		} elseif ( is_singular( bbp_get_forum_post_type() ) ) {
+			$redirect = bbp_get_forum_permalink( $forum_id );
+		} elseif ( is_single() || is_page() ) {
+			$redirect = get_permalink();
+		} else {
+			$redirect = get_permalink( $forum_id );
+		}
+
+		wp_safe_redirect( $redirect );
+
+		// For good measure
+		exit();
+
+	// Fail! Handle errors
+	} elseif ( true === $is_subscription && 'bbp_unsubscribe' === $action ) {
+		bbp_add_error( 'bbp_unsubscribe', __( '<strong>ERROR</strong>: There was a problem unsubscribing from that forum!', 'bbpress' ) );
+	} elseif ( false === $is_subscription && 'bbp_subscribe' === $action ) {
+		bbp_add_error( 'bbp_subscribe',    __( '<strong>ERROR</strong>: There was a problem subscribing to that forum!', 'bbpress' ) );
+	}
+}
+
+/**
  * Handles the front end subscribing and unsubscribing topics
  *
  * @param string $action The requested action to compare this function to
@@ -822,6 +1245,7 @@
 	}
 }
 
+
 /** Edit **********************************************************************/
 
 /**
@@ -968,7 +1392,7 @@
  * @return array|bool Results if the user has created topics, otherwise false
  */
 function bbp_get_user_topics_started( $user_id = 0 ) {
-	
+
 	// Validate user
 	$user_id = bbp_get_user_id( $user_id );
 	if ( empty( $user_id ) )
@@ -993,7 +1417,7 @@
  * @return array|bool Results if the user has created topics, otherwise false
  */
 function bbp_get_user_replies_created( $user_id = 0 ) {
-	
+
 	// Validate user
 	$user_id = bbp_get_user_id( $user_id );
 	if ( empty( $user_id ) )
@@ -1031,7 +1455,7 @@
  * which a user can edit another user (or themselves.) If these conditions are
  * met. We assume a user cannot perform this task, and look for ways they can
  * earn the ability to access this template.
- * 
+ *
  * @since bbPress (r3605)
  *
  * @uses bbp_is_topic_edit()
Index: includes/users/template.php
===================================================================
--- includes/users/template.php	(revision 5155)
+++ includes/users/template.php	(working copy)
@@ -612,7 +612,7 @@
 	}
 
 /** Anonymous Fields **********************************************************/
-	
+
 /**
  * Output the author disylay-name of a topic or reply.
  *
@@ -1027,14 +1027,19 @@
 	 *  - unsubscribe: Unsubscribe text
 	 *  - user_id: User id
 	 *  - topic_id: Topic id
+	 *  - forum_id: Forum id
 	 *  - before: Before the link
 	 *  - after: After the link
 	 * @param int $user_id Optional. User id
 	 * @param bool $wrap Optional. If you want to wrap the link in <span id="subscription-toggle">.
+	 * @uses bbp_is_subscriptions_active() to check if subscriptions are active
 	 * @uses bbp_get_user_id() To get the user id
+	 * @uses bbp_get_user_id() To get the user id
+	 * @uses bbp_get_topic_id() To get the topic id
+	 * @uses bbp_get_forum_id() To get the forum id
 	 * @uses current_user_can() To check if the current user can edit user
-	 * @uses bbp_get_topic_id() To get the topic id
-	 * @uses bbp_is_user_subscribed() To check if the user is subscribed
+	 * @uses bbp_is_user_subscribed_to_forum() To check if the user is subscribed to the forum
+	 * @uses bbp_is_user_subscribed_to_topic() To check if the user is subscribed to the topic
 	 * @uses bbp_is_subscriptions() To check if it's the subscriptions page
 	 * @uses bbp_get_subscriptions_permalink() To get subscriptions link
 	 * @uses bbp_get_topic_permalink() To get topic link
@@ -1043,7 +1048,7 @@
 	 * @return string Permanent link to topic
 	 */
 	function bbp_get_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) {
-		if ( !bbp_is_subscriptions_active() )
+		if ( ! bbp_is_subscriptions_active() )
 			return;
 
 		// Parse arguments against default values
@@ -1052,49 +1057,87 @@
 			'unsubscribe' => __( 'Unsubscribe', 'bbpress' ),
 			'user_id'     => 0,
 			'topic_id'    => 0,
+			'forum_id'    => 0,
 			'before'      => '&nbsp;|&nbsp;',
 			'after'       => ''
 		), 'get_user_subscribe_link' );
 
-		// Validate user and topic ID's
-		$user_id  = bbp_get_user_id( $r['user_id'], true, true );
-		$topic_id = bbp_get_topic_id( $r['topic_id'] );
-		if ( empty( $user_id ) || empty( $topic_id ) ) {
+		// Validate user and object ID's
+		$user_id   = bbp_get_user_id( $r['user_id'], true, true );
+		$topic_id  = bbp_get_topic_id( $r['topic_id'] );
+		$forum_id  = bbp_get_forum_id( $r['forum_id'] );
+		if ( empty( $user_id ) || ( empty( $topic_id ) && empty( $forum_id ) ) ) {
 			return false;
 		}
 
 		// No link if you can't edit yourself
-		if ( !current_user_can( 'edit_user', (int) $user_id ) ) {
+		if ( ! current_user_can( 'edit_user', (int) $user_id ) ) {
 			return false;
 		}
 
-		// Decide which link to show
-		$is_subscribed = bbp_is_user_subscribed( $user_id, $topic_id );
-		if ( !empty( $is_subscribed ) ) {
-			$text       = $r['unsubscribe'];
-			$query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
-		} else {
-			$text       = $r['subscribe'];
-			$query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
-		}
+		// Check if viewing a single forum
+		if( empty( $topic_id ) && ! empty( $forum_id ) ) {
 
-		// Create the link based where the user is and if the user is
-		// subscribed already
-		if ( bbp_is_subscriptions() ) {
-			$permalink = bbp_get_subscriptions_permalink( $user_id );
-		} elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
-			$permalink = bbp_get_topic_permalink( $topic_id );
+			// Decide which link to show
+			$is_subscribed = bbp_is_user_subscribed_to_forum( $user_id, $forum_id );
+			if ( ! empty( $is_subscribed ) ) {
+				$text       = $r['unsubscribe'];
+				$query_args = array( 'action' => 'bbp_unsubscribe', 'forum_id' => $forum_id );
+			} else {
+				$text       = $r['subscribe'];
+				$query_args = array( 'action' => 'bbp_subscribe', 'forum_id' => $forum_id );
+			}
+
+			// Create the link based where the user is and if the user is
+			// subscribed already
+			if ( bbp_is_subscriptions() ) {
+				$permalink = bbp_get_subscriptions_permalink( $user_id );
+			} elseif ( bbp_is_single_forum() || bbp_is_single_reply() ) {
+				$permalink = bbp_get_forum_permalink( $forum_id );
+			} else {
+				$permalink = get_permalink();
+			}
+
+			$url  = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $forum_id ) );
+			$sub  = $is_subscribed ? ' class="is-subscribed"' : '';
+			$html = sprintf( '%s<span id="subscribe-%d"  %s><a href="%s" class="subscription-toggle" data-forum="%d">%s</a></span>%s', $r['before'], $forum_id, $sub, $url, $forum_id, $text, $r['after'] );
+
+			// Initial output is wrapped in a span, ajax output is hooked to this
+			if ( !empty( $wrap ) ) {
+				$html = '<span id="subscription-toggle">' . $html . '</span>';
+			}
+
 		} else {
-			$permalink = get_permalink();
-		}
 
-		$url  = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) );
-		$sub  = $is_subscribed ? ' class="is-subscribed"' : '';
-		$html = sprintf( '%s<span id="subscribe-%d"  %s><a href="%s" class="subscription-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
+			// Decide which link to show
+			$is_subscribed = bbp_is_user_subscribed_to_topic( $user_id, $topic_id );
+			if ( ! empty( $is_subscribed ) ) {
+				$text       = $r['unsubscribe'];
+				$query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id );
+			} else {
+				$text       = $r['subscribe'];
+				$query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id );
+			}
 
-		// Initial output is wrapped in a span, ajax output is hooked to this
-		if ( !empty( $wrap ) ) {
-			$html = '<span id="subscription-toggle">' . $html . '</span>';
+			// Create the link based where the user is and if the user is
+			// subscribed already
+			if ( bbp_is_subscriptions() ) {
+				$permalink = bbp_get_subscriptions_permalink( $user_id );
+			} elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) {
+				$permalink = bbp_get_topic_permalink( $topic_id );
+			} else {
+				$permalink = get_permalink();
+			}
+
+			$url  = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) );
+			$sub  = $is_subscribed ? ' class="is-subscribed"' : '';
+			$html = sprintf( '%s<span id="subscribe-%d"  %s><a href="%s" class="subscription-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
+
+			// Initial output is wrapped in a span, ajax output is hooked to this
+			if ( !empty( $wrap ) ) {
+				$html = '<span id="subscription-toggle">' . $html . '</span>';
+			}
+
 		}
 
 		// Return the link
Index: templates/default/bbpress/content-archive-forum.php
===================================================================
--- templates/default/bbpress/content-archive-forum.php	(revision 5155)
+++ templates/default/bbpress/content-archive-forum.php	(working copy)
@@ -23,6 +23,8 @@
 
 	<?php bbp_breadcrumb(); ?>
 
+	<?php bbp_forum_subscription_link(); ?>
+
 	<?php do_action( 'bbp_template_before_forums_index' ); ?>
 
 	<?php if ( bbp_has_forums() ) : ?>
Index: templates/default/bbpress/content-single-forum.php
===================================================================
--- templates/default/bbpress/content-single-forum.php	(revision 5155)
+++ templates/default/bbpress/content-single-forum.php	(working copy)
@@ -13,6 +13,8 @@
 
 	<?php bbp_breadcrumb(); ?>
 
+	<?php bbp_forum_subscription_link(); ?>
+
 	<?php do_action( 'bbp_template_before_single_forum' ); ?>
 
 	<?php if ( post_password_required() ) : ?>
Index: templates/default/bbpress-functions.php
===================================================================
--- templates/default/bbpress-functions.php	(revision 5155)
+++ templates/default/bbpress-functions.php	(working copy)
@@ -84,12 +84,13 @@
 
 		/** Scripts ***********************************************************/
 
-		add_action( 'bbp_enqueue_scripts',   array( $this, 'enqueue_styles'        ) ); // Enqueue theme CSS
-		add_action( 'bbp_enqueue_scripts',   array( $this, 'enqueue_scripts'       ) ); // Enqueue theme JS
-		add_filter( 'bbp_enqueue_scripts',   array( $this, 'localize_topic_script' ) ); // Enqueue theme script localization
-		add_action( 'bbp_head',              array( $this, 'head_scripts'          ) ); // Output some extra JS in the <head>
-		add_action( 'bbp_ajax_favorite',     array( $this, 'ajax_favorite'         ) ); // Handles the ajax favorite/unfavorite
-		add_action( 'bbp_ajax_subscription', array( $this, 'ajax_subscription'     ) ); // Handles the ajax subscribe/unsubscribe
+		add_action( 'bbp_enqueue_scripts',         array( $this, 'enqueue_styles'          ) ); // Enqueue theme CSS
+		add_action( 'bbp_enqueue_scripts',         array( $this, 'enqueue_scripts'         ) ); // Enqueue theme JS
+		add_filter( 'bbp_enqueue_scripts',         array( $this, 'localize_topic_script'   ) ); // Enqueue theme script localization
+		add_action( 'bbp_head',                    array( $this, 'head_scripts'            ) ); // Output some extra JS in the <head>
+		add_action( 'bbp_ajax_favorite',           array( $this, 'ajax_favorite'           ) ); // Handles the topic ajax favorite/unfavorite
+		add_action( 'bbp_ajax_subscription',       array( $this, 'ajax_subscription'       ) ); // Handles the topic ajax subscribe/unsubscribe
+		add_action( 'bbp_ajax_forum_subscription', array( $this, 'ajax_forum_subscription' ) ); // Handles the forum ajax subscribe/unsubscribe
 
 		/** Template Wrappers *************************************************/
 
@@ -168,7 +169,9 @@
 	 *
 	 * @since bbPress (r3732)
 	 *
+	 * @uses bbp_is_single_forum() To check if it's the forum page
 	 * @uses bbp_is_single_topic() To check if it's the topic page
+	 * @uses bbp_thread_replies() To check if threaded replies are enabled
 	 * @uses bbp_is_single_user_edit() To check if it's the profile edit page
 	 * @uses wp_enqueue_script() To enqueue the scripts
 	 */
@@ -179,6 +182,13 @@
 			wp_enqueue_script( 'jquery' );
 		}
 
+		// Forum-specific scripts
+		if ( bbp_is_single_forum() ) {
+
+			// Forum subscribe/unsubscribe
+			wp_enqueue_script( 'bbpress-forum', $this->url . 'js/forum.js', array( 'jquery' ), $this->version );
+		}
+
 		// Topic-specific scripts
 		if ( bbp_is_single_topic() ) {
 
@@ -285,9 +295,11 @@
 	 *
 	 * @since bbPress (r3732)
 	 *
+	 * @uses bbp_is_single_forum() To check if it's the forum page
 	 * @uses bbp_is_single_topic() To check if it's the topic page
 	 * @uses is_user_logged_in() To check if user is logged in
 	 * @uses bbp_get_current_user_id() To get the current user id
+	 * @uses bbp_get_forum_id() To get the forum id
 	 * @uses bbp_get_topic_id() To get the topic id
 	 * @uses bbp_get_favorites_permalink() To get the favorites permalink
 	 * @uses bbp_is_user_favorite() To check if the topic is in user's favorites
@@ -298,24 +310,103 @@
 	 */
 	public function localize_topic_script() {
 
-		// Bail if not viewing a single topic
-		if ( !bbp_is_single_topic() )
-			return;
+		if( bbp_is_single_forum() ) {
 
-		wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array(
-			'bbp_ajaxurl'        => bbp_get_ajax_url(),
-			'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
-			'is_user_logged_in'  => is_user_logged_in(),
-			'fav_nonce'          => wp_create_nonce( 'toggle-favorite_' .     get_the_ID() ),
-			'subs_nonce'         => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
-		) );
+			wp_localize_script( 'bbpress-forum', 'bbpForumJS', array(
+				'bbp_ajaxurl'        => bbp_get_ajax_url(),
+				'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
+				'is_user_logged_in'  => is_user_logged_in(),
+				'subs_nonce'         => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
+			) );
+		}
+
+		if ( bbp_is_single_topic() ) {
+
+			wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array(
+				'bbp_ajaxurl'        => bbp_get_ajax_url(),
+				'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),
+				'is_user_logged_in'  => is_user_logged_in(),
+				'fav_nonce'          => wp_create_nonce( 'toggle-favorite_' .     get_the_ID() ),
+				'subs_nonce'         => wp_create_nonce( 'toggle-subscription_' . get_the_ID() )
+			) );
+		}
 	}
 
 	/**
+	 * AJAX handler to Subscribe/Unsubscribe a user from a forum
+	 *
+	 * @since bbPress (r5155)
+	 *
+	 * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
+	 * @uses bbp_is_user_logged_in() To check if user is logged in
+	 * @uses bbp_get_current_user_id() To get the current user id
+	 * @uses current_user_can() To check if the current user can edit the user
+	 * @uses bbp_get_forum() To get the forum
+	 * @uses wp_verify_nonce() To verify the nonce
+	 * @uses bbp_is_user_subscribed() To check if the forum is in user's subscriptions
+	 * @uses bbp_remove_user_subscriptions() To remove the forum from user's subscriptions
+	 * @uses bbp_add_user_subscriptions() To add the forum from user's subscriptions
+	 * @uses bbp_ajax_response() To return JSON
+	 */
+	public function ajax_forum_subscription() {
+
+		// Bail if subscriptions are not active
+		if ( !bbp_is_subscriptions_active() ) {
+			bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
+		}
+
+		// Bail if user is not logged in
+		if ( !is_user_logged_in() ) {
+			bbp_ajax_response( false, __( 'Please login to subscribe to this forum.', 'bbpress' ), 301 );
+		}
+
+		// Get user and forum data
+		$user_id = bbp_get_current_user_id();
+		$id      = intval( $_POST['id'] );
+
+		// Bail if user cannot add favorites for this user
+		if ( !current_user_can( 'edit_user', $user_id ) ) {
+			bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );
+		}
+
+		// Get the forum
+		$forum = bbp_get_forum( $id );
+
+		// Bail if forum cannot be found
+		if ( empty( $forum ) ) {
+			bbp_ajax_response( false, __( 'The forum could not be found.', 'bbpress' ), 303 );
+		}
+
+		// Bail if user did not take this action
+		if ( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $forum->ID ) ) {
+			bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
+		}
+
+		// Take action
+		$status = bbp_is_user_subscribed( $user_id, $forum->ID ) ? bbp_remove_user_subscription( $user_id, $forum->ID ) : bbp_add_user_subscription( $user_id, $forum->ID );
+
+		// Bail if action failed
+		if ( empty( $status ) ) {
+			bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );
+		}
+
+		// Put subscription attributes in convenient array
+		$attrs = array(
+			'forum_id' => $forum->ID,
+			'user_id'  => $user_id
+		);
+
+		// Action succeeded
+		bbp_ajax_response( true, bbp_get_forum_subscription_link( $attrs, $user_id, false ), 200 );
+	}
+
+	/**
 	 * AJAX handler to add or remove a topic from a user's favorites
 	 *
 	 * @since bbPress (r3732)
 	 *
+	 * @uses bbp_is_favorites_active() To check if favorites are active
+	 * @uses bbp_is_user_logged_in() To check if user is logged in
 	 * @uses bbp_get_current_user_id() To get the current user id
 	 * @uses current_user_can() To check if the current user can edit the user
 	 * @uses bbp_get_topic() To get the topic
@@ -383,6 +474,7 @@
 	 * @since bbPress (r3732)
 	 *
 	 * @uses bbp_is_subscriptions_active() To check if the subscriptions are active
+	 * @uses bbp_is_user_logged_in() To check if user is logged in
 	 * @uses bbp_get_current_user_id() To get the current user id
 	 * @uses current_user_can() To check if the current user can edit the user
 	 * @uses bbp_get_topic() To get the topic
Index: templates/default/css/bbpress-rtl.css
===================================================================
--- templates/default/css/bbpress-rtl.css	(revision 5155)
+++ templates/default/css/bbpress-rtl.css	(working copy)
@@ -173,9 +173,9 @@
  	margin: 8px 0;
 	padding: 0;
 	text-transform: none;
-} 
+}
 
-#bbpress-forums div.bbp-forum-author, 
+#bbpress-forums div.bbp-forum-author,
 #bbpress-forums div.bbp-topic-author,
 #bbpress-forums div.bbp-reply-author {
 	float: right;
@@ -183,7 +183,7 @@
 	width: 115px;
 }
 
-#bbpress-forums div.bbp-forum-author img.avatar, 
+#bbpress-forums div.bbp-forum-author img.avatar,
 #bbpress-forums div.bbp-topic-author img.avatar,
 #bbpress-forums div.bbp-reply-author img.avatar {
 	border: none;
@@ -250,7 +250,7 @@
 	padding: 8px;
 }
 
-div.bbp-forum-header, 
+div.bbp-forum-header,
 div.bbp-topic-header,
 div.bbp-reply-header {
 	border-top: 1px solid #ddd;
@@ -398,7 +398,7 @@
 	text-align: left;
 }
 
-/* =Breadcrumb and Tags
+/* =Breadcrumb, Forum Subscription Link and Tags
 -------------------------------------------------------------- */
 
 div.bbp-breadcrumb {
@@ -415,6 +415,10 @@
 	margin-bottom: 10px
 }
 
+#bbpress-forums div.bbp-forum-subscription {
+	float: left;
+}
+
 #bbpress-forums div.bbp-topic-tags {
 	float: left;
 }
@@ -473,7 +477,7 @@
 	width: 50%;
 }
 
-.bbp-forum-header a.bbp-forum-permalink, 
+.bbp-forum-header a.bbp-forum-permalink,
 .bbp-topic-header a.bbp-topic-permalink,
 .bbp-reply-header a.bbp-reply-permalink {
 	float: left;
@@ -1181,7 +1185,7 @@
 		display: inline-block;
 		margin-right: 0;
 		word-wrap: break-word;
-	}	
+	}
 	#bbpress-forums div.bbp-reply-author img.avatar {
 		position: absolute;
 		top: 15px;
@@ -1204,7 +1208,7 @@
 	div.bbp-submit-wrapper {
 		float: right;
 	}
-	#bbpress-forums fieldset.bbp-form { 
+	#bbpress-forums fieldset.bbp-form {
 		padding: 0 10px 10px;
 	}
 	#bbpress-forums #bbp-user-body {
@@ -1299,7 +1303,7 @@
 	#bbpress-forums li.bbp-header li.bbp-topic-reply-count,
 	#bbpress-forums li.bbp-body li.bbp-topic-voice-count,
 	#bbpress-forums li.bbp-body li.bbp-topic-reply-count,
-	#bbpress-forums li.bbp-footer div.bbp-reply-author, 
+	#bbpress-forums li.bbp-footer div.bbp-reply-author,
 	#bbpress-forums li.bbp-footer div.bbp-reply-content {
 		width: 45%;
 	}
@@ -1313,7 +1317,7 @@
 		width: 100%;
 	}
 	#bbpress-forums li.bbp-header li.bbp-forum-freshness,
-	#bbpress-forums li.bbp-header li.bbp-topic-freshness {	
+	#bbpress-forums li.bbp-header li.bbp-topic-freshness {
 		text-align: center;
 	}
 	#bbpress-forums li.bbp-body li.bbp-topic-freshness,
@@ -1338,5 +1342,5 @@
 	#bbpress-forums div.bbp-reply-author img.avatar {
 		width: 40px;
 		height: auto;
-	}	
+	}
 }
\ No newline at end of file
Index: templates/default/css/bbpress.css
===================================================================
--- templates/default/css/bbpress.css	(revision 5155)
+++ templates/default/css/bbpress.css	(working copy)
@@ -398,7 +398,7 @@
 	text-align: right;
 }
 
-/* =Breadcrumb and Tags
+/* =Breadcrumb, Forum Subscription Link and Tags
 -------------------------------------------------------------- */
 
 div.bbp-breadcrumb {
@@ -415,6 +415,10 @@
 	margin-bottom: 10px
 }
 
+#bbpress-forums div.bbp-forum-subscription {
+	float: right;
+}
+
 #bbpress-forums div.bbp-topic-tags {
 	float: right;
 }
