<!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>
<tpl> include file ='../head.config.html' </tpl>
<script language="javascript" src="<tpl> $Site_Url </tpl>/js/jquery/jquery.blockUI.js"></script>
<link href="<tpl> $template_dir </tpl>/home/css/<tpl> $space_array.templates </tpl>_style.css" rel="stylesheet" type="text/css" />
<tpl> if $type eq '1' </tpl>
<script language="javascript">
function checkProduct() {
	var num = 0;
	$('#blog_form input[@type=checkbox]').each(function(){
		if (this.checked) {
			num = 1;
		}
	});
	if (num == 0) {
		$("#productErr").css("color","red");
		$("#productErr").text('<tpl> $langProductErr </tpl>');
		return false;
	} else {
		$("#productErr").css("display","none");
	}
}
<tpl> if $type eq '1' </tpl>
$().ready(function () {
	$("#product").load("member.php", {"action" : "product_list","id" : "<tpl> $blog_array.blogid </tpl>"});	 	
});
<tpl> /if </tpl>
</script>
<tpl> /if </tpl>
<script language="javascript">
$(function(){
	$("#blog_form").validate({
		errorClass: "wrong",
		rules: {
			txtTitle: {required:true},
			txtSubject: {required:true}
		},
		messages: {
			txtTitle: {required: "<tpl> $langSpaceBlogTitleCheck </tpl>"},
			txtSubject: {required: "<tpl> $langSpaceBlogContentCheck </tpl>"}
		}
	});
});
</script>
</head><body>
<tpl> include file ='../top.html' </tpl>

<!--公共部分-->
<tpl> include file="../public.html" </tpl>

<div>
	<div class="block style4">
	<table width="100%">
		<tr>
			<td align="right">
				<tpl> if $type eq '1' </tpl>
					<img src="<tpl> $template_dir </tpl>/images/list.gif" border="0" title="<tpl> $langSpaceBackCommendList </tpl>" style=" vertical-align:middle"/> <a href="member.php?action=blog_commend"><tpl> $langSpaceBackCommendList </tpl></a>
				<tpl> else </tpl>
					<img src="<tpl> $template_dir </tpl>/images/list.gif" border="0" title="<tpl> $langSpaceBackBlogList </tpl>" style=" vertical-align:middle"/> <a href="member.php?action=blog_list"  style=" vertical-align:middle"><tpl> $langSpaceBackBlogList </tpl></a>
				<tpl> /if </tpl>
		  </td>
		</tr>
	</table>
	</div>
	<div class="block style4">
	<form name="blog_form" id="blog_form" action="<tpl> $actions </tpl>" method="POST" <tpl> if $type eq '1' </tpl> onsubmit="return checkProduct()" <tpl> /if </tpl> >
	<input type="hidden" name="blogid" value="<tpl> $blog_array.blogid </tpl>" />
	<input type="hidden" name="type" value="<tpl> $type </tpl>" />
	<table width="100%" cellpadding="3" cellspacing="3">
	<tr>
		<td><tpl> $langSpaceBlogTitle </tpl></td>
		<td>	
			<input type="text" name="txtTitle" id="txtTitle" value="<tpl> $blog_array.title </tpl>" size="40" />
			<tpl> if $type neq '1' </tpl>
				<select name="category" id="category">
					<option value="0"><tpl> $langSelectCategory </tpl></option>
					<tpl> section name=c loop=$category_array </tpl>
						<option value="<tpl> $category_array[c].caid </tpl>" <tpl> if $category_array[c].caid eq $blog_array.category </tpl> selected <tpl> /if </tpl> ><tpl> $category_array[c].name </tpl></option>
					<tpl> /section </tpl>
				</select><a href="member.php?action=category_add">+<tpl> $langCreateCategory </tpl>	</a>
			<tpl> /if </tpl>	
			<label style="display:none" for="txtTitle" class="wrong" metaDone="true" generated="true"></label>	
		</td>
	</tr>
	<tr>
		<td valign="top"><tpl> $langSpaceBlogContent </tpl></td>
		<td>
			<tpl>php</tpl>
			include("../../classes/resource/fckeditor/fckeditor.php") ;
			$oFCKeditor = new FCKeditor('txtSubject') ;
			$oFCKeditor->BasePath	= '../../classes/resource/fckeditor/' ;
			$oFCKeditor->ToolbarSet = 'Simple';
			$oFCKeditor->Width	= 485 ;
			$oFCKeditor->Height	= 330 ;
			$oFCKeditor->Value		= $this->_tpl_vars['blog_array']['subject'] ;
			$oFCKeditor->Create() ;
			<tpl>/php</tpl>	
			<label style="display:none" for="txtSubject" class="wrong" metaDone="true" generated="true"></label>				
		</td>
	</tr>
	<tpl> if $type eq '1' </tpl>
	<tr>
		<td valign="top"><tpl> $langSpaceCommendProduct </tpl></td>
		<td>
			<table width="100%">
				<tr>
					<td>
						<div id="product"><img src="<tpl> $template_dir </tpl>/images/loading.gif" /></div>
						<div><label id="productErr"></label></div>	
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tpl> /if </tpl>	
	<tr>
	<td></td>
		<td colspan="2">
			<input type="submit" value="<tpl> $langSpaceSubmit </tpl>"  class="rb1-12"  />
			<input type="reset" value="<tpl> $langSpaceReset </tpl>"  class="rb1-12" /></td>
	</tr>
	</table>
	</div>
	</form>
</div>
<tpl> include file ='../../../../html/footer.html' </tpl>
</div>
</div>
</div>
</body>
</html>