<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>刀客建站系统   管理中心 - 站点设置 </title>
<%{include file="header.html"}%>
</head>
<body>
<h1>

<span class="action-span1"><a href="index.php?act=main">刀客建站系统   管理中心</a>  - 站点设置 </span>
<span style='float:right;margin-right:10px;'><img src='images/top_help.gif'><a href="http://sitepub.cn/help"> 帮助 </a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_forum.gif'><a href="http://bbs.sitepub.cn"> 论坛 </a></span>
<div style="clear:both"></div>
</h1><div class="tab-div">
 	<div id="tabbar-div">
      <p>
		  		<span class="tab-front" id="basic-tab">基本信息</span>
	 			<span class="tab-back" id="display-tab">页面显示</span>
	 			<span class="tab-back" id="system-tab">账号管理</span>
  	  </p>
    </div> 
	<!-- tab body -->
  <div id="tabbody-div">
    <form enctype="multipart/form-data" id="form_id" action="index.php?act=site.save_seeting" method="post">
  		<table width="90%" id="basic-table" >
		  	<tr>
	   		   <td class="label" valign="top">站点名称</td> 
					<td><input value='<%{$out.setting_arr.site_name.value|escape:html}%>' name='site_config[site_name]'  /></td>
			</tr>
			<tr>
	   		   <td class="label" valign="top">首页 Title</td> 
					<td><input value='<%{$out.setting_arr.site_title.value|escape:html}%>' name='site_config[site_title]'  /></td>
			</tr>	
			<tr>
	   		   <td class="label" valign="top">首页 Keywords</td> 
					<td><input value='<%{$out.setting_arr.site_keywords.value|escape:html}%>' name='site_config[site_keywords]'  /></td>
			</tr>		
			<tr>
	   		   <td class="label" valign="top">首页 Description</td> 
					<td><textarea style='width:300px;height:75px;' name='site_config[site_desc]'/><%{$out.setting_arr.site_desc.value|escape:html}%> </textarea>
					&nbsp;&nbsp;<a href="index.php?act=help.get&h=seo&width=450"   class="jTip"  name="我希望获得更多帮助"><img src='images/help.png'></a>	 
					</td>
			</tr>	

			<tr>
	   		   <td class="label" valign="top">站点Logo</td> 
					<td><input  name='site_logo_upload_file' type='file' /> <input type='hidden' name='site_config[site_logo][value]' value='<%{$out.setting_arr.site_logo.value}%>'>
					宽 <input size="4" name="site_config[site_logo][image_width]" value="<%{$out.setting_arr.site_logo.image_size.width|escape:html}%>" id='site_logo_width_id'/> 
					高 <input size="4" name="site_config[site_logo][image_height]" value="<%{$out.setting_arr.site_logo.image_size.height|escape:html}%>" id='site_logo_height_id'/>			
					&nbsp;&nbsp;<a href="index.php?act=help.get&h=logo&width=450"   class="jTip"  name="我希望获得更多帮助"><img src='images/help.png'></a>		
					<br><span style='color:#9CACAF' onmouseover='this.style.color="#192E32";' onmouseout='this.style.color="#9CACAF";'>宽<%{$out.setting_arr.site_logo.image_size.width|escape:html}%>px、高<%{$out.setting_arr.site_logo.image_size.height|escape:html}%>px为当前模版默认logo尺寸比例。<br>
					如果您上传logo大小与默认尺寸不同，请修正该数值；如果不修正，系统将自动调整为默认logo尺寸。	
					</span>	 
					<br>
					<p>
					<%{if $out.setting_arr.site_logo.value}%>
						<img src='<%{$out.setting_arr.site_logo.preview_img}%>'>
					<%{/if}%>
					</p>
					</td> 
			</tr>	
					
			<tr>
	   		   <td class="label" valign="top">是否关闭站点</td> 
					<td>
						<label><input type="radio" checked=true name="site_config[site_is_close]" value="0"/>否</label>
						<label><input type="radio" <%{if $out.setting_arr.site_is_close.value}%>checked=true<%{/if}%> name="site_config[site_is_close]" value="1"/>是</label>
					</td>
			</tr>	
			<tr>
	   		   <td class="label" valign="top">开启URL静态化 </td> 
					<td>
						<label><input type="radio" checked=true name="site_config[url_rewrite]" value="0"/>否</label>
						<label><input type="radio" <%{if $out.setting_arr.url_rewrite.value}%>checked=true<%{/if}%> name="site_config[url_rewrite]" value="1"/>是</label>
						<br><span style='color:#9CACAF' onmouseover='this.style.color="#192E32";' onmouseout='this.style.color="#9CACAF";'>请确认刀客建站系统  自带的.htaccess文件在站点根目录下,并且服务器支持.htaccess文件</span>
					</td>
			</tr>	
			<tr>
	   		   <td class="label" valign="top">开启验证码</td> 
					<td>
						<label><input type="radio" checked=true name="site_config[is_checkcode]" value="0"/>否</label>
						<label><input type="radio" <%{if $out.setting_arr.is_checkcode.value}%>checked=true<%{/if}%> name="site_config[is_checkcode]" value="1"/>是</label>
					</td>
			</tr>	

			<tr>
	   		   <td class="label" valign="top">前台语言选择</td> 
					<td>
						<select name='site_config[glo_proscenium_lang]'>
							<option value='en_UTF-8' <%{if $out.setting_arr.glo_proscenium_lang.value=='en_UTF-8'}%> selected=true<%{/if}%> >英文</option>
							<option value='zh_cn_UTF-8' <%{if $out.setting_arr.glo_proscenium_lang.value=='zh_cn_UTF-8'}%> selected=true<%{/if}%> >中文</option>
						</select>
					</td>
			</tr>	

			<tr>
	   		   <td class="label" valign="top">版权信息</td> 
					<td><input value='<%{$out.setting_arr.site_copyright.value|escape:html}%>' name='site_config[site_copyright]'  /><br>
				<span style='color:#9CACAF' onmouseover='this.style.color="#192E32";' onmouseout='this.style.color="#9CACAF";'>出现在网站底部的关于网站版权，归属权的文字信息</span>	 
					</td>
			</tr>	
			<tr>
	   		   <td class="label" valign="top">友情链接</td> 
					<td >
						<%{foreach item=v key=k from=$out.setting_arr.site_external_link.list_val}%>
							<p><a href="javascript:void(0);" onclick='del_p(this)'>[-]</a> 网站名称&nbsp;<input value='<%{$v.name|escape:html}%>' name='site_config[site_external_link][name][<%{$k}%>]' >&nbsp;&nbsp;&nbsp;网址&nbsp;<input name='site_config[site_external_link][link][<%{$k}%>]' value='<%{$v.link|escape:html}%>' ></p>
						<%{/foreach}%>                                     
						<p><a href="javascript:void(0);" onclick='add_p(this)'>[+]</a> 网站名称&nbsp;<input name='site_config[site_external_link][name][]'  >&nbsp;&nbsp;&nbsp;网址&nbsp;<input  name='site_config[site_external_link][link][]' ></p>
						<br>
						<span style='color:#9CACAF' onmouseover='this.style.color="#192E32";' onmouseout='this.style.color="#9CACAF";'>以文字链接方式出现在网站底部，点击[+]进行添加，每个链接文字建议不超过20个字符</span>
					&nbsp;&nbsp;<a href="index.php?act=help.get&h=external_link&width=450"   class="jTip"  name="我希望获得更多帮助"><img src='images/help.png'></a>	 
					</td>
			</tr>	


		</table>
		<table width="90%" id="display-table" style='display:none'>
  			<tr>
	   		   <td class="label" valign="top">软件缩略图尺寸</td> 
					<td>
						宽<input value='<%{$out.setting_arr.img_thumb.image_size.width|escape:html}%>' name='site_config[img_thumb][img_width]' id='img_thumb_width_id' size=4/>	
						高<input value='<%{$out.setting_arr.img_thumb.image_size.height|escape:html}%>' name='site_config[img_thumb][img_height]' id='img_thumb_height_id' size=4/>						<p>缺省图片<input type='file' name='default_img_thumb' ><input type='hidden' name='site_config[img_thumb][value]'   value='<%{$out.setting_arr.img_thumb.value}%>'><br><%{if $out.setting_arr.img_thumb.value}%><br><img src="<%{$out.setting_arr.img_thumb.preview_img}%>"><%{/if}%></p>	
					</td>
			</tr>			
			<tr>
	   		   <td class="label" valign="top">列表缩略图尺寸</td> 
					<td>
						宽<input value='<%{$out.setting_arr.list_thumb.image_size.width|escape:html}%>' name='site_config[list_thumb][img_width]' id='list_thumb_width_id' size=4/>	
						高<input value='<%{$out.setting_arr.list_thumb.image_size.height|escape:html}%>' name='site_config[list_thumb][img_height]' id='list_thumb_height_id' size=4/>					  <p>缺省图片<input type='file' name='default_list_thumb' ><%{if $out.setting_arr.list_thumb.value}%> <input type='hidden' name='site_config[list_thumb][value]'  value='<%{$out.setting_arr.list_thumb.value}%>'> <br><img src="<%{$out.setting_arr.list_thumb.preview_img}%>"><%{/if}%></p>	
					</td>
			</tr>		
			<tr>
	   		   <td class="label" valign="top">缺省Icon</td> 
					<td>
						<p><input type='file' name='default_icon' ><input type='hidden' name='site_config[default_icon][value]'  value='<%{$out.setting_arr.default_icon.value}%>'> <%{if $out.setting_arr.default_icon.value}%> <br><img src="<%{$out.setting_arr.default_icon.preview_img}%>" width=32 height=32><%{/if}%></p>	
					</td>
			</tr>
			<tr>
	   		   <td class="label" valign="top">页面书签代码</td> 
					<td >
						<%{foreach item=v key=k from=$out.setting_arr.book_mark.list_val}%>
							<p><a href="javascript:void(0);" onclick='del_p(this)'>[-]</a> 书签名称&nbsp;<input value='<%{$v.name|escape:html}%>' name='site_config[book_mark][name][<%{$k}%>]' >&nbsp;&nbsp;&nbsp;书签代码&nbsp;<textarea style='width:300px;height:50px;' name='site_config[book_mark][code][<%{$k}%>]'><%{$v.code}%></textarea></p>
						<%{/foreach}%>                                     
						<p><a href="javascript:void(0);" onclick='add_p(this)'>[+]</a> 书签名称&nbsp;<input name='site_config[book_mark][name][]'  >&nbsp;&nbsp;&nbsp;书签代码&nbsp;<textarea style='width:300px;height:50px;'  name='site_config[book_mark][code][]' ></textarea></p>
						<br>
						<span style='color:#9CACAF' onmouseover='this.style.color="#192E32";' onmouseout='this.style.color="#9CACAF";'>书签名称仅作注记标识用</span>
					</td>
			</tr>	
			
		</table>
		
		<table width="90%" id="system-table" style='display:none;' >
			<tr>
	   		   <td class="label" valign="top">管理员账号</td> 
					<td><input value='<%{$out.setting_arr.admin_name.value|escape:html}%>' name='site_config[admin_name]' /></td>
			</tr>	
			<tr>
	   		   <td class="label" valign="top">管理员密码</td> 
					<td>
					<p>
						<b style="width: 170px; display: inline-block;" class="label">旧密码</b>
						<input type="password" name="site_config[admin_pass][old]" id="admin_old_pass_id"/>	
					</p>
					<p>
						<b style="width: 170px; display: inline-block;" class="label">新密码</b>
						<input type="password" name="site_config[admin_pass][new]" id="admin_new_pass_id"/>	
					</p>
					<p>
						<b style="width: 170px; display: inline-block;" class="label">新密码确认</b>
						<input type="password" id="admin_new_pass_r_id"/>	
					</p>

					</td>
			</tr>	
			<tr>
	  		   <td valign="top" class="label">管理员邮箱 </td> 
				<td><input name="site_config[admin_email]" value="<%{$out.setting_arr.admin_email.value}%>"/></td>
			</tr>

		</table>

		<div class="button-div">
		      <input type="submit" class="button" value=" 保存  " name="submit"/>
		</div>
		</form>
	</div>
