<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<%@ Register TagPrefix="uc1" TagName="UIFrameLeft" Src="Controls/UIFrameLeft.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIFrameTop" Src="Controls/UIFrameTop.ascx" %>
<%@ Register TagPrefix="uc1" TagName="UIHead" Src="Controls/UIHead.ascx" %>
<%@ Page CodeBehind="Share_Photo.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.Share_Photo"  enableViewState="False"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
		
		<script language="JAVASCRIPT">
function getUrlParam(paramName){	
	var s=location.search;
	if(s!=null&&s.length>1){
	var sarr=s.substr(1).split("&");
	var tarr;
	for(i=0;i<sarr.length;i++){
	tarr=sarr[i].split("=");
	if(tarr.length==2&&tarr[0].toLowerCase()==paramName){
	return tarr[1];
	}
	}
	return null;
	}
}
function gosearch()
{
	var str="";
	if ((getUrlParam('page')!=null) && (getUrlParam('page')!="")) str=str+"&page="+getUrlParam('page');
	if (document.all.key.value!="") str=str+"&key="+document.all.key.value;
	str=str+"&sort="+document.all.sort.value;
	str=str+"&dirid="+getUrlParam('dirid');
	str="?"+str.substring(1,str.length);
	window.location='Share_Photo.aspx'+str;
}
		</script>
</HEAD>
	<body class="body_1" scroll="no">
		<form runat="server">
			<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td height="60"><uc1:uihead id="UIHead1" runat="server"></uc1:uihead></td>
				</tr>
				<tr>
					<td height="10"><uc1:uiframetop id="UIFrameTop1" runat="server"></uc1:uiframetop></td>
				</tr>
				<tr>
					<td>
						<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
							<tr>
								<td class="frame_left_1" vAlign="top" width="193"><uc1:uiframeleft id="UIFrameLeft1" runat="server"></uc1:uiframeleft></td>
								<td class="frame_body_1" vAlign="top">
									<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td height="32"> 排序：
										  <select name="sort" id="sort" runat="server" onChange="gosearch();">
																<option value="ID|Desc" selected>按上传日期[最近的]</option>
																<option value="ID|ASC">按上传日期[最早的]</option>
																<option value="(Width * Height)|Desc">按图片尺寸[最大的]</option>
																<option value="(Width * Height)|ASC">按图片尺寸[最小的]</option>
																<option value="FileSize|Desc">按图片大小[最大的]</option>
																<option value="FileSize|ASC">按图片大小[最小的]</option>
                                                                <option value="Click|Desc">按查看数</option>
                                                                <option value="PL|Desc">按评论数</option>
                                                                <option value="dig|Desc">按投票数</option>
																<option value="0">自排序</option>
															</select></td>
								  <td height="32"><div align="right">
													<INPUT class="text1" id="key" type="text" name="Text1" runat="server"> &nbsp; <input class="button1" id="Button1" type="button" value=" 查 询 " name="bSearch" onClick="gosearch();">
												</div>
											</td>
										</tr>
										<tr>
											<td class="main_title_1" height="32">
												<div style="TEXT-ALIGN: left">&nbsp; <IMG src="images/icon_album.gif" align="absMiddle">&nbsp; 
													<a href="Share_Album.aspx">共享相册</a> -&gt;
													<a href="Share_Album.aspx?username=<%=lUserName%>"><%=lUserName%></a>-&gt;
													<%=lAlbumName%>
												</div>
										  </td>
											<td class="main_title_1"><div align="right"><a href="javascript:history.back();"><img src="images/link_back.gif" align="absMiddle"></a></div>
											</td>
										</tr>
										<tr>
											<td colspan="2" vAlign="top" class="main_content_1">
												<div class="main_content_2">
													<div align="center" id="div1" runat="server">
														<p>&nbsp;</p>
														<p>&nbsp;</p>
														<p><FONT face="宋体"></FONT>&nbsp;</p>
														<p>此相册需要输入密码才可查看，请输入密码： <input name="password" type="password" class="kuan" id="password" size="10" runat="server">
															<input class="btn" id="Submit2" type="button" value="确定" name="submit2" runat="server" onserverclick="Submit2_ServerClick">
														</p>
													</div>
													<div id="div2" runat="server">
														<asp:datalist id="dPhotos" runat="server" Width="100%" cellspacing="3" cellpadding="0" RepeatColumns="2"
															EnableViewState="False">
															<ItemStyle Width="50%"></ItemStyle>
															<ItemTemplate>
																<TABLE cellSpacing="1" cellPadding="3" width="100%" bgColor="#AAC1DE" border="0">
																	<TR>
																		<TD width="120" align="center" valign="middle" bgColor="#ffffff">
																			<a href='Photo_Detail.aspx?PhotoID=<%# DataBinder.Eval(Container.DataItem, "ID") %>'>
																				<img src='<%# tuurl(DataBinder.Eval(Container.DataItem, "alias").ToString(),DataBinder.Eval(Container.DataItem, "username").ToString()) %>' border="0" id="a<%# Container.ItemIndex + 1 %>"></a></TD>
																		<TD bgColor="#ffffff" valign="top">
																			<div style="width:100%;height:100px;line-height:18px;padding:3px;">
																				·<a href='Photo_Detail.aspx?PhotoID=<%# DataBinder.Eval(Container.DataItem, "ID") %>' class="link1">
																					<%# DataBinder.Eval(Container.DataItem, "FileName") %>
																				</a>
																				<br>
																				尺寸：<%# DataBinder.Eval(Container.DataItem, "width").ToString() %>×<%# DataBinder.Eval(Container.DataItem, "height").ToString() %><br>
																				大小：<%# showsize(DataBinder.Eval(Container.DataItem, "filesize").ToString()) %><br>
																				标签：<%# DataBinder.Eval(Container.DataItem, "tag") %><br>
																				所属用户：<a href='user_info.aspx?UserName=<%# DataBinder.Eval(Container.DataItem, "username") %>'><%# DataBinder.Eval(Container.DataItem, "username") %></a><br>
																				<a href='User_Favorite.aspx?id=<%# DataBinder.Eval(Container.DataItem, "ID") %>'><img src="Images/icon_favorite.gif" width="13" height="13" border="0">加入收藏</a>
																				评论(<%# DataBinder.Eval(Container.DataItem, "pl") %>) 点击(<%# DataBinder.Eval(Container.DataItem, "click") %>) 
																				投票(<%# DataBinder.Eval(Container.DataItem, "dig") %>)
																			</div>
																		</TD>
																	</TR>
																</TABLE>
															</ItemTemplate>
														</asp:datalist></div>
												</div>
											</td>
										</tr>
										<tr>
											<td colspan="2" vAlign="top" class="main_title_1"><table width="100%">
													<tr>
														<td><webdiyer:AspNetPager id="Pager" runat="server" PageSize="24" HorizontalAlign="Right" AlwaysShow="True"
																ShowCustomInfoSection="Left" NumericButtonCount="15" ShowBoxThreshold="21" FirstPageText="<font face=webdings>9</font>"
																PrevPageText="<font face=webdings>3</font>" NextPageText="<font face=webdings>4</font>" LastPageText="<font face=webdings>:</font>"
																Height="20px" UrlPaging="True" onpagechanged="Pager_PageChanged"></webdiyer:AspNetPager></td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
