<?php 
	//setting and data
	global $current_user;
	$DXC_options = get_option( 'DX-Contribute-options' );
?>
<link rel="stylesheet" media="all" type="text/css" href="<?php echo plugins_url( 'style.css', __FILE__ ); ?>" />
<?php if( $DXC_options['css'] ) echo '<style type="text/css">'.stripslashes( $DXC_options['css'] ).'</style>'; ?>

<div id="DX-Contribute">

	<p>
		<label for="DXC-title">文章标题：</label>
		<input name="DXC-title" id="DXC-title" class="DXC-input" /><?php echo $asterisk; ?>
		<span class="asterisk">*</span>
                <span id="DXC-title-num">还剩<b><?php echo $DXC_options['title-num']; ?></b>字</span>
		
	</p>
	
	<p>
		<label for="DXC-user">你的大名：</label>
		<input name="DXC-user" id="DXC-user" class="DXC-input" maxlength="40" value="<?php echo $current_user->display_name; ?>" /><span class="asterisk"> *</span>
	</p>	
	
	<p>
		<label for="DXC-email">留下邮箱：</label>
		<input name="DXC-email" id="DXC-email" class="DXC-input" maxlength="40" value="<?php echo $current_user->user_email; ?>" /><span class="asterisk"> *</span>
	</p>
	
	<p>
		<label for="DXC-site">来个外链：</label>
		<input name="DXC-site" id="DXC-site" class="DXC-input" maxlength="40" value="<?php echo $current_user->user_url; ?>" />
	</p>
	
	<?php if( $DXC_options['select-cat']=='on' ): ?>
	<p>
		<label for="DXC-cat">文章分类：</label>
		<?php 
			$args = array(
				'hide_empty' => false,
				'hierarchical' => true,
				'selected' => $DXC_options['category'],
				'id' => 'DXC-cat',
				'name' => 'DXC-cat',
				'exclude' => $DXC_options['exclude-cat']
			);
			wp_dropdown_categories( $args ); 
		?>
	</p>
	<?php endif; ?>
	
	<p>
		<label for="DXC-tags">标签：</label>
		<input name="DXC-tags" id="DXC-tags" class="DXC-input" maxlength="20" />
		<span class="DXC-description">多个用英文逗号分隔</span>
	</p>	
	
	<p>
		<label for="DXC-content">提示：</label><span class="asterisk">在下面编辑器内输入你要投稿的内容，正常人建议选择【可视化模式】编辑</span>
		<?php
			$content = '';
			$editor_id = 'DXC-content';
			$settings = array(
				'textarea_rows' => $DXC_options[ 'textarea-rows' ]
			);
			wp_editor( $content, $editor_id, $settings );
		?>
        <span id="DXC-content-num">字数不能超过<b><?php echo $DXC_options['textarea-num']; ?></b></span>
	<br>
	<script type="text/javascript">
/*【投稿页面】580*90*/
var cpro_id = "u1326347";
</script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>

	<p id="DXC-note">字数最好控制在一万字以内，不然的话可能会上传失败滴。大家有什么意见，在下面留吐槽吧~</p>
	
	<p>
		<input name="DXC-submit" id="DXC-submit" type="button" value="提交给大王"/>
	</p>
	<div style="display:none;color:green;font-style:italic;font-size:14px;font-weight:bold;" id="DXC-loading"></div>
	
	<input type="hidden" name="blog-url" id="blog-url" value="<?php bloginfo('url'); ?>"/>
	<input type="hidden" name="success-message" id="success-message" value="<?php echo $DXC_options[ 'success' ]; ?>"/>

</div>

<script type="text/javascript" src="<?php echo plugins_url( 'contribute.js', __FILE__ ); ?>"></script>