<%@ Page CodeBehind="admin_transfer_add.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.admin_transfer_add" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
		
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<link href="img/main.css" rel="stylesheet" type="text/css">
		<style type="text/css">	
		.style5 { FONT-WEIGHT: bold; COLOR: #ffffff }	
		.style6 { COLOR: #0000ff }	
		</style>
			<script>
	function admin_Size(num,objname)
{
	var obj=document.getElementById(objname)
	if (parseInt(obj.rows)+num>=3) {
		obj.rows = parseInt(obj.rows) + num;	
	}
	if (num>0)
	{
		obj.width="90%";
	}
}
function NewsTypeSel(Val){
	if (Val=="0"){
		document.getElementById("skin_info").innerHTML = "1.相片名：{$filename}<br>2.缩图地址：{$url1}<br>3.大图地址：{$url2}<br>4.相片注释：{$note}<br>5.所属用户：{$user}<br>6.大小：{$size}<br>7.尺寸：{$dimension}<br>8.上传时间：{$time}<br>9.查看次数：{$count}<br>10.评论次数：{$commentcount}";
		document.all.show1.style.display='';
		document.all.show2.style.display='none';
		document.all.show3.style.display='none';
		document.all.show4.style.display='none';
	}
	else if(Val=="1"){
		document.getElementById("skin_info").innerHTML = "1.相册名：{$dirname}<br>2.相册ID：{$id}<br>3.相册注释：{$note}<br>4.相册封面：{$face}<br>5.所属用户：{$user}<br>6.更新时间：{$time}";
		document.all.show1.style.display='none';
		document.all.show2.style.display='';
		document.all.show3.style.display='none';
		document.all.show4.style.display='none';
	}
	else if(Val=="2"){
		document.getElementById("skin_info").innerHTML = "1.用户名：{$username}<br>2.等级：{$level}<br>3.性别：{$sex}<br>4.主页：{$url}<br>5.邮件：{$mail}<br>6.QQ：{$qq}<br>7.MSN：{$msn}<br>8.注册时间：{$regdate}<br>9.相册数：{$albumcount}<br>10.相片数：{$photocount}<br>11.空间访问数：{$clickcount}<br>12.空间介绍：{$recommend}<br>13.头像地址：{$face}<br>14.个人空间地址：{$outurl}";
		document.all.show1.style.display='none';
		document.all.show2.style.display='none';
		document.all.show3.style.display='';
		document.all.show4.style.display='none';
	}
	else if(Val=="3"){
		document.getElementById("skin_info").innerHTML = "1.公告名：{$title}<br>2.公告内容：{$content}<br>3.添加时间：{$time}<br>4.添加人：{$adduser}";
		document.all.show1.style.display='none';
		document.all.show2.style.display='none';
		document.all.show3.style.display='none';
		document.all.show4.style.display='';
	}
}
function OutputNewsCode(Val){
	var obj = document.all.code;
	if (obj){
		if (Val!=''){
			obj.value = "<scr"+"ipt src=\"homeapply.aspx?GetName="+Val.toLowerCase()+"\"><\/scr"+"ipt>";
		}else{
			obj.value = "";
		}
	}
}
			</script>
</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<div align="center">
				<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" id="brb" height="27">
					<tr>
						<td colSpan="3" class="td_title"><asp:Label id="add" runat="server" Font-Bold="True">添加调用</asp:Label>
						</td>
					</tr>
					<tr class="tableTd">
						<td width="297" align="right">调用类型：</td>
						<td width="1054"><span class="forumrow"><span class="a3-green">
									<select name="T_type" id="T_type" runat="server" onChange="NewsTypeSel(this.selectedIndex)">
										<option value="1" selected>共享相片</option>
										<option value="2">共享相册</option>
										<option value="3">注册用户</option>
										<option value="4">公告</option>
									</select>
								</span></span>
					  </td>
					</tr>
					<tr class="tableTd">
						<td align="right">调用标识名称：</td>
						<td><span class="forumrow"><span class="a3-green"> <input type="text" name="T_name" id="T_name" runat="server" onKeyUp="OutputNewsCode(this.value);"
										style="WIDTH: 113px; HEIGHT: 20px" size="13"> </span></span>(请使用英文或数字设定调用名称,并且是唯一标识)
							<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="必须输入标识名称" ControlToValidate="T_name"></asp:RequiredFieldValidator></td>
					</tr>
					<tr class="tableTd">
						<td align="right">调用代码：
						</td>
						<td><input name="code" type="text" disabled id="code" size="70">
							<BR>
							(<span class="style6">将调用代码复制到页面中任何位置即可显示此调用</span>)</td>
					</tr>
					<tr class="tableTd">
						<td align="right">调用说明：
						</td>
						<td><input type="text" name="textfield" id="T_sm" runat="server"> (提示说明,以作管理区分)
						</td>
					</tr>
					<tr class="tableTd">
						<td align="right">调用设置：</td>
						<td>
							<div id="show1">排序：
								<select name="select" runat="server" id="T_order1">
									<option value="LastTime|Desc" selected>按上传日期[最近的]</option>
									<option value="LastTime|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>
								</select>
								<BR>
								显示记录数： <input name="T_count1" type="text" size="10" id="T_count1" runat="server" value="10">
								标题最多字符数：<INPUT id="T_len1" type="text" size="10" value="10" name="textfield" runat="server">
								<br>
								单独用户名： <input type="text" name="textfield" id="T_user1" runat="server"> (请填写用户名,用英文逗号分隔)<br>
								类别ID： <input type="text" name="textfield" id="T_kind1" runat="server"> (请填写类别ID,用英文逗号分隔)<br>
								动态变量：（使用调用代码时动态传递的URL参数）<br>
								Dir（调用指定相册的文件）</div>
							<div id="show2" style="DISPLAY:none">排序：
								<select name="select" runat="server" id="T_order2">
									<option value="LastTime|Desc" selected>按创建日期[最近的]</option>
									<option value="LastTime|ASC">按创建日期[最早的]</option>
									<option value="UpdateTime|DESC">按最后上传日期[最近的]</option>
									<option value="UpdateTime|ASC">按最后上传日期[最早的]</option>
									<option value="Photocount|Desc">按图片数量[最多的]</option>
									<option value="Photocount|ASC">按图片数量[最少的]</option>
								</select>
								<BR>
								显示记录数： <input name="textfield" type="text" size="10" runat="server" id="T_count2" value="10">
								标题最多字符数：<INPUT id="T_len2" type="text" size="10" value="10" name="textfield" runat="server">
								<br>
								单独用户名： <input type="text" name="textfield" runat="server" id="T_user2"> (请填写用户名,用英文逗号分隔)<br>
								类别ID： <input type="text" name="textfield" id="T_kind2" runat="server"> (请填写类别ID,用英文逗号分隔)</div>
							提示：将相册ID做为参数dir传递到调用相片页即可显示此相册下的文件
							<DIV></DIV>
							<div id="show3" style="DISPLAY:none">排序：
								<select name="select" runat="server" id="T_order3">
									<option value="regdate|Desc" selected>按注册时间</option>
									<option value="level|ASC">按等级</option>
									<option value="spacetotal|DESC">按使用空间</option>
									<option value="albumcount|DESC">按相册数量</option>
									<option value="photocount|DESC">按相片数量</option>
									<option value="clickcount|DESC">按空间访问量</option>
								</select>
								显示记录数： <input name="textfield" type="text" size="10" runat="server" id="T_count3" value="10">
								<br>
								等级名称： <input type="text" name="textfield" id="T_level" runat="server"> (请填写等级名称,用英文逗号分隔)
							</div>
							<div id="show4" style="DISPLAY:none">显示记录数： <input name="T_count4" type="text" size="10" runat="server" id="T_count4" value="10">标题最多字符数：<INPUT id="T_len4" type="text" size="10" value="10" name="textfield" runat="server"></div></td></tr>
					<tr>
						<td colSpan="3" class="td_title">参数设置(请用HTML语法填写)：
						</td>
					</tr>
					<tr class="tableTd">
						<td align="right">模板_开始标记部分：</td>
						<td><span class="forumrow"><span class="a3-green"><span class="forumrowHighlight"> <textarea name="Skin_Head" ID="Skin_Head" style="WIDTH:100%" rows="3" runat="server"></textarea>
										<a href="javascript:admin_Size(-3,'Skin_Head')"><img src="../images/minus1.gif" width="20" height="20" border='0' unselectable="on"></a>
										<a href="javascript:admin_Size(3,'Skin_Head')"><img src="../images/plus1.gif" width="20" height="20" border='0' unselectable="on"></a>
									</span></span></span>
						</td>
					</tr>
					<tr class="tableTd">
						<td align="right">模板_主体循环标记部分：
							<fieldset title="模板变量">
								<legend>
									&nbsp;模板变量说明&nbsp;</legend>
								<div id="skin_info" align="left">1.相片名：{$filename}<br>
									2.小缩图地址：{$url1}<br>
                                    3.中缩图地址：{$url2}<br>
									4.大图地址：{$url3}<br>
									5.相片注释：{$note}<br>
									6.所属用户：{$user}<br>
									7.大小：{$size}<BR>
									8.尺寸：{$dimension}<br>
									9.上传时间：{$time}<br>
									10.查看次数：{$count}<br>
									11.评论次数：{$count}</div>
							</fieldset>
						</td>
						<td><span class="forumrowHighlight"> <textarea name="Skin_Main" ID="Skin_Main" style="WIDTH:100%" rows="10" runat="server"></textarea>
								<a href="javascript:admin_Size(-3,'Skin_Main')"><img src="../images/minus1.gif" width="20" height="20" border='0' unselectable="on"></a>
								<a href="javascript:admin_Size(3,'Skin_Main')"><img src="../images/plus1.gif" width="20" height="20" border='0' unselectable="on"></a>
							</span>
						</td>
					</tr>
					<tr class="tableTd">
						<td align="right">模板_结束标记部分：</td>
						<td><span class="forumrowHighlight"> <textarea name="Skin_Footer" ID="Skin_Footer" style="WIDTH:100%" rows="3" runat="server"></textarea>
								<a href="javascript:admin_Size(-3,'Skin_Footer')"><img src="../images/minus1.gif" width="20" height="20" border='0' unselectable="on"></a>
								<a href="javascript:admin_Size(3,'Skin_Footer')"><img src="../images/plus1.gif" width="20" height="20" border='0' unselectable="on"></a>
							</span>
						</td>
					</tr>
					<tr class="tableTd">
						<td colspan="2" align="right"><div align="center"><span class="forumrow"><span class="px14">
										<asp:button id="Submit1" runat="server" Width="100px" Text="添　加" class="formbutton" onclick="Submit1_Click"></asp:button>
									</span></span>
							</div>
						</td>
					</tr></table>
							</div>
		</form>
		<script>
			OutputNewsCode(document.all.T_name.value);
			NewsTypeSel(document.all.T_type.selectedIndex);
		</script>
	</body>
</HTML>
