<?php if(!defined('IN_SDCMS')) exit;?>
<script>
$(function()
{
	{if sdcms[bbs_post_code]==1}
	$("#verify").click(function(){
		$(this).attr("src",$(this).attr("src")+"{iif(sdcms[url_mode]==1,"&","?")}rnd="+Math.round());
		$("#code").val("");
	});
	{/if}
	$(".ui-form").form(
	{
		type:2,
		align:'center',
		result:function(form)
		{
			var content=UE.getEditor('content').getContent();
			if(content=='')
			{
				toastr.error('内容不能为空');
				return false;	
			}
			$.ajax(
			{
				type:'post',
				cache:false,
				dataType:'json',
				url:'{THIS_LOCAL}',
				data:$(form).serialize(),
				error:function(e){alert(e.responseText);},
				success:function(d)
				{
					if(d.state=='success')
					{
						sdcms.success(d.msg);
						setTimeout(function(){location.href='{N('bbs','','fid='.$fid.'')}';},1500);
					}
					else
					{
						sdcms.error(d.msg);
					}  
				}
			});
		}
	});
})
</script>