<%@ Control %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="FileGalleries" Namespace="CommunityServer.Files.Controls" Assembly="CommunityServer.Files" %>
<%@ Import Namespace="CommunityServer.Files.Controls" %>
<%@ Import Namespace="CommunityServer.Files.Components" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Controls" %>
<%@ Import Namespace="CommunityServer" %>

<script language="C#" runat="server">

protected override void OnLoad (EventArgs e) 
{
	base.OnLoad(e);
	
	CSContext csContext = CSContext.Current;
	string baseUrl = FileGalleryUrls.Instance().Home;
	
	PostDateLink.Text = FileGalleryResourceManager.GetString( "Files_PortalEntryListing_TitlePostDate" );
	RatingLink.Text = FileGalleryResourceManager.GetString( "Files_PortalEntryListing_TitleRating" );
	CommentsLink.Text = FileGalleryResourceManager.GetString( "Files_PortalEntryListing_TitleReplies" );
	DownloadLink.Text = FileGalleryResourceManager.GetString( "Files_PortalEntryListing_TitleDownloads" );
	
	DownloadLink.NavigateUrl = baseUrl + "?Sort=Downloads";
	RatingLink.NavigateUrl = baseUrl + "?Sort=Ratings";
	PostDateLink.NavigateUrl = baseUrl + "?Sort=Date";
	CommentsLink.NavigateUrl = baseUrl + "?Sort=Comments";

	switch (Request.QueryString["Sort"])
	{
		case "Ratings":
			Entrylisting1.SortBy = EntriesSortBy.Rating;
			RatingLink.Style["font-weight"] = "bold";
			break;
			
		case "Date":
			Entrylisting1.SortBy = EntriesSortBy.PostDate;
			PostDateLink.Style["font-weight"] = "bold";
			break;
			
		case "Comments":
			Entrylisting1.SortBy = EntriesSortBy.Comments;
			CommentsLink.Style["font-weight"] = "bold";
			break;
			
		default:
			Entrylisting1.SortBy = EntriesSortBy.Downloads;
			DownloadLink.Style["font-weight"] = "bold";
			break;
	}		
}

</script>

<div class="CommonContentArea">

    <CS:AdPart runat = "Server" contentname="StandardTop" ID="ap1">
	    <CS:Ads Zone="StandardTop" runat="server" id="ad1" />
	</CS:AdPart>
	<h2 class="CommonTitle">
		<CS:ContentPart ContentName="FilesDefault" runat="Server" ID="Contentpart1">
			<FileGalleries:ResourceControl runat="server" ResourceName="files" ID="Resourcecontrol1" />
		</CS:ContentPart>
	</h2>
	<div class="CommonContent">
	
	<asp:HyperLink Runat="server" ID="DownloadLink" /> |
	<asp:HyperLink Runat="server" ID="RatingLink" /> |
	<asp:HyperLink Runat="server" ID="PostDateLink" /> |
	<asp:HyperLink Runat="server" ID="CommentsLink" />
	
	<FileGalleries:PortalEntryListing runat="server" ID="Entrylisting1" SortBy="Downloads" SkinName="Skin-PortalEntryListingExtended.ascx" Count="10" />
	

	
	<CS:AdPart runat = "Server" contentname="StandardBottom" ID="ap2">
	    <CS:Ads Zone="StandardBottom" runat="server" id="ad2" />
	</CS:AdPart>

</div>		