</div>
<script>
$(document).ready(function(){
	change_table(['display-tab','system-tab','basic-tab']);	
	$("#form_id").submit(
		function(){
			$("#JT").remove();
			var match = /[0-9]+/;
			var img_thumb_width_val		=	jQuery.trim($("#img_thumb_width_id").val());
			var img_thumb_height_val	=	jQuery.trim($("#img_thumb_height_id").val());
			var list_thumb_width_val	=	jQuery.trim($("#list_thumb_width_id").val());
			var list_thumb_height_val	=	jQuery.trim($("#list_thumb_height_id").val());
			var site_logo_widht_val		=	jQuery.trim($("#site_logo_width_id").val());	
			var site_logo_height_val	=	jQuery.trim($("#site_logo_height_id").val());	

			if(!match.test(img_thumb_width_val)){
				$("#display-tab").click();
				alert('缩略图片宽度必须是数字');
				$("#img_thumb_width_id")[0].focus();
				return false;
			}
			if(!match.test(img_thumb_height_val)){
				$("#display-tab").click();
				alert('缩略图片高度必须是数字');
				$("#img_thumb_height_id")[0].focus();
				return false;
			}
			if(!match.test(list_thumb_width_val)){
				$("#display-tab").click();
				alert('列表图宽度必须是数字');
				$("#list_thumb_width_id")[0].focus();
				return false;
			}
			if(!match.test(list_thumb_height_val)){
				$("#display-tab").click();
				alert('列表图高度必须是数字');
				$("#list_thumb_height_id")[0].focus();
				return false;
			}
			if(!match.test(site_logo_widht_val)){
				$("#basic-tab").click();
				alert('logo图片宽度必须是数字');
				$("#site_logo_width_id")[0].focus();
				return false;
			}	
			if(!match.test(site_logo_height_val)){
				$("#basic-tab").click();
				alert('logo图片高度必须是数字');
				$("#site_logo_height_id")[0].focus();
				return false;
			}
			
			var admin_new_pass		=	$("#admin_new_pass_id");
			if(jQuery.trim(admin_new_pass.val())){
				var admin_old_pass	=	$("#admin_old_pass_id");
				if(!admin_old_pass.val()){
					$("#system-tab").click();
					alert('请填写管理员旧密码');
					admin_old_pass[0].focus();
					return false;
				}
				if(admin_new_pass.val().length<6){
					$("#system-tab").click();
					alert('管理员密码不能小于6位');
					admin_new_pass[0].focus();
					return false;
				}	
				var admin_new_pass_r		=	$("#admin_new_pass_r_id");
				if(jQuery.trim(admin_new_pass_r.val())!=jQuery.trim(admin_new_pass.val())){
					$("#system-tab").click();
					alert('请再次确认您的密码');
					admin_new_pass[0].focus();
					return false;
				}

			}

		}
	);

});


function add_p(obj)
{
	var td_obj		=	$(obj).parent().parent();
	var html			=	"<p>"+$(obj).parent().html().replace(/add_p/g,"del_p")+"</p>";
	html				=	html.replace(/\[\+\]/,"[-]");
	$(html).appendTo(td_obj);	
}
function del_p(obj)
{
	$(obj).parent().remove();
}


</script>


</body>
</html>


