<?php include $this->admin_tpl('meta');?>
<title>系统设置 - YzmCMS内容管理系统</title>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 系统设置 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
	<form class="form form-horizontal" method="post" action="" onsubmit="return check_all(this)">
		<div id="tab_system" class="HuiTab">
			<div class="tabBar cl"><span>基本设置</span><span>核心设置</span><span>附加设置</span><span>安全设置</span><span>邮箱设置</span></div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点名称：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" placeholder="站点名称一般不超过80个字符" name="site_name" value="<?php echo $data["site_name"];?>" class="input-text" style="width:50%">
						<span class="yzm-explain">站点名称一般不超过80个字符</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点根网址：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" placeholder="格式如：http://www.yzmcms.com/" name="site_url" value="<?php echo $data["site_url"];?>" class="input-text" style="width:50%">
						<span class="yzm-explain">格式如：http://www.yzmcms.com/，以 “/” 结尾</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><!-- <span class="c-red">*</span> -->站点Logo：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input class="input-text uploadfile" type="text" name="site_logo"  value="<?php echo $data["site_logo"];?>"  onmouseover="yzm_img_preview('site_logo', this.value)" onmouseout="layer.closeAll();" id="site_logo" style="width:370px" >
						<a href="javascript:;" onclick="yzm_upload_att('<?php echo U('attachment/api/upload_box', array('module'=>ROUTE_M, 'pid'=>'site_logo'));?>')" class="btn btn-primary radius upload-btn"><i class="yzm-iconfont yzm-iconshangchuan"></i> 浏览文件</a>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">站点关键词：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" placeholder="多个关键词用英文逗号“,”隔开" name="site_keyword" value="<?php echo $data["site_keyword"];?>" class="input-text" style="width:50%">
						<span class="yzm-explain">一般不超过100个字符，多个关键词用英文逗号“,”隔开</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">网站版权信息：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" placeholder="&copy; 2014-2099 www.yzmcms.com" name="site_copyright" value="<?php echo $data["site_copyright"];?>" class="input-text" style="width:50%">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">网站备案号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" placeholder="如京ICP备00000000号" name="site_filing" value="<?php echo $data["site_filing"];?>" class="input-text" style="width:50%">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">公安备案号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" placeholder="请输入公安备案号" name="site_security_number" value="<?php echo $data["site_security_number"];?>" class="input-text" style="width:50%">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">站点描述：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="site_description" style="width:80%" placeholder="站点描述一般不超过200个字符"><?php echo $data["site_description"];?></textarea>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">统计代码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="site_code" style="width:80%" placeholder="请填写统计代码"><?php echo $data["site_code"];?></textarea>
					</div>
				</div>
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>WAP端站点：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="site_wap_open" type="radio" <?php echo $data["site_wap_open"]? 'checked' : '' ?> value="1"> 开启</label>
						<label class="label_radio"><input name="site_wap_open" type="radio" <?php echo $data["site_wap_open"]? '' : 'checked' ?> value="0"> 关闭</label>
						<span class="yzm-explain">开启后，移动设备打开搜索页时自动加载手机模板</span>
						<a href="<?php echo SITE_URL;?>index.php?m=mobile" target="_blank" class="ml-10"  title="访问WAP站点"><i class="yzm-iconfont yzm-iconlianjie"></i>访问</a>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>PC端模板风格：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box" style="width:200px;margin-right:13px">
						<select name="site_theme" class="select">
						<option value="">PC端模板风格</option>
						  <?php 
						      foreach($pc_theme_list as $val){
									$str = $data["site_theme"]==$val ? ' selected="selected" ' : '';
									echo '<option value="'.$val.'" '.$str.'>'.$val.'</option>';
							  }
						  ?>
						</select>
						</span>					
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>WAP端模板风格：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box" style="width:200px;margin-right:13px">
						<select name="site_wap_theme" class="select">
						<option value="">WAP端模板风格</option>
						  <?php 
						      foreach($wap_theme_list as $val){
									$str = $data["site_wap_theme"]==$val ? ' selected="selected" ' : '';
									echo '<option value="'.$val.'" '.$str.'>'.$val.'</option>';
							  }
						  ?>
						</select>
						</span>						
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>网站前台URL模式：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<span class="select-box" style="width:418px;">
						<select name="url_mode" class="select">
							<option value="0" <?php if($data['url_mode']=='0') echo 'selected';?>>栏目+内容均相对地址</option>
							<option value="1" <?php if($data['url_mode']=='1') echo 'selected';?>>栏目+内容均绝对地址</option>
							<option value="2" <?php if($data['url_mode']=='2') echo 'selected';?>>栏目相对地址+内容绝对地址</option>
							<option value="3" <?php if($data['url_mode']=='3') echo 'selected';?>>栏目绝对地址+内容相对地址</option>
						</select>
						</span>	
						<span class="yzm-explain">相对地址如“/news/1.html”，绝对地址如“http://www.yzmcms.com/news/1.html”，URL模式修改后，请批量更新URL</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>缩略图默认设置：</label>
					<div class="formControls col-xs-8 col-sm-9">
						宽度：<input type="text" name="thumb_width" value="<?php echo $data["thumb_width"];?>"  class="input-text w_100"> PX &nbsp;&nbsp;&nbsp;
						高度：<input type="text" name="thumb_height" value="<?php echo $data["thumb_height"];?>"  class="input-text w_100"> PX
					</div>
				</div>												
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文件上传最大限制：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="upload_maxsize" placeholder="请输入数字" value="<?php echo $data["upload_maxsize"];?>"  class="input-text w_420"> KB
						<span class="yzm-explain">最大限制不能超过服务器“upload_max_filesize”配置</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>允许上传图片类型：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="upload_image_types" placeholder="如：png|jpg|jpeg|gif" value="<?php echo $data["upload_image_types"];?>"  class="input-text w_420">
						<span class="yzm-explain">多个类型之间用“|”分开</span>
						<a href="http://www.yzmcms.com/dongtai/123.html" target="_blank" style="color:#3b639f;font-size:12px">不在系统白名单时，设置无效？</a>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>允许上传附件类型：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="upload_types" placeholder="如：zip|rar|ppt|doc|xls" value="<?php echo $data["upload_types"];?>"  class="input-text w_420">
						<span class="yzm-explain">多个类型之间用“|”分开</span>
						<a href="http://www.yzmcms.com/dongtai/123.html" target="_blank" style="color:#3b639f;font-size:12px">不在系统白名单时，设置无效？</a>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>站点标题分隔符：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="site_seo_division" value="<?php echo $data["site_seo_division"];?>"  class="input-text w_420">
						<span class="yzm-explain">站点标题如 “新闻_YzmCMS官网”，<br>两个词中间的下划线“_”就是分隔符</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">站点SEO后缀：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="site_seo_suffix" placeholder="如：YzmCMS官方演示站" value="<?php echo $data["site_seo_suffix"];?>"  class="input-text w_420">
						<span class="yzm-explain">站点标题如 “新闻_YzmCMS官网”，后面的词为SEO后缀，为空则根据站点名称生成</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">百度推送token：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="baidu_push_token" placeholder="如：66XJXYDfMKfeeIRM" value="<?php echo $data["baidu_push_token"];?>"  class="input-text w_420">
						<span class="yzm-explain">用于主动推送内容至百度，请到百度平台申请token</span>
					</div>
				</div>		
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>图片水印：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="watermark_enable" type="radio" <?php echo $data["watermark_enable"]? 'checked' : '' ?> value="1"> 开启</label>
						<label class="label_radio"><input name="watermark_enable" type="radio" <?php echo $data["watermark_enable"]? '' : 'checked' ?> value="0"> 关闭</label>
						<span class="yzm-explain">开启后，发布内容时，上传的图片将自动添加水印</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>水印的位置：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input type="radio" value="0" <?php echo $data["watermark_position"]==0 ? 'checked' : '' ?> name="watermark_position">随机</label>
						<label class="label_radio"><input type="radio" value="1" <?php echo $data["watermark_position"]==1 ? 'checked' : '' ?> name="watermark_position">顶部居左</label>
						<label class="label_radio"><input type="radio" value="2" <?php echo $data["watermark_position"]==2 ? 'checked' : '' ?> name="watermark_position">顶部居中</label>
						<label class="label_radio"><input type="radio" value="3" <?php echo $data["watermark_position"]==3 ? 'checked' : '' ?> name="watermark_position">顶部居右</label>
						<label class="label_radio"><input type="radio" value="4" <?php echo $data["watermark_position"]==4 ? 'checked' : '' ?> name="watermark_position">中部居左</label>
						<label class="label_radio"><input type="radio" value="5" <?php echo $data["watermark_position"]==5 ? 'checked' : '' ?> name="watermark_position">中部居中</label>
						<label class="label_radio"><input type="radio" value="6" <?php echo $data["watermark_position"]==6 ? 'checked' : '' ?> name="watermark_position">中部居右</label>
						<label class="label_radio"><input type="radio" value="7" <?php echo $data["watermark_position"]==7 ? 'checked' : '' ?> name="watermark_position">底部居左</label>
						<label class="label_radio"><input type="radio" value="8" <?php echo $data["watermark_position"]==8 ? 'checked' : '' ?> name="watermark_position">底部居中</label>
						<label class="label_radio"><input type="radio" value="9" <?php echo $data["watermark_position"]==9 ? 'checked' : '' ?> name="watermark_position">底部居右</label>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>水印图片名称：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="watermark_name" value="<?php echo $data["watermark_name"];?>"  class="input-text w_420">
						<span class="yzm-explain">请将自定义水印图片上传到<br>“/common/data/water/”目录下</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>添加水印最小宽度：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="watermark_minwidth" value="<?php echo $data["watermark_minwidth"];?>"  class="input-text w_420">
						<span class="yzm-explain">当图片小于这个宽度(px)，将不会添加水印</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>添加水印最小高度：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="watermark_minheight" value="<?php echo $data["watermark_minheight"];?>"  class="input-text w_420">
						<span class="yzm-explain">当图片小于这个高度(px)，将不会添加水印</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>开启内容图片关联：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="att_relation_content" type="radio" <?php echo $data["att_relation_content"]? 'checked' : '' ?> value="1"> 开启</label>
						<label class="label_radio"><input name="att_relation_content" type="radio" <?php echo $data["att_relation_content"]? '' : 'checked' ?> value="0"> 关闭</label>
						<span class="yzm-explain">开启后，删除内容时将同步删除关联的图片</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容关键字替换：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="keyword_link" type="radio" <?php echo $data["keyword_link"]? 'checked' : '' ?> value="1"> 开启</label>
						<label class="label_radio"><input name="keyword_link" type="radio" <?php echo $data["keyword_link"]? '' : 'checked' ?> value="0"> 关闭</label>
						<input type="text" name="keyword_replacenum" value="<?php echo $data["keyword_replacenum"];?>"  class="input-text w_100"> 
						替换次数
						<span class="yzm-explain">0为不限，效率高</span>
					</div>
				</div>	
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容默认点击量：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="content_click_random" type="radio" <?php echo $data["content_click_random"]? 'checked' : '' ?> value="1"> 随机</label>
						<label class="label_radio"><input name="content_click_random" type="radio" <?php echo $data["content_click_random"]? '' : 'checked' ?> value="0"> 不随机</label>
						<span class="yzm-explain">如果选择随机的话，默认内容点击量为<br>50-150之间，不随机则默认点击量为0</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>下载远程图片：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="auto_down_imag" type="radio" <?php echo $data["auto_down_imag"]? 'checked' : '' ?> value="1"> 自动</label>
						<label class="label_radio"><input name="auto_down_imag" type="radio" <?php echo $data["auto_down_imag"]? '' : 'checked' ?> value="0"> 手动</label>
						<span class="yzm-explain">自动模式下复制图片时将自动保存到本站，手动模式需手动在编辑器下点击下载远程图片</span>
					</div>
				</div>		
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">下载远程图片忽略的域名：<br><span style="color:#888;font-size:12px;margin-right:10px;display:inline-block;"><span class="c-red">不需要填写本站域名，</span><br>多个域名用“,”分隔</span></label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="down_ignore_domain" placeholder="匹配到的域名图片将不会被下载，格式如：www.yzmcms.com"><?php echo $data["down_ignore_domain"];?></textarea>
					</div>
				</div>	
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>保存系统错误日志：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="error_log_save" type="radio" <?php echo $data["error_log_save"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="error_log_save" type="radio" <?php echo $data["error_log_save"]? '' : 'checked' ?> value="0"> 否</label>
						<span class="yzm-explain">开启后系统运行中如果出现错误，将会把详细的错误信息保存到cache目录下，方便管理人员维护</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>启用后台管理操作日志：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="admin_log" type="radio" <?php echo $data["admin_log"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="admin_log" type="radio" <?php echo $data["admin_log"]? '' : 'checked' ?> value="0"> 否</label>
						<span class="yzm-explain">开启后管理员的每个操作都会被记录，但同时也将消耗一定的系统资源</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">开启站点留言功能：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input name="is_words" type="radio" <?php echo $data["is_words"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="is_words" type="radio" <?php echo $data["is_words"]? '' : 'checked' ?> value="0"> 否</label>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">是否开启留言验证码：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<label class="label_radio"><input name="words_code" type="radio" <?php echo $data["words_code"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="words_code" type="radio" <?php echo $data["words_code"]? '' : 'checked' ?> value="0"> 否</label>
						<span class="yzm-explain">强烈建议开启验证码功能，可有效拦截垃圾信息</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">是否开启申请友情链接：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input name="is_link" type="radio" <?php echo $data["is_link"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="is_link" type="radio" <?php echo $data["is_link"]? '' : 'checked' ?> value="0"> 否</label>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">是否开启评论验证码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input name="comment_code" type="radio" <?php echo $data["comment_code"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="comment_code" type="radio" <?php echo $data["comment_code"]? '' : 'checked' ?> value="0"> 否</label>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">是否开启评论审核：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input name="comment_check" type="radio" <?php echo $data["comment_check"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="comment_check" type="radio" <?php echo $data["comment_check"]? '' : 'checked' ?> value="0"> 否</label>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">是否允许游客评论：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input name="comment_tourist" type="radio" <?php echo $data["comment_tourist"]? 'checked' : '' ?> value="1"> 是</label>
						<label class="label_radio"><input name="comment_tourist" type="radio" <?php echo $data["comment_tourist"]? '' : 'checked' ?> value="0"> 否</label>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">禁止登录后台的IP列表：<br><span style="color:#888;font-size:12px;margin-right:10px;display:inline-block;">匹配IP段用“*”占位<br>多个IP用“,”分隔</span><br><span style="color:#ff0202;font-size:12px;margin-top:5px;margin-right:10px;display:inline-block;">您的IP：<?php echo self::$ip;?></span></label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="admin_prohibit_ip" placeholder="匹配IP段用“*”占位，如192.168.*.*，多个IP地址请用英文逗号“,”分隔"><?php echo $data["admin_prohibit_ip"];?></textarea>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">前端IP黑名单列表：<br><span style="color:#888;font-size:12px;margin-right:10px;display:inline-block;">匹配IP段用“*”占位<br>多个IP用“,”分隔</span></label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea class="textarea" name="blacklist_ip" placeholder="IP黑名单用户将无法发布站点留言及内容评论"><?php echo $data["blacklist_ip"];?></textarea>
					</div>
				</div>
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">SMTP服务器：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="mail_server" value="<?php echo $data["mail_server"];?>" placeholder="格式如：ssl://smtp.qq.com"  class="input-text" style="width:50%">
						<span class="yzm-explain">发送邮箱的smtp地址，格式如：ssl://smtp.qq.com</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">SMTP 端口：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" class="input-text" name="mail_port" value="<?php echo $data["mail_port"];?>" style="width:100px">
						<span class="yzm-explain">大部分默认为465，也有极少数为25</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">发件人邮箱：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" name="mail_from" value="<?php echo $data["mail_from"];?>" style="width:50%">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">AUTH LOGIN验证：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<label class="label_radio"><input name="mail_auth" type="radio" <?php echo $data["mail_auth"]? 'checked' : '' ?> value="1"> 开启</label>
						<label class="label_radio"><input name="mail_auth" type="radio" <?php echo $data["mail_auth"]? '' : 'checked' ?> value="0"> 关闭</label>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">验证用户名：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="text" name="mail_user" value="<?php echo $data["mail_user"];?>"  class="input-text" style="width:50%">
						<span class="yzm-explain">一般为你的邮箱账号，与“发件人邮箱”相同</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">验证密码：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="password" name="mail_pass" value="<?php echo $data["mail_pass"];?>" readonly onfocus="this.removeAttribute('readonly');" class="input-text" style="width:50%">
						<span class="yzm-explain">验证密码一般是单独的邮箱授权码，并非邮箱账号的登录密码</span>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">邮件测试：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="email" name="mail_to" value=""  class="input-text" style="width:50%">
						<input type="button" class="btn btn-primary radius" value="测试发送" onclick="test_mail()">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">站点默认邮箱：</label>
					<div class="formControls col-xs-8 col-sm-9 yzm-explain-box">
						<input type="email" name="mail_inbox" value="<?php echo $data["mail_inbox"];?>"  class="input-text" style="width:50%">
						<span class="yzm-explain">用于接收“站点留言”等消息通知</span>
					</div>
				</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input type="submit" class="btn btn-primary radius" name="dosubmit" value="&nbsp;&nbsp;保 存&nbsp;&nbsp;">
				<input type="reset" class="btn btn-default radius" value="&nbsp;&nbsp;重 置&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>

<?php include $this->admin_tpl('footer');?>

<script type="text/javascript">
function check_all(obj){
	var reg = /^http(.+)\/$/;
	if($("input[name='site_name']").val()==''){
		layer.msg('站点名称不能为空！', {icon:2});
		return false;
	}
	if(!reg.test($("input[name='site_url']").val())){
		layer.alert('站点根网址格式为：http://www.yzmcms.com/，请以“/”结尾！', {icon:2});
		return false;
	}
	if($("select[name='site_theme']").val()=='' || $("select[name='site_wap_theme']").val()==''){
		layer.msg('请选择模板风格！', {icon:2});
		return false;
	}
	if(isNaN($("input[name='thumb_width']").val()) || isNaN($("input[name='thumb_height']").val())){
		layer.msg('缩略图默认设置只能为数字！', {icon:2});
		return false;
	}
	if($("input[name='upload_maxsize']").val()=='' || isNaN($("input[name='upload_maxsize']").val())){
		layer.msg('文件上传最大限制只能为数字！', {icon:2});
		return false;
	}
	if($("input[name='upload_image_types']").val()==''){
		layer.msg('允许上传图片类型不能为空！', {icon:2});
		return false;
	}
	if($("input[name='upload_types']").val()==''){
		layer.msg('允许上传附件类型不能为空！', {icon:2});
		return false;
	}
	if($("input[name='site_seo_division']").val()==''){
		layer.msg('站点标题分隔符不能为空！', {icon:2});
		return false;
	}
	if($("input[name='watermark_name']").val()==''){
		layer.msg('水印图片名称不能为空！', {icon:2});
		return false;
	}
	if(isNaN($("input[name='watermark_minwidth']").val()) || $("input[name='watermark_minwidth']").val()<10){
		layer.msg('添加水印最小宽度只能为数字且不能小于10！', {icon:2});
		return false;
	}
	if(isNaN($("input[name='watermark_minheight']").val()) || $("input[name='watermark_minheight']").val()<10){
		layer.msg('添加水印最小高度只能为数字且不能小于10！', {icon:2});
		return false;
	}
	if(isNaN($("input[name='keyword_replacenum']").val()) || $("input[name='keyword_replacenum']").val()<0){
		layer.msg('关键字替换次数只能为数字且不能小于0！', {icon:2});
		return false;
	}
	layer.msg('正在保存数据……', { icon: 16, shade: 0.21, time:false });
	$.ajax({
		type: 'POST',
		url: '<?php echo U('save');?>', 
		data: $(obj).serialize(),
		dataType: "json", 
        success: function (msg) {
			if(msg.status){
				layer.msg(msg.message, {icon:1, time:2000});       
		    }else{
				layer.msg(msg.message, {icon:2});
			}
        },
        error: function (xhr) {
            if(xhr.status != 200){
                layer.alert('保存失败，xhr状态码：'+xhr.status);
                return false;
            }
        }
	})	
	return false;	
}

function test_mail() {
	var mail_server = $("input[name='mail_server']").val();
	var mail_port = $("input[name='mail_port']").val();
	var mail_from = $("input[name='mail_from']").val();
	var mail_auth = $("input[name='mail_auth']").val();
	var mail_user = $("input[name='mail_user']").val();
	var mail_pass = $("input[name='mail_pass']").val();
	var mail_to = $("input[name='mail_to']").val();
	if(mail_to == ''){
		layer.msg('请输入邮件测试地址！', {icon:2});
		return false;
	}
	layer.msg('正在测试发送……', { icon: 16, shade: 0.21, time:false });
	$.ajax({
		type: 'POST',
		url: '<?php echo U('public_test_mail');?>', 
		data: {"mail_server":mail_server, "mail_port":mail_port, "mail_from":mail_from, "mail_auth":mail_auth, "mail_user":mail_user, "mail_pass":mail_pass, "mail_to":mail_to},
		dataType: "json", 
        success: function (msg) {
			if(msg.status){
				layer.msg(msg.message, {icon:1});       
		    }else{
				layer.msg(msg.message, {icon:2});
			}
        },
        error: function (xhr) {
            if(xhr.status != 200){
                layer.alert('发送邮件失败！XHR状态码：'+xhr.status,  {icon:2,title:"操作提示"});
                return false;
            }
        }
	})
}

$(function(){
	$.Huitab("#tab_system .tabBar span","#tab_system .tabCon","current","click","<?php echo isset($_GET['tab']) ? intval($_GET['tab']) : '0'?>");
});
</script>

</body>
</html>