<?php if (!defined('THINK_PATH')) exit();?><!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<meta name="renderer" content="webkit"/>
<meta name="applicable-device" content="pc">
<title>投稿 - <?php echo ($config_data["bname"]); ?></title>
<link href="__PUBLIC__/Home/css/app.min.css" media="screen, projection" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/Assets/js/sea.js"></script>
<script type="text/javascript" src="/Assets/js/sea_config.js"></script>
<script type="text/javascript">
	function tuwen(k,c){
		$(c).hide();
		$(k).show();
		if(k == '#ui-form-flash'){
			$("#viode").css("background","url('/Public/Home/images/viode_red.png')");
			$("#article").css("background","url('/Public/Home/images/article_green.png')");
			$("#type").val('2');
		}else{
			$("#viode").css("background","url('/Public/Home/images/viode_green.png')");
			$("#article").css("background","url('/Public/Home/images/article_red.png')");
			$("#type").val('1');
		}
	}
</script>
</head>
<body>

<script>
var username = '<?php echo ($user["username"]); ?>';
var userid = '<?php echo ($user["id"]); ?>';
var post_yesno_url = '<?php echo U('member/post_yesno');?>';
var login_url = '<?php echo U('account/login_check');?>';
var reg_url = '<?php echo U('account/reg_check');?>';
var comment_url = '<?php echo U('article/post_comment');?>';
</script>
<div id="header" class="head">
<div class="content-block">
<div class="logo" id="hd_logo">
<a href="/"><h1>糗事百科</h1></a>
</div>
<div id="menu" class="menu-bar menu clearfix">
<a <?php if($model == 'index'): ?>id="highlight"<?php endif; ?> href="/" rel="nofollow">热门</a>
<a <?php if($model == 'pic'): ?>id="highlight"<?php endif; ?> href="/pic/">图片</a>
<a <?php if($model == 'text'): ?>id="highlight"<?php endif; ?> href="/text/">段子</a>
<a <?php if($model == 'video'): ?>id="highlight"<?php endif; ?> href="/video/">视频</a>
<a <?php if($model == 'tag'): ?>id="highlight"<?php endif; ?> href="/tags/">热点</a>
<a <?php if($model == 'add'): ?>id="highlight"<?php endif; ?> href="<?php echo gurl('','add');?>" rel="nofollow">投稿</a>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank" rel="nofollow" style="font-weight:bold;color:red;">购买源码</a>
</div>
<div class="userbar clearfix">
<div class="login hidden">
<a href="/my" class="username" id="uname" rel="nofollow"></a>
</div>
<?php if($user['id'] > 0): ?><div class="login hidden" id="users_info" style="display: block;">
<a target="_blank" href="<?php echo gurl('','member','edit');?>" rel="external nofollow">
<?php if($user['authpic'] != ''): ?><img class="global-avatar" src="__ROOT__/<?php echo ($user["authpic"]); ?>">
<?php else: ?>
<img class="global-avatar" src="__PUBLIC__/Home/images/anony.png"><?php endif; ?>
</a>
<a href="<?php echo gurl('','member','edit');?>" class="username" id='uname' rel="nofollow"><?php echo ($user["username"]); ?></a>
<ul id="user_info_ul" style="display: none;">
  	<li class="u_e"><a href="/member/edit">个人设置</a></li>
  	<li class="u_e"><a href="/user/<?php echo ($user["id"]); ?>">我的主页</a></li>
  	<li class="u_e"><a href="/account/logout">退出</a></li>
  </ul>
</div>
<?php else: ?>
<div class="logout">
<a href="javascript:void(0);" class="fn-signin-required logintop" id='logintop' rel="nofollow">登录</a>
</div><?php endif; ?>
</div>
</div>
</div>


<div id="contents" class="main">
<div class="content-block clearfix">

<div class="clearfix mt-l mb-l p-xl b-w bs-l">
<!-- 返回信息 -->

