<!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   name="robots" content="noindex, nofollow" />
<meta   http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>{$_threadtitle$} - 话题 - {$_mtagname$} - 群组 - <jcms:site.name/></title>
<script type="text/javascript" src="../_libs/jquery.tools.pack.js"></script>
<script type="text/javascript" src="../_data/jcmsV4.x.js"></script>
<link   type="text/css" rel="stylesheet" href="../_data/jcmsV4.x.css" />


<script type="text/javascript">
var pagesize=10;
var page=thispage();
(function(){
	$(document).ready(function(){
		$.ajax({
			type:		"get",
			dataType:	"json",
			data:		"time="+(new Date().getTime()),
			url:		"view_ajax.aspx?mtagid={$_mtagid$}&oper=ajaxCheckPower",
			error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
			success:	function(data){
				$("#li"+data.ismember).show();
				$("#reply_"+data.istalker).show();
				$("#reply"+data.istalker).show();
				$("#del"+data.ismoderator).show();
				$("#good"+data.ismoderator+"_{$_threadisgood$}").show();
				$("#head"+data.ismoderator+"_{$_threadishead$}").show();
			}
		});
		ajaxList(page);
		
		$('#threadreplyForm').ajaxForm({
			beforeSubmit: JumbotCms.AjaxFormSubmit,
			success :function(data){
				JumbotCms.Eval(data);
			}
		}); 
		$.formValidator.initConfig({onError:function(msg){alert(msg);}});
		$("#txtContent")
			.formValidator({tipid:"tipContent",onshow:"",onfocus:"10-200个字符",oncorrect:"OK"})
			.InputValidator({min:10,max:200,onerror: "10-200个字符,一个汉字=两个字符!"});
		$("#txtCode")
			.formValidator({tipid:"tipCode",onshow:"",onfocus:"4位校验码",oncorrect:"OK"})
			.InputValidator({min:4,max:4,onerror: "4位校验码"});
	});
	//Form验证
	JumbotCms.AjaxFormSubmit=function(item){
		try{
			if(jQuery.formValidator.PageIsValid('1'))
			{
				JumbotCms.Loading.show("正在处理，请稍等...");
				return true;
			}else{
				return false;
			}
		}catch(e){
			return false;
		}
	};
})();
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"view_threadview_ajax.aspx?mtagid={$_mtagid$}&threadid={$_threadid$}&oper=ajaxGetList",
		error:		function(XmlHttpRequest,textStatus, errorThrown){if(XmlHttpRequest.responseText!=""){alert(XmlHttpRequest.responseText);}},
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: false});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function ajaxManage(act, threadid, mtagid){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"ids="+threadid,
		url:		"view_threadmanage_ajax.aspx?mtagid="+mtagid+"&oper=ajaxManage&act="+act+"&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				if(act!="del")
					window.location.reload();
				else
					window.location.href="view_threadlist_default.aspx?mtagid="+mtagid;
				break;
			}
		}
	});
}
function ajaxDelReply(threadreplyid){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+threadreplyid,
		url:		"view_threadmanage_ajax.aspx?mtagid={$_mtagid$}&oper=ajaxDelReply&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxReply(threadreplyid,threadreplyno){
	if(threadreplyid==0){
		$('#spanTitle').html('回复 #0');
		$('#txtReplyId').val('0');
	}else{
		$('#spanTitle').html('回复 #'+threadreplyno);
		$('#txtReplyId').val(threadreplyid);
	}
		$("#txtContent")[0].focus();
}
</script>
<script type="text/javascript" src="../style/mtag/ajax.js"></script>
</head>
<body>
<style>
@import url(../style/member/style.css);
#ucmenu{width:600px;}
</style>
<iframe frameborder="0" scrolling="no" src="../user/index_default.aspx?do=header" width="100%" height="76" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="ifheader"></iframe>
<!--顶部结束,中框架开始-->
<div id="wrap">
	<div id="main">
		<div id="app_sidebar">
			<ul class="app_list" id="default_userapp">
				<li class="currently"><img src="../style/member/ico_home.gif"><a href="../user/index_default.aspx">个人中心首页</a></li>
			</ul>
			<ul class="app_list" id="my_userapp">
				<li class="hr"></li>
				<li><img src="../style/member/ico_contribute.gif"><a href="../user/contribute_default.aspx" target="_blank">我的投稿</a><em></em></li>
				<li><img src="../style/app/message.gif"><a href="../user/pmlist_default.aspx">短信</a><em><a href="../user/pmsend_default.aspx">发送</a></em></li>
				<li><img src="../style/app/friend.gif"><a href="../user/friendlist_default.aspx">好友</a><em><a href="../user/friendadd_default.aspx">添加</a></em></li>
				<li><img src="../style/app/mtag.gif"><a href="index_default.aspx">群组</a><em><a href="threadlist_default.aspx">话题</a></em></li>
				<li><img src="../style/app/favorite.gif"><a href="../user/favorite_default.aspx">收藏夹</a></li>
				
			</ul>
		</div>
		<div id="mainarea">
			<h2 class="title"> <img src="../style/app/mtag.gif"><a href="list_default.aspx?{$_mtagid$}#{$_mtagsortid$}">{$_mtagsortname$}</a> - <a href="view_default.aspx?mtagid={$_mtagid$}">{$_mtagname$}</a> </h2>
			<div class="tabs_header">
				<ul class="tabs">
					<li><a href="view_threadlist_default.aspx?mtagid={$_mtagid$}"><span>返回讨论区</span></a></li>
					<li id="li0" style="display:none;" class="null"><a href="javascript:void(0);" id="mtag_join_{$_mtagid$}" onclick="ConfirmJoinMTag({$_mtagid$})">加入该群组</a></li>
					<li id="li1" style="display:none;" class="null"><a href="view_threadadd_default.aspx?mtagid={$_mtagid$}">发起新话题</a></li>
				</ul>
			</div>
			<div id="div_post">
				<div class="board">
					<div id="post_{$_threadid$}_li">
						<ul class="line_list">
							<li>
								<table width="100%">
									<tr>
										<td width="70" valign="top"><div class="avatar48"> <a href="javascript:void(0);" onclick="ShowUserPage({$_threaduserid$});" title="{$_threadusername$}"><img src="../_data/avatar/{$_threaduserid$}_m.jpg" onerror="this.src='../_data/avatar/0_m.jpg'" alt="{$_threadusername$}" class="avatar" /></a> </div></td>
										<td><div class="title">
												<div class="r_option">
