 		   with BannedIps  as 
 		   (
 		     select ROW_NUMBER() over (order by Mask) as RowNum, Mask 
-			 from  [{databaseOwner}].[{objectQualifier}BannedIP]
+			 from  [{databaseOwner}].[{objectQualifier}BannedIP] where BoardID=@BoardID
 		   )
 		   select
 		    a.*,

    @FindLastRead bit = 0
)
AS
begin
   declare @post_totalrowsnumber int 
   declare @TotalRows int
   declare @FirstSelectRowNumber int
   declare @LastSelectRowNumber int
   
   -- find total returned count
   select  @post_totalrowsnumber = COUNT(c.TopicID)
   FROM [{databaseOwner}].[{objectQualifier}Topic] c 
   WHERE c.ForumID = @ForumID
   AND	((c.Priority = 1) OR (c.Priority <=0 AND c.LastPosted>=@Date )) 

)
AS
begin
   declare @TotalRows int
   declare @FirstSelectRowNumber int
   declare @LastSelectRowNumber int
   
   -- find total returned count
   select  @TotalRows = COUNT(c.TopicID)
   FROM [{databaseOwner}].[{objectQualifier}Topic] c 
   WHERE c.ForumID = @ForumID
   AND	c.[Priority] = 2
   AND	c.IsDeleted = 0
    AND	(c.TopicMovedID IS NOT NULL OR c.NumPosts > 0) 
	AND
	(@ShowMoved = 1 or (@ShowMoved <> 1 AND  c.TopicMovedID IS NULL))
	
	select @PageIndex = @PageIndex+1;
	select @FirstSelectRowNumber = (@PageIndex - 1) * @PageSize + 1;
	select @LastSelectRowNumber = (@PageIndex - 1) * @PageSize + @PageSize;
	
	with TopicIds  as
	 (
	 select ROW_NUMBER() over (order by tt.[Priority] desc,tt.LastPosted desc) as RowNum, tt.TopicID
	 from  [{databaseOwner}].[{objectQualifier}Topic] tt
	 where tt.ForumID = @ForumID and tt.[Priority] = 2
	  AND	tt.IsDeleted = 0
	  AND	((tt.TopicMovedID IS NOT NULL) OR (tt.NumPosts > 0))
	  AND
	  (@ShowMoved = 1 or (@ShowMoved <> 1 AND  TopicMovedID IS NULL))
	  )	  
	  select
		    c.ForumID,
            c.TopicID,
            c.Posted,
            LinkTopicID = IsNull(c.TopicMovedID,c.TopicID),