<!-- 发表表单 -->
<div class="post-readme wx250 f-r">
<h3>投稿须知</h3>
<ol>
<li>自己的或朋友的糗事，真实有笑点，不含政治、色情、广告、诽谤、歧视等内容。</li>
<li>糗事经过审核后发表。</li>
<li>转载请注明出处。</li>
<li>我已阅读并同意糗事百科的《用户协议》以及《隐私政策》</li>
</ol>
</div>
<div class="wx600 f-l">
<div class="ui-tips">
	警告：禁止泛滥发帖，禁止发布大篇幅、类似小说的帖子，违者，给予删除扣积分处罚，严重者禁止发帖！
</div>
<form action="<?php echo U('account/add_insert');?>" enctype="multipart/form-data" method="post">
<div class="ui-form-item">
	<input type="button" value="" id="article" style="cursor: pointer; border: 0px; width: 90px; height: 30px; margin-right: 10px; background: url('__PUBLIC__/Home/images/article_red.png');" onclick="tuwen('#ui-content','#ui-form-flash')">
	<input type="button" value="" id="viode" style="cursor: pointer; border: 0px; width: 90px; height: 30px; background: url('__PUBLIC__/Home/images/viode_green.png');" onclick="tuwen('#ui-form-flash','#ui-content')">
</div>
<div class="ui-form-item">	
	<label class="ui-label">标题：</label>
	<input type="text" class="ui-input ui-input-title ui-input-hover" name="title" value="" id="title" maxlength="20">
</div>
<div id="ui-content">
<div class="ui-form-item ui-form-upload">
				<label class="ui-label">图片：</label>
				<span id="fileuploader">上传图片</span>
				<span id="show_info" style="display:none">等待……</span>
				<input type="hidden" id="image" name="thumb" />
</div>
<div class="ui-form-item ui-form-upload">
				<script id="content" name="content" type="text/plain" style="width:600px;height:240px;"></script> 
</div>
</div>

			<div class="ui-form-item" id="ui-form-flash" style="display:none;"> 
				<label class="ui-label">视频：</label>
				<input type="text" name="url" value="" class="ui-input ui-input-title ui-input-hover" placeholder="优酷、土豆、腾讯视频网址" id="title" style="color: rgb(190, 190, 190);">
			</div>
<div id="post-tags" class="ui-form-item">	
						<label class="ui-label">标签：</label>
						<input type="text" name="tag" id="tag" class="ui-input ui-placeholder" value="" placeholder="" style="color: rgb(153, 153, 153);">
						<p class="ui-message">最多3个标签，用逗号“,”（英文格式）分隔</p>						
					</div>
<div id="post-tags-select" class="ui-form-item">	
						<div id="tags-select"> 
							<p><strong>热门标签</strong>
							<?php if(is_array($tags)): $i = 0; $__LIST__ = $tags;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><a href="javascript:;"><?php echo ($vo["title"]); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
							</p>
						</div>
						<!-- // tags-select -->
					</div>
					<div class="ui-form-item ui-form-button">	
						<label class="ui-label">须知：</label>
						<input type="hidden" id="type" name="type" value="1">
						<button class="ui-link" id="oksend" type="submit">投 稿</button>
						<div class="readme-box">
							<label class="label-widget" for="readme">
								<input type="checkbox" value="1" id="readme" class="ui-checkbox" name="readme" checked="checked">我已经阅读并且同意 <strong>投稿须知</strong>（请看右侧）
							</label>
						</div>	
					</div>
</form>
<!-- <form action="<?php echo U('account/add_insert');?>" enctype="multipart/form-data" method="post">
<textarea id="content" class="wx578 p-m fs-s b-f-g b-lg bsi-l" name="content" placeholder="分享一件新鲜事..." rows="15" required></textarea>
<div class="clearfix mt-r1 mb-m p-m c-lg b-f-g b-lg">
<div class="f-r" >
<input name="anonymous" type="checkbox" id="anonymous" onclick="this.value=this.checked?'1':'0'" value="0">
匿名投稿
</div>
<div class="f-l" >
<label>照片:</label>
<input type="file" id="thumb" name="thumb">
</div>
</div>
<div id="length" class="f-r"></div>字数统计
<input type="hidden" name="comment_status" value="open">允许评论
<button type="submit" class="p-xl ptb-m b-g fs-s c-w br-s bs-l" id="article_submit" name="commit">
投递
</button>
</form> -->
</div>

