{#include file="header.html"#}
<body>

<!-- top menu -->
{#include file="top.html"#}
<!-- top menu -->

<!-- wrap -->
<div class="wrap">
	<!-- nav -->
	<div class="navlink"><a href="admincp.php">{#$cp_lang.cp#}</a>{#$navlink#}</div>
	<!-- msg -->
	<!-- main -->
	<div class="container">
		<table cellpadding="0" cellspacing="0">
		<tr>
		<td style="width:180px">
		<!-- sidebar -->
		<div class="sidebar">
		{#foreach from=$menu item=item key=key name=outmenu#}
		<div class="leftmenubody">
			<div class="leftmenutitle" onClick="show_menu('leftmenuitem_','{#$smarty.foreach.outmenu.iteration#}');"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="leftmenuitem_icon_{#$smarty.foreach.outmenu.iteration#}" />&nbsp;&nbsp;{#$item.mName#}</div>
			<div class="leftmenuitem" id="leftmenuitem_{#$smarty.foreach.outmenu.iteration#}">
				{#foreach from=$item.mItems item=s_item key=s_key#}
				<li><a href="admincp.php?action={#$s_item#}">{#$s_key#}</a></li>
				{#/foreach#}
			</div>
		</div>
		{#/foreach#}
		</div>
		<!-- sidebar end -->
		</td>
		<td>
		<!-- content -->
		<div class="content">
			<!-- include -->
			{#if $type eq "view"#}
			<!-- tip -->
			<div class="msgbox">
				<div class="msgtitle">{#$cp_lang.operateTip#}</div>
				<div class="msgcontent">
					<li>{#$cp_lang.tpl_mod_tip_1#}</li>
					<li>{#$cp_lang.tpl_mod_tip_2#}</li>
					<li>{#$cp_lang.tpl_mod_tip_3#}</li>
				</div>
			</div>
			<!-- tip end -->
			<!-- item -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.view_tpl#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="30%" class="tcell_header">{#$cp_lang.filename#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.file_size#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.mtime#}</td>
						<td width="30%" class="tcell_header">{#$cp_lang.operation#}</td>
					</tr>
					<tr class="tcell_two">
						<td align="left"><img src="{#$PB_ENV.PB_URL#}images/file/updir.gif" />&nbsp;<a href="{#$actionurl#}&directory={#$updir#}">{#$cp_lang.up_dir#}</a></td>
						<td align="left" colspan="3">{#$cp_lang.cur_dir#}：{#$cdir#}</td>
					</tr>
					{#foreach from=$dirs item=item name=dirs#}
					<tr class="{#if $smarty.foreach.dirs.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="left" colspan="4"><img src="{#$PB_ENV.PB_URL#}images/file/{#$item[1]#}" />&nbsp;<a href="{#$actionurl#}{#$item[2]#}">{#$item[0]#}</a></td>
					</tr>
					{#/foreach#}
					{#foreach from=$files item=item name=files#}
					<tr class="{#if $smarty.foreach.files.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="left"><img src="{#$PB_ENV.PB_URL#}images/file/{#$item[1]#}" />&nbsp;<a href="{#$baseurl#}/{#$item[0]#}" target="_blank">{#$item[0]#}</a></td>
						<td align="center">{#$item[2]#}</td>
						<td align="center">{#$item[3]#}</td>
						<td align="center"><span class="altconfirm" onclick="checkAction('admincp.php?action=tpl&type=del{#$item[4]#}', '')"><img src="../templates/admin/images/del.gif" alt="{#$cp_lang.del#}" /></span>&nbsp;&nbsp;<span class="altconfirm" onclick="location.href='admincp.php?action=tpl&type=mod{#$item[4]#}'"><img src="../templates/admin/images/edit.gif" alt="{#$cp_lang.edit#}" /></span></td>
					</tr>
					{#/foreach#}
					</table>
					</form>
				</div>
			</div>
			<!-- item -->
			{#elseif $type eq "mod"#}
			<!-- tip -->
			<div class="msgbox">
				<div class="msgtitle">{#$cp_lang.operateTip#}</div>
				<div class="msgcontent">
					<li>{#$cp_lang.tpl_mod_tip_1#}</li>
					<li>{#$cp_lang.tpl_mod_tip_2#}</li>
					<li>{#$cp_lang.tpl_mod_tip_3#}</li>
				</div>
			</div>
			<!-- tip end -->
			<!-- list tag start -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.mod_tpl#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.mod_tpl_path#}</span><br />{#$cp_lang.mod_tpl_path_intro#}</td>
						<td width="50%" class="tcell_one"><input class="forminput" type="text" name="directory" id="directory" value="{#$directory#}" size="30" /></td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.mod_tpl_name#}</span><br />{#$cp_lang.mod_tpl_name_intro#}</td>
						<td width="50%" class="tcell_two"><input class="forminput" type="text" name="filename" id="filename" value="{#$filename#}" size="30" /></td>
					</tr>
					<tr>
						<td class="tcell_one" colspan="2">
							<textarea name="template" id="template" class="template">{#$template#}</textarea>
						</td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="6">
							<input type="hidden" class="hidden" name="submitted" value="submitted">
							<input type="submit" value="{#$cp_lang.save#}" class="submit" name="submit">
							<input type="button" value="{#$cp_lang.cancel#}" class="submit" name="cancel" onclick="history.go(-1);">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- list cate end -->
			{#elseif $type eq "define"#}
			<!-- define tpl start -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.define_tpl#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.define_tpl_name#}</span><br />{#$cp_lang.define_tpl_name_intro#}</td>
						<td width="50%" class="tcell_two">{#$definetpl.tplname#}</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.define_tpl_mark#}</span><br />{#$cp_lang.define_tpl_mark_intro#}</td>
						<td width="50%" class="tcell_one">{#$definetpl.tplmark#}</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.define_tpl_content#}</span><br />{#$definetpl.define_tpl_content_intro#}</td>
						<td width="50%" class="tcell_two">
							<textarea name="template" id="template" class="template">{#$definetpl.tplcontent#}</textarea>
						</td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="2">
							<input class="hidden" name="submitted" type="hidden" value="submitted">
							<input type="submit" value="{#$cp_lang.submit#}" class="submit" name="submit">
							<input type="reset" value="{#$cp_lang.reset#}" class="submit" name="reset">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- define tpl end -->
			{#elseif $type eq "guide"#}
			<!-- tpl make guide start -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.guide_tpl#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}" onsubmit="return cktpl(this)">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.guide_tpl_name#}</span><br />{#$cp_lang.guide_tpl_name_intro#}</td>
						<td width="50%" class="tcell_two"><input class="forminput" type="text" name="tplname" id="tplname" value="{#$guide.tplname#}" size="30" {#$guide.tplname_atta#} /></td>
					</tr>
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.guide_tpl_cate#}</span><br />{#$cp_lang.guide_tpl_cate_intro#}</td>
						<td width="50%" class="tcell_one"><input type="checkbox" name="tpl_cid[]" onclick="cateself(this)" value ="0"{#$guide.cate_self#} /><u>{#$cp_lang.guide_tpl_cateself#}</u>&nbsp;{#$tpl_cid#}</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.guide_tpl_type#}</span><br />{#$cp_lang.guide_tpl_type_intro#}</td>
						<td width="50%" class="tcell_two">
							<input type="radio" name="tpltype" value="thread" id="type_thread"{#$guide.type_thread#} />{#$cp_lang.guide_tpl_type_thread#}&nbsp;
							<input type="radio" name="tpltype" value="comment" id="type_comment"{#$guide.type_comment#} />{#$cp_lang.guide_tpl_type_comment#}&nbsp;
							<input type="radio" name="tpltype" value="member" id="type_member"{#$guide.type_member#} />{#$cp_lang.guide_tpl_type_member#}&nbsp;
						</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.guide_tpl_num#}</span><br />{#$cp_lang.guide_tpl_num_intro#}</td>
						<td width="50%" class="tcell_one">
							<input class="forminput" type="text" name="tplnum" id="tplnum" value="{#$guide.tplnum#}" size="15" />
						</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.guide_tpl_attribute#}</span><br />{#$cp_lang.guide_tpl_attribute_intro#}</td>
						<td width="50%" class="tcell_two">
							<p id="tpl_thread" style="display:{#$guide.tpl_thread#}">
								<input type="radio" name="thread_tplattribute" value="digg"{#$guide.thread_digg#} />{#$cp_lang.guide_tpl_attribute_digg#}&nbsp;
								<input type="radio" name="thread_tplattribute" value="diggdate"{#$guide.thread_diggdate#} />{#$cp_lang.guide_tpl_attribute_diggdate#}&nbsp;
								<input type="radio" name="thread_tplattribute" value="bury"{#$guide.thread_bury#} />{#$cp_lang.guide_tpl_attribute_bury#}&nbsp;
								<input type="radio" name="thread_tplattribute" value="burydate"{#$guide.thread_burydate#} />{#$cp_lang.guide_tpl_attribute_burydate#}<br />
								<input type="radio" name="thread_tplattribute" value="views"{#$guide.thread_views#} />{#$cp_lang.guide_tpl_attribute_views#}&nbsp;
								<input type="radio" name="thread_tplattribute" value="postdate"{#$guide.thread_postdate#} />{#$cp_lang.guide_tpl_attribute_postdate#}&nbsp;
								<input type="radio" name="thread_tplattribute" value="commentdate"{#$guide.thread_commentdate#} />{#$cp_lang.guide_tpl_attribute_commentdate#}
							</p>
							<p id="tpl_comment" style="display:{#$guide.tpl_comment#}">
								<input type="radio" name="comment_tplattribute" value="digg"{#$guide.comment_digg#} />{#$cp_lang.guide_tpl_attribute_digg#}&nbsp;
								<input type="radio" name="comment_tplattribute" value="postdate"{#$guide.comment_postdate#} />{#$cp_lang.guide_tpl_attribute_postdate#}
							</p>
							<p id="tpl_member" style="display:{#$guide.tpl_member#}">
								<input type="radio" name="member_tplattribute" value="newmember"{#$guide.member_newmember#} />{#$cp_lang.guide_tpl_attribute_newmember#}&nbsp;
								<input type="radio" name="member_tplattribute" value="contribute"{#$guide.member_contribute#} />{#$cp_lang.guide_tpl_attribute_contribute#}
							</p>
						</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.guide_tpl_order#}</span><br />{#$cp_lang.guide_tpl_order_intro#}</td>
						<td width="50%" class="tcell_one">
							<select name="order"><option value="desc"{#$guide.order_desc#}>{#$cp_lang.guide_tpl_order_desc#}</option><option value="asc"{#$guide.order_asc#}>{#$cp_lang.guide_tpl_order_asc#}</option></select>
						</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_two"><span class="defaultbold">{#$cp_lang.guide_tpl_limit#}</span><br />{#$cp_lang.guide_tpl_limit_intro#}</td>
						<td width="50%" class="tcell_two">
							<p>{#$cp_lang.guide_tpl_limit_time#}：<input type="radio" name="timelimit" value="0"{#$guide.timelimit0#} />{#$cp_lang.guide_tpl_limit_no#}&nbsp;
							<input type="radio" name="timelimit" value="3600"{#$guide.timelimit3600#} />1{#$cp_lang.guide_tpl_limit_hour#}&nbsp;
							<input type="radio" name="timelimit" value="86400"{#$guide.timelimit86400#} />24{#$cp_lang.guide_tpl_limit_hour#}&nbsp;
							<input type="radio" name="timelimit" value="604800"{#$guide.timelimit604800#} />1{#$cp_lang.guide_tpl_limit_week#}&nbsp;
							<input type="radio" name="timelimit" value="2592000"{#$guide.timelimit2592000#} />1{#$cp_lang.guide_tpl_limit_month#}&nbsp;<p/>
							<p>{#$cp_lang.guide_tpl_limit_title#}：<input class="forminput" type="text" id="titlelimit" name="titlelimit" value="{#$guide.titlelimit#}" size="5" />&nbsp;&nbsp;{#$cp_lang.guide_tpl_limit_summary#}：<input class="forminput" type="text" id="cotentlimit" name="cotentlimit" value="{#$guide.cotentlimit#}" size="5" /></p>
							<p>{#$cp_lang.guide_tpl_limit_pa#}：<input type="radio" id="topicimglimit_1" name="topicimglimit" value="1"{#$guide.topicimglimit1#} />{#$cp_lang.yes#}&nbsp;<input type="radio" id="topicimglimit_0" name="topicimglimit" value="0"{#$guide.topicimglimit0#} />{#$cp_lang.no#}</p>
							<p>只针对推荐主题：<input type="radio" id="commendlimit_1" name="commendlimit" value="1"{#$guide.commendlimit1#} />{#$cp_lang.yes#}&nbsp;<input type="radio" id="commendlimit_0" name="commendlimit" value="0"{#$guide.commendlimit0#} />{#$cp_lang.no#}</p>
							<p>推荐主题带展示图:<input type="radio" name="commendlimitpic" value="1" {#$guide.ifcommendpic1#}/>是&nbsp;<input type="radio" name="commendlimitpic" value="0" {#$guide.ifcommendpic0#}/>否</p>
							<p>{#$cp_lang.guide_tpl_limit_timeformat#}：
							<select name="timeformatlimit">
							<option value="Y-m-d H:i:s"{#$guide.timeformatlimit1#}>2007-09-16 15:31:18</option>
							<option value="Y-m-d"{#$guide.timeformatlimit2#}>2007-09-16</option>
							<option value="m-d"{#$guide.timeformatlimit3#}>09-16</option>
							<option value="-1"{#$guide.timeformatlimit4#}>{#$cp_lang.guide_tpl_limit_timeformatc#}</option>
							</select></p>
						</td>
					</tr>
					<tr>
						<td width="50%" class="tcell_one"><span class="defaultbold">{#$cp_lang.guide_tpl_content#}</span><br />{#$cp_lang.guide_tpl_content_intro#}</td>
						<td width="50%" class="tcell_one">
							<textarea name="template" id="template" class="template">{#$guide.tplcontent#}</textarea>
						</td>
					</tr>
					<tr>
						<td class="tcell_sub" colspan="2">
							<input class="hidden" name="submitted" type="hidden" value="submitted">
							<input type="submit" value="{#$cp_lang.submit#}" class="submit" name="submit">
							<input type="reset" value="{#$cp_lang.reset#}" class="submit" name="reset">
						</td>
					</tr>
					</table>
					</form>
				</div>
			</div>
			<!-- tpl make guide end -->
			{#elseif $type eq "list"#}
			<!-- tpl list start -->
			<!-- tip -->
			<div class="msgbox">
				<div class="msgtitle">{#$cp_lang.operateTip#}</div>
				<div class="msgcontent">
					<li>{#$cp_lang.tpl_list_tip_1#}</li>
					<li>{#$cp_lang.tpl_list_tip_2#}</li>
				</div>
			</div>
			<!-- tip end -->
			<div class="tablebody">
				<div class="tabletitle" onClick="show_menu('tablecontent_','1');"><span style="float:right;"><img src="{#$PB_ENV.PB_URL#}templates/admin/images/collapse.gif" class="leftmenuicon" alt="Collapse" id="tablecontent_icon_1" /></span>{#$cp_lang.list_tpl#}</div>
				<div class="tablecontent" id="tablecontent_1">
				<form action="{#$actionurl#}" method="post" name="form" id="{#$type#}">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td width="30%" class="tcell_header">{#$cp_lang.list_tpl_name#}</td>
						<td width="10%" class="tcell_header">{#$cp_lang.list_tpl_mark#}</td>
						<td width="20%" class="tcell_header">{#$cp_lang.list_tpl_type#}</td>
						<td width="*" class="tcell_header">{#$cp_lang.operation#}</td>
					</tr>
					{#foreach from=$tpllist item=item name=tpllist#}
					<tr class="{#if $smarty.foreach.tpllist.iteration % 2 == 0#}tcell_one{#else#}tcell_two{#/if#}">
						<td align="center">{#$item.tplname#}</td>
						<td align="center"><input type="text" value="{#$item.tplmark#}" class="forminput" size="20" /></td>
						<td align="center">{#$item.tpltype#}</td>
						<td align="center">[<a href="admincp.php?action=tpl&amp;type=list&amp;job=edit&amp;tplid={#$item.tplid#}">{#$cp_lang.edit#}</a>][<a onclick="if(confirm('{#$cp_lang.confirm_del#}')){return true;}else{return false;};" href="admincp.php?action=tpl&amp;type=list&amp;job=del&amp;tplid={#$item.tplid#}">{#$cp_lang.del#}</a>]</td>
					</tr>
					{#/foreach#}
					</table>
					</form>
				</div>
			</div>
			<!-- tpl list end -->
			{#/if#}
			<!-- include -->
		</div>
		<!-- content -->
		</td>
		</tr>
		</table>
	</div>
</div>
<!-- wrap -->

{#include file="footer.html"#}