Index: bp-forums.php
===================================================================
--- bp-forums.php	(revision 3275)
+++ bp-forums.php	(working copy)
@@ -133,6 +133,7 @@
 		'user_id' => false,
 		'page' => 1,
 		'per_page' => 15,
+		'include' => false, // Comma-separated list of topic IDs.
 		'exclude' => false,
 		'show_stickies' => 'all',
 		'filter' => false // if $type = tag then filter is the tag name, otherwise it's terms to search on.
@@ -140,25 +141,34 @@
 
 	$r = wp_parse_args( $args, $defaults );
 	extract( $r, EXTR_SKIP );
+			
+	if ( $exclude ) {
+		$exclude = '-' . str_replace(',', ',-', $exclude);
+		$exclude = str_replace('--', '-', $exclude);
+		if ( $include )
+			$include = (string) $include . ",$exclude";
+		else
+			$include = $exclude;
+	}
 
 	switch ( $type ) {
 		case 'newest':
-			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'per_page' => $per_page, 'page' => $page, 'number' => $per_page, 'exclude' => $exclude, 'topic_title' => $filter, 'sticky' => $show_stickies ), 'get_latest_topics' );
+			$query = new BB_Query( 'topic', array( 'forum_id' => 'forum_id', 'topic_id' => $include, 'topic_author_id' => $user_id,  'per_page' => $per_page, 'page' => $page, 'number' => $per_page, 'topic_title' => $filter, 'sticky' => $show_stickies ), 'get_latest_topics' );
 			$topics =& $query->results;
 		break;
 
 		case 'popular':
-			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_posts', 'topic_title' => $filter, 'sticky' => $show_stickies ) );
+			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_id' => $include, 'topic_author_id' => $user_id, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_posts', 'topic_title' => $filter, 'sticky' => $show_stickies ) );
 			$topics =& $query->results;
 		break;
 
 		case 'unreplied':
-			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'post_count' => 1, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_time', 'topic_title' => $filter, 'sticky' => $show_stickies ) );
+			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_id' => $include, 'topic_author_id' => $user_id, 'post_count' => 1, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_time', 'topic_title' => $filter, 'sticky' => $show_stickies ) );
 			$topics =& $query->results;
 		break;
 
 		case 'tags':
-			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_author_id' => $user_id, 'tag' => $filter, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_time', 'sticky' => $show_stickies ) );
+			$query = new BB_Query( 'topic', array( 'forum_id' => $forum_id, 'topic_id' => $include, 'topic_author_id' => $user_id, 'tag' => $filter, 'per_page' => $per_page, 'page' => $page, 'order_by' => 't.topic_time', 'sticky' => $show_stickies ) );
 			$topics =& $query->results;
 		break;
 	}
Index: bp-forums/bp-forums-templatetags.php
===================================================================
--- bp-forums/bp-forums-templatetags.php	(revision 3275)
+++ bp-forums/bp-forums-templatetags.php	(working copy)
@@ -18,7 +18,7 @@
 	var $sort_by;
 	var $order;
 
-	function BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms ) {
+	function BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $include, $exclude ) {
 		global $bp;
 
 		$this->pag_page     = isset( $_REQUEST['p'] ) ? intval( $_REQUEST['p'] ) : $page;
@@ -28,19 +28,19 @@
 
 		switch ( $type ) {
 			case 'newest': default:
-				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'forum_id' => $forum_id, 'filter' => $search_terms, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'include' => $include, 'exclude' => $exclude ) );
 				break;
 
 			case 'popular':
-				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'popular', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'popular', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'include' => $include, 'exclude' => $exclude ) );
 				break;
 
 			case 'unreplied':
-				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'unreplied', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'unreplied', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'include' => $include, 'exclude' => $exclude ) );
 				break;
 
 			case 'tags':
-				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'tags', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies ) );
+				$this->topics = bp_forums_get_forum_topics( array( 'user_id' => $user_id, 'type' => 'tags', 'filter' => $search_terms, 'forum_id' => $forum_id, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'show_stickies' => $no_stickies, 'include' => $include, 'exclude' => $exclude ) );
 				break;
 		}
 
@@ -166,6 +166,8 @@
 	$forum_id = false;
 	$search_terms = false;
 	$no_stickies = 'all';
+	$include = false;
+	$exclude = false;
 
 	/* User filtering */
 	if ( !empty( $bp->displayed_user->id ) )
@@ -198,7 +200,9 @@
 		'per_page' => 20,
 		'max' => false,
 		'no_stickies' => $no_stickies,
-		'search_terms' => $search_terms
+		'search_terms' => $search_terms,
+		'include' => $include,
+		'exclude' => $exclude
 	);
 
 	$r = wp_parse_args( $args, $defaults );
@@ -210,7 +214,7 @@
 		$type = 'tags';
 	}
 
-	$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms );
+	$forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $include, $exclude );
 	return apply_filters( 'bp_has_topics', $forum_template->has_topics(), &$forum_template );
 }
 