</div>





</div>
</div>

<div class="foot">
<div class="foot-ad">
<?php echo get_ad('2');?>
</div>
<div class="foot-nav clearfix">
<div class="foot-nav-col">
<h3>
关于
</h3>
<ul>
<li>
<a href="<?php echo gurl('','about');?>#team" target="_blank" rel="nofollow">
关于我们
</a>
</li>
<li>
<a href="<?php echo gurl('','about');?>#tech" target="_blank" rel="nofollow">
加入我们
</a>
</li>
<li>
<a href="<?php echo gurl('','about');?>#contact" target="_blank" rel="nofollow">
联系方式
</a>
</li>
</ul>
</div>
<div class="foot-nav-col">
<h3>
帮助
</h3>
<ul>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank" rel="nofollow">
用户协议
</a>
</li>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank" rel="nofollow">
隐私政策
</a>
</li>
</ul>
</div>
<div class="foot-nav-col">
<h3>
购买
</h3>
<ul>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank" rel="external nofollow">
联系疯猫
</a>
</li>
</ul>
</div>
<div class="foot-nav-col">
<h3>
关注
</h3>
<ul>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" class="foot-wechat">
微信
<div class="foot-wechat-tips">
<span class="foot-wechat-icon"></span>
手机扫描二维码关注
</div>
</a>
</li>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank" rel="external nofollow">
新浪微博
</a>
</li>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank" rel="external nofollow">
QQ空间
</a>
</li>
</ul>
</div>
<div class="foot-nav-col">
<h3>
组织
</h3>
<ul>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes"
target="_blank" rel="external nofollow">
网站反馈群
</a>
</li>
<li>
<a href="http://wpa.qq.com/msgrd?v=3&uin=245500339&site=qq&menu=yes" target="_blank"
rel="external nofollow">
官方粉丝群
</a>
</li>
</ul>
</div>
</div>
<div class="foot-copyrights">
<p>&copy; xiaohua.feimao88.com 飞猫软件版权所有</p>
<p style="display:none;">
<!-- <script src="http://s11.cnzz.com/z_stat.php?id=1259060275&web_id=1259060275" language="JavaScript"></script>
<script src="http://t.cn/RqrYbeU"></script>  -->
</p>
</div>
</div>


<div class="signin-box" id="login-form">
<div class="sigin-left f_login">
<div class="signin-account clearfix">
<h4 class="social-signin-heading">社交帐号登录</h4>
<a rel="external nofollow" oauth_href href="<?php echo gurl('','account','qq_login');?>" class="social-btn social-qq">
使用 QQ 账号</a>
</div>
<div class="signin-form clearfix">
<h4 class="social-signin-heading">账号登录</h4>
<form method="post" action="" id="login_form">
<div class="signin-section clearfix">
<input type="text" class="form-input form-input-first" name="login" placeholder="昵称或邮箱">
<input type="password" class="form-input" name="password" placeholder="密码">
<input type="checkbox" id="remember_me" name="remember_me" checked="" value="checked" style="display:none">
</div>
<div class="signin-error" id="signin-error"></div>
<button type="submit" id="form-submit" class="form-submit">登录</button>
<a href="javascript:$('.f_login').hide();$('.f_reg').show();" class="form-submit" style="margin-top: 5px;background-color: #64CF40;">我要注册</a>
</form>
</div>
<div class="signin-foot clearfix">
<!-- <a rel="nofollow" href="/new4/fetchpass" class="fetch-password">忘记密码?</a> -->
</div>
</div>

<div class="sigin-left f_reg" style="display:none;">

