{template 'phpcms','header'}
<script type="text/javascript">
// 表单提交检测
function doCheck(){

	// 检测表单的有效性
	// 如：标题不能为空，内容不能为空，等等....
	if ($('catid').value=='0'){
		alert('指定的栏目不允许添加文章！只允许在其子栏目中添加文章。');
		$('catid').focus();
		return false;
	}
	if ($('title').value=='') {
		alert('对不起，标题不能为空！');
        $('title').focus();
		return false;
	}
	{if $MOD['check_code']}
	if ($('checkcodestr').value=='') {
		alert("请输入验证码!");
		$('checkcodestr').focus();
		return false;
	}
	{/if}

}
</script>


<div class="memberborder_1">
<div class="memberborder_2">
<h1>欢迎投稿</h1>
<form name="myform" id="myform" method="post" action="{$CHA[linkurl]}contribute.php" onsubmit="return doCheck();">
<table cellpadding="2" cellspacing="1" class="righttable">
<tbody>
    <tr> 
      <td class="td_right" width="15%"> <strong>所属栏目</strong> </td>
      <td class="td_left" width="85%">{$category_select}<font color='red'>*</font></td>
    </tr>

    <tr> 
      <td class="td_right"><strong>标题</strong></td>
      <td class="td_left">{$type_select} <input name="title" type="text" id="title" size="50"><font color="#FF0000">*</font></td>
    </tr>
    <tr> 
      <td class="td_right"><strong>关键词</strong> </td>
      <td class="td_left"><input name="keywords" type="text" id="keywords" size="50"> 多个关键词之间请用半角逗号“,”隔开</td>
    </tr>
    <tr> 
      <td class="td_right"><strong>作者</strong> </td>
      <td class="td_left"><input name="author" type="text" id="author" size="50" value="{$_username}"></td>
    </tr>
    <tr> 
      <td class="td_right"><strong>来源</strong> </td>
      <td class="td_left"><input name="copyfrom" type="text" id="copyfrom" size="50" value="{$PHPCMS['sitename']}|{$PHPCMS['siteurl']}">  格式：“网站名称|网站地址”
	</td>
    </tr>
    <tr> 
      <td class="td_right"><strong>内容简介</strong> </td>
      <td class="td_left"><textarea name="introduce" cols="70" rows="5"></textarea></td>
    </tr>
    <tr> 
      <td class="td_right"><strong>内容</strong> </td>
      <td class="td_left">
		<textarea name="content" id="content" cols="100" rows="25"></textarea>
		{$editor("content",$MOD['editor_mode'],$MOD['editor_width'],$MOD['editor_height'])}
   </td>
    </tr>
    <tr> 
      <td class="td_right"><strong>标题图片</strong> </td>
      <td class="td_left"><input name="thumb" type="text" id="thumb" size="50"> <input type="button" value="上传图片" onclick="javascript:openwinx('{PHPCMS_PATH}uppic.php?channelid={$channelid}&uploadtext=thumb&type=thumb&width={$MOD[thumb_width]}&height={$MOD[thumb_height]}','upload','360','300')"></td>
    </tr>
    {$fields}
{if $MOD['check_code']}
    <tr> 
      <td class="td_right"><strong>验证码</strong></td>
      <td class="td_left"><input name="checkcodestr" type="text" size="15" id="checkcodestr">
	  <img src="{PHPCMS_PATH}checkcode.php" id="checkcode" onclick="this.src='{PHPCMS_PATH}checkcode.php?id='+Math.random()*5;" style="cursor:pointer;" alt="验证码,看不清楚?请点击刷新验证码" align="absmiddle"/></td>
    </tr>
{/if}
	<tr> 
      <td class="td_right"><strong>文章状态</strong></td>
      <td class="td_left">
		<input name="status" type="radio" value="3" {if $status==3}checked{/if} {if $disabled}disabled{/if}> 已通过
		<input name="status" type="radio" value="1" {if !isset($status) || $status==1}checked{/if} > 待审核
		<input name="status" type="radio" value="0" {if isset($status) && $status==0}checked{/if}>草稿
	</td>
    </tr>
    <tr> 
      <td class="td_center" colspan="2">
	  <input type="submit" name="dosubmit" value=" 发表 "> 
	  <input type="reset" name="reset" value=" 重置 "></td>
    </tr>
  </tbody>
</table>
</form>
</div>
</div>
{template 'phpcms','footer'}