<%@ Control Language="C#"  %>
<%@ Import Namespace="Spaces" %>


<asp:DataList ID="dlstAlbum" runat="server" Width="772px" BorderWidth="0px" ItemStyle-HorizontalAlign="Center" 
 ItemStyle-VerticalAlign="Top" CellPadding="0" CellSpacing="6" BackColor="#ffffff" RepeatColumns="4" RepeatDirection="Horizontal"  HorizontalAlign="Center">
<HeaderTemplate>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
  <tr>
	<td align="left">
		<img src="<%=Globals.GetSkinPath() %>/images/1.gif" border="0" align="absmiddle" /> 相册分类&nbsp;&nbsp;
	<td>
  <tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<div class="photo_content_b">
<p align="center" style="padding-top: 20px;">
				<a href="<%#Globals.GetSiteUrls().Album2(Convert.ToString(Eval("Account")),Convert.ToInt32(Eval("ID")))%>">
				<img src="<%#Convert.ToInt32(Eval("MainPhotoID"))!=-1? string.Format("{0}/{1}/{2}/small/{3}", Config.GetConfig().PhotosUrl, Eval("Account"), Eval("ID"), Eval("Image")):string.Format("{0}/images/NoPhoto.gif", Globals.ApplicationPath) %>" border=0 width=120 height=120 />
				</a>
			</p>
			<p align="center">
				<img src="<%=Globals.GetSkinPath() %>/images/icon_public.gif" border="0" align="absbottom" alt="" />
				<strong><a href="<%#Globals.GetSiteUrls().Album2(Convert.ToString(Eval("Account")),Convert.ToInt32(Eval("ID")))%>"><%#Eval("Name") %></a> </strong>
				
			</p>
			<div class="photo_solidline"></div>
			<p>照片张数：<%#Eval("NumPhotos") %>张</p>
			<p style="text-indent: 20px;"><%#Eval("Description") %></p>
			<p>更新时间：<%#Eval("Updated")%></p>
			<p>创建时间：<%#Eval("Created")%></p></div>
</ItemTemplate>
</asp:DataList>
<asp:DataList ID="dlstAlbum2" runat="server" Width="772px" BorderWidth="0px" ItemStyle-HorizontalAlign="Center" 
 ItemStyle-VerticalAlign="Top" CellPadding="0" CellSpacing="6" BackColor="#ffffff" RepeatColumns="4" RepeatDirection="Horizontal"  HorizontalAlign="Center">
<HeaderTemplate>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
  <tr>
	<td align="left">
		<img src="<%=Globals.GetSkinPath() %>/images/1.gif" border="0" align="absmiddle" /> <a href="<%=Globals.GetSiteUrls().Album(SpacesContext.Current.Account) %>">相册分类</a>--分类图片&nbsp;&nbsp;
	<td>
  <tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<div class="photo_content_b">
<p align="center" style="padding-top: 20px;">
				<a href="<%#Globals.GetSiteUrls().ShowPhoto(SpacesContext.Current.Account,Convert.ToInt32(Eval("PhotoID")))%>">
				<img src="<%#string.Format("{0}/{1}/{2}/small/{3}", Config.GetConfig().PhotosUrl, SpacesContext.Current.Account, Eval("CategoryID"), Eval("SmallPic")) %>" border=0 width=120 height=120 />
				</a>
			</p>
			<p align="center">
				<img src="<%=Globals.GetSkinPath() %>/images/icon_public.gif" border="0" align="absbottom" alt="" />
				<strong><a href="<%#Globals.GetSiteUrls().ShowPhoto(SpacesContext.Current.Account,Convert.ToInt32(Eval("PhotoID")))%>"><%#Eval("Title") %></a></strong>
				
			</p>
			<div class="photo_solidline"></div>
			<p>标签：<%#GetTags(Eval("Tags"))%> </p>
			<p style="text-indent: 20px;"><%#Eval("Detail") %></p>

			<p>创建时间：<%#Eval("Created")%></p>
			</div>
</ItemTemplate>
</asp:DataList>
<script runat="server" language="C#">
    string GetTags(object obj)
    {
         StringBuilder sb = new StringBuilder();
        System.Collections.Generic.List<String> list = Eval("Tags") as System.Collections.Generic.List<String>;
        if (list != null)
        {
            string format = "<a href=\"{2}/Tag_Photos.aspx?TagName={0}\" target=\"_blank\">{1}</a>";
            foreach (string s in list)
            {
                string a = string.Format(format, HttpUtility.UrlEncode( s.TrimStart(' ').TrimEnd(' ')),s,Globals.ApplicationPath);
                sb.Append(a);
               sb.Append(" ");
            }
            return sb.ToString();
        }
        return "";
    }
</script> 
<table width="772" border="0" align="center" cellpadding="0" cellspacing="6" bgcolor="#ffffff">
  <tr>
	<td>
	  
	</td>
		
  <tr>
		<td colspan=4></td>
	</tr>
</table>