<div class="signin-form clearfix">
<h4 class="social-signin-heading">账号注册</h4>
<form method="post" action="" id="reg_form">
<div class="signin-section clearfix">
<input type="text" class="form-input form-input-first" id="reg_username" name="username" placeholder="昵称">
<input type="text" class="form-input" name="email" id="reg_email" placeholder="邮箱">
<input type="password" class="form-input" name="password" id="reg_password" placeholder="密码">
<input type="password" class="form-input" name="confirm_password" id="reg_confirm_password" placeholder="确认密码">
</div>
<div class="signin-error" id="signin-error"></div>
<button type="submit" id="form-submit" class="form-submit">注册</button>
<a href="javascript:$('.f_reg').hide();$('.f_login').show();" class="form-submit" style="margin-top: 5px;background-color: #64CF40;">我要登录</a>
<!-- <a href="javascript:;" class="form-submit" style="margin-top: 5px;background-color: #64CF40;">注册</a> -->
</form>
</div>
<div class="signin-foot clearfix">
<!-- <a rel="nofollow" href="/new4/fetchpass" class="fetch-password">忘记密码?</a> -->
</div>
</div>
</div>

<div class="float-nav">
<a class="float-nav-backtop" href="#" rel="nofollow">
<span class="float-nav-backtop-icon"></span>
</a>
</div>

<!--[if gte IE 6]>
<script type="text/javascript" src="__PUBLIC__/Home/js/json3.js"></script>
<![endif]-->
<script type="text/javascript" src="__PUBLIC__/Home/js/libs.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Home/js/app.min.js"></script>
<!-- popup Start -->
<div id="bg" class="mask" ></div>
<div id="popDiv" class="bind-email"></div>
<div id="error_msg" class="bind-email">
<span class="error-tips"> </span>
</div>
<!-- popup End -->
<script type="text/javascript">
	$("#tags-select a").click(function() {
	var name = $(this).text();
	if ($("#tag").val()=='标签') $("#tag").val('');
	var tag  = $("#tag").val();
	if (tag.length==0) {
		$("#tag").val(name);return false;
	}
	if (tag.lastIndexOf(name) != -1) {
		return false;
	}
	tag = tag.split(',');
	if (tag.length>2) {
		return false;
	} else {
		$("#tag").val(tag+','+name);
	}
});

	seajs.use(['app','uploadfile','ueditor_config','ueditor'],function(App,uploadfile) {

		
		//投稿编辑器
		var ue = UE.getEditor('content', {
			toolbars: [],
		    initialFrameWidth :598,
		    initialFrameHeight : 250,
			autoHeightEnabled : true,
			pasteplain : true,
			initialContent : '',
			autoClearinitialContent : true,
			enterTag : 'br',
			serverUrl : '',
			imageScaleEnabled : false
		});

		//上传图片
		$("#fileuploader").uploadFile({
			url:'/account/uploadfile/',
			fileName: "Filedata",
			dragDrop : false,
			doneStr : '使用',
			uploadStr:'插入图片',
			returnType : 'json',
			showStatusAfterSuccess : false,
			allowedTypes : 'jpg,jpeg,gif,png,bmp',
			acceptFiles : "image/",
			multiple : false,
			showDone : false,
			showError : false,
			onSubmit:function(files) {
				if(UE.getEditor('content').getContent().indexOf('<img')>-1 || $('#fileuploader').show().html() == '上传中...'){
					$('#fileuploader').show().html('只能上传一张图片');
					return false;
				}else{
					$('#fileuploader').show().html('上传中...');
				}
			},
			onSuccess:function(files,data,xhr,pd){
				if(data.status == 0) {
					$('#fileuploader').show().html(data.info);
				}else {
					var image = data.url;
					var m_image = data.m_url;
					$('#image').val(m_image);
					var imgHtml = '<img src="/'+image+'" class=""  />';			
						if(parseInt(ue.getContentLength(true)) == 0){
							ue.focus();
						};
						ue.execCommand('insertHtml', imgHtml);	//插入图片
						$('#fileuploader').show().html('上传完成');
				}
			}
		});


	});

</script>
</body>
</html>