<%@ Page language="c#" AutoEventWireup="false" EnableViewState="false"  %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CSD" Namespace="CommunityServer.Discussions.Controls" Assembly="CommunityServer.Discussions" %>
<%@ Import Namespace="CommunityServer.Discussions.Components" %>
<%@ Import Namespace="CommunityServer.Components" %>

<script runat="server">
	int i = 1;
</script>

<CS:MPContainer runat="server" id="MPContainer" ThemeMasterFile = "ForumMaster.ascx" >
    <CS:MPContent id="bcr" runat="server">
		<CSD:ForumSubscriptionView runat="server" id="Subscriptions" />
	</CS:MPContent>
	
	<CS:MPContent id="rcr" runat="server" >
		<div class="CommonSidebar">
			<div class="CommonSidebarArea">
				<h4 class="CommonSidebarHeader"><CS:ResourceLabel runat="server" ResourceName="Shortcuts" id="Resourcelabel7"/></h4>
				<div class="CommonSidebarContent">
					<CSD:ForumLinkBar runat="Server" ID="Forumlinkbar1"/>							
				</div>
			</div>

			<csd:ThreadRepeater runat="server" ThreadViewMode="MyForums" id="Threadrepeater3">
				<HeaderTemplate>
				<div class="CommonSidebarArea">
					<h4 class="CommonSidebarHeader"><CSD:ForumAnchor class="lnk3" AnchorType="MenuMyForums" runat="server" ShowIcon = "false" ID="Forumanchor3"/></h4>
					<div class="CommonSidebarContent">
				</HeaderTemplate>
				<ItemTemplate>
						<div class="CommonSidebarContentItem">
							<a title="<%# ( ForumConfiguration.Instance().EnablePostPreviewPopup && CSContext.Current.User.Profile.EnablePostPreviewPopup  ? Formatter.CheckStringLength(Formatter.StripAllTags(DataBinder.Eval(Container.DataItem, "Body").ToString()), 300) : String.Empty )%>" 
									href="<%# Globals.GetSiteUrls().Post( (int) DataBinder.Eval(Container.DataItem, "PostID") ) %> "> 
									<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem, "Subject").ToString(), 22) %>
								</a>
						</div>
				</ItemTemplate>
				<FooterTemplate>
					</div>
				</div>
				</FooterTemplate>
			</csd:ThreadRepeater>

			<csd:ThreadRepeater runat="server" ThreadViewMode="Active" id="Threadrepeater1">
				<HeaderTemplate>
				<div class="CommonSidebarArea">
					<h4 class="CommonSidebarHeader"><CSD:ForumAnchor class="lnk3" AnchorType="PostsActive" runat="server" id="Forumanchor1" /></h4>
					<div class="CommonSidebarContent">
				</HeaderTemplate>
				<ItemTemplate>
						<div class="CommonSidebarContentItem">
							<a title="<%# ( ForumConfiguration.Instance().EnablePostPreviewPopup && CSContext.Current.User.Profile.EnablePostPreviewPopup  ? Formatter.CheckStringLength(Formatter.StripAllTags(DataBinder.Eval(Container.DataItem, "Body").ToString()), 300) : String.Empty )%>" 
									href="<%# Globals.GetSiteUrls().Post( (int) DataBinder.Eval(Container.DataItem, "PostID") ) %> "> 
									<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem, "Subject").ToString(), 22) %>
								</a>
						</div>
				</ItemTemplate>				
				<FooterTemplate>
					</div>
				</div>
				</FooterTemplate>
			</csd:ThreadRepeater>


			<csd:ThreadRepeater ThreadViewMode="Unanswered" runat="server" id="Threadrepeater2">
				<HeaderTemplate>
				<div class="CommonSidebarArea">
					<h4 class="CommonSidebarHeader"><CSD:ForumAnchor class="lnk3" AnchorType="PostsUnanswered" runat="server" id="Forumanchor2" /></h4>
					<div class="CommonSidebarContent">
				</HeaderTemplate>
				<ItemTemplate>
					<div class="CommonSidebarContentItem">
						<a title="<%# ( ForumConfiguration.Instance().EnablePostPreviewPopup && CSContext.Current.User.Profile.EnablePostPreviewPopup  ? Formatter.CheckStringLength(Formatter.StripAllTags(DataBinder.Eval(Container.DataItem, "Body").ToString()), 300) : String.Empty )%>" 
								href="<%# Globals.GetSiteUrls().Post( (int) DataBinder.Eval(Container.DataItem, "PostID") ) %> "> 
								<%# Formatter.CheckStringLength(DataBinder.Eval(Container.DataItem, "Subject").ToString(), 22) %>
							</a>
					</div>
				</ItemTemplate>				
				<FooterTemplate>
					</div>
				</div>
				</FooterTemplate>
			</csd:ThreadRepeater>


			<div class="CommonSidebarArea">
				<h4 class="CommonSidebarHeader">
					<CS:ResourceLabel runat="server" ResourceName="SearchView_Inline11" id="Resourcelabel5"/>
				</h4>
					<div class="CommonSidebarContent">
						<CS:SiteStats runat="server" ID="Sitestats1">
							<SkinTemplate>
								<asp:Repeater id="TopUsers" runat="server">
									<ItemTemplate>
										<div class="CommonSidebarContentItem">
											<%# (i++).ToString() %>)
											<a href="<%# Globals.GetSiteUrls().UserProfile( (string) DataBinder.Eval(Container.DataItem, "Username") ) %>">
												<%# DataBinder.Eval(Container.DataItem, "DisplayName")%>
											</a>
											(<a href="<%# Globals.GetSiteUrls().SearchByUser( (int) DataBinder.Eval(Container.DataItem, "UserID"), ApplicationType.Forum ) %>"><%# ((int)DataBinder.Eval(Container.DataItem, "TotalPosts")).ToString("n0") %></a>)
										</div>
									</ItemTemplate>
								</asp:Repeater>
							</SkinTemplate>
						</CS:SiteStats>			
					</div>
			</div>
		</div>
	</CS:MPContent>

</CS:MPContainer>