<a id="reply1" style="display:none;" href="javascript:void(0)" onclick="ajaxReply(0,0)">回复</a>
<a id="del1" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('del', '{$_threadid$}', {$_mtagid$})">删除</a>
<a id="head1_0" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('head1', '{$_threadid$}', {$_mtagid$})">置顶</a>
<a id="head1_1" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('head0', '{$_threadid$}', {$_mtagid$})">取消置顶</a>
<a id="good1_0" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('good1', '{$_threadid$}', {$_mtagid$})">精华</a>
<a id="good1_1" style="display:none;" href="javascript:void(0);" onclick="ajaxManage('good0', '{$_threadid$}', {$_mtagid$})">取消精华</a>
												</div>
												<h1>{$_threadtitle$}</h1>
												<a href="javascript:void(0);" onclick="ShowUserPage({$_threaduserid$});" title="{$_threadusername$}">{$_threadusername$}</a> <span class="time">{$_threadaddtime$}</span> </div>
											<div class="detail" id="detail_0"> {$_threadcontent$} </div></td>
									</tr>
								</table>
							</li>
						</ul>
					</div>
                    <textarea id="tplList" style="display:none">{#foreach $T.table as record}
<div>
	<ul class="line_list">
		<li>
			<table width="100%">
				<tr>
					<td width="70" valign="top"><div class="avatar48"> <a href="javascript:void(0);" onclick="ShowUserPage({$T.record.replyuserid});" title="{$T.record.replyusername}"><img src="../_data/avatar/{$T.record.replyuserid}_m.jpg" onerror="this.src='../_data/avatar/0_m.jpg'" alt="{$T.record.replyusername}" class="avatar" /></a> </div></td>
					<td><div class="title">
							<div class="r_option">
								{#if $T.record.replyuserid == user.id}
								<a href="javascript:void(0);" onclick="ajaxDelReply({$T.record.replyid})">删除</a>
								{#else}
								<a href="javascript:void(0);" onclick="ajaxReply({$T.record.replyid},{$T.record.no})">回复</a>
								{#/if}
								<span class="time">#{$T.record.no}</span>
							</div>
							<a href="javascript:void(0);" onclick="ShowUserPage({$T.record.replyuserid});" title="{$T.record.replyusername}">{$T.record.replyusername}</a> <span class="time">{$T.record.replyaddtime}</span>
						</div>
						<div class="detail" id="detail_{$T.record.replyid}"> {$T.record.replycontent}</div></td>
				</tr>
			</table>
		</li>
	</ul>
</div>
{#/for}</textarea>
					<div id="ajaxList"></div>
					<div id="ajaxPageBar" class="pages" style="display:none;"> </div>
					<div class="c_form" id="reply_0" style="display:none;"> 你还不是该群组正式成员或被禁止了发言，不能参与讨论。 </div>
					<div class="quickpost" id="reply_1" style="display:none;">
						<form id="threadreplyForm" name="form1" method="post" class="quickpost" action="?act=save&threadid={$_threadid$}&mtagid={$_mtagid$}">
							<table>
								<tr>
									<td><span id="spanTitle"></span><input type="hidden" id="txtReplyId" name="replyid" value="0" /></td>
								</tr>
								<tr>
									<td><textarea id="txtContent" name="txtContent" col="50" rows="6" style="width:450px; height: 6em;"></textarea>
										<span id="tipContent" style="width: 200px"></span></td>
								</tr>
								<tr>
									<td><input class="t_input" size="10" type="text" name="txtCode" id="txtCode" maxlength="4" style="ime-mode:disabled;" onpaste="return false" />
										<img id="imgCode" onclick="this.src=_jcms_SetUrlRefresh('../plus/getcode.aspx');" src="../plus/getcode.aspx" align="absmiddle" style="cursor: pointer" alt="看不清楚？点击换一张" title="看不清楚？点击换一张" /><img id="imgRead" src="../style/common/maintb.gif" align="absmiddle" style="cursor: pointer" alt="收听校验码" title="收听校验码" onclick="PlayCodeVoice('player');" /><span id="player"></span>
										<span id="tipCode" style="width: 200px"></span></td>
								</tr>
								<tr>
									<td><input type="hidden" name="mtagid" value="{$_mtagid$}" />
										<input type="hidden" name="threadid" value="{$_threadid$}" />
										<input type="submit" id="submit_btn" name="submit_btn" value="回复" class="submit" />
									</td>
								</tr>
							</table>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--/mainarea-->
		<div id="bottom"></div>
	</div>
</div>
<iframe frameborder="0" scrolling="no" src="../user/index_default.aspx?do=footer" width="100%" height="50" marginwidth="0" marginheight="0" hspace="0" vspace="0" id="iffooter"></iframe>
</body>
</html>
