{wc:templates "index","header"}

<div class="groups-stripes"></div>
<div class="layout980">
	<div class="groups-left">
		<div class="Topic-head">
			<div class="Topic-Himg"><a href="" class="fl-img"><img src="{G_UPLOAD_PATH}/{wc:$quanzi['img']}" id="imgGroupIco" border="0"></a></div>
			<div class="Topic-HC">
				<div class="Topic-Htit gray03">
					<h2><a id="thisGroupName" href="" class="orange">{wc:$quanzi['title']}</a></h2> 
					{wc:if $quanzi['jiaru']=='Y'}
					{wc:if !$addgroup}
					<a id="btnJoinGroup" href="javascript:;" class="button04">申请加入</a>
					{wc:else}
					<span class="JoinOut" id="spanJoinOut"><s></s>已加入<i>|</i><a id="btnJoinOutGroup" href="javascript:;" class="blue">退出</a></span>
					{wc:if:end}
					{wc:if:end}
				</div>
				<p class="Topic-Hinfo gray02">成员：
					<span class="gray01">{wc:$quanzi['chengyuan']}</span>&nbsp;&nbsp;&nbsp;话题：
					<span class="gray01">{wc:$quanzi['tiezi']}</span>&nbsp;&nbsp;&nbsp;创建时间：
					<span class="gray01">{wc:fun:date("Y-m-d H:i",$quanzi['time'])}</span>
				</p>
				<div class="Topic-Hintro"><span id="pGroupAbout" class="gray01">{wc:$quanzi['jianjie']}</span>&nbsp;</div>
			</div>
			<div class="Managers">
				<a class="Managers-icon" type="showCard" href="{WEB_PATH}/uname/{wc:fun:idjia($quanzi['guanli'])}"></a>
				<div class="Managers-Himg"><a href="{WEB_PATH}/uname/{wc:fun:idjia($quanzi['guanli'])}" type="showCard" class="fl-img">
				{wc:if userid($quanzi['guanli'],'img')==null}
				<img src="{G_TEMPLATES_STYLE}/images/prmimg.jpg" width="50" height="50" />
				{wc:else}
				<img id="imgUserPhoto" src="{G_UPLOAD_PATH}/{wc:fun:userid($quanzi['guanli'],'img')}" width="50" height="50" border="0"/>
				{wc:if:end}				
				</a>
				<p class="Managers-name"><a type="showCard" href="{WEB_PATH}/uname/{wc:fun:idjia($quanzi['guanli'])}" class="blue">{wc:fun:userid($quanzi['guanli'],'username')}</a></p>
				</div>
			</div>
		</div>
		<div class="msg">
			<b><i></i>圈子公告：</b>
			<p id="pGroupNotice" class="gray01">{wc:$quanzi['gongao']}</p>
		</div>
		<div class="Publish">
			<div class="Pub-inp-click">
				<b></b>
				<input type="text" id="txtTopicTitle" value="点击展开"><a id="btnPostTopic" href="javascript:;" class="button05">发表话题</a>
			</div>
			<div id="divEditor" class="Pub-topic hidden">
			<form action="{WEB_PATH}/group/group/showinsert" method="post">
				<p class="Pub-tit"><b></b><input id="txtTopicTitleEx" maxlength="100" type="text" name="title" value=""></p>
				<p class="Pub-con"><b></b><textarea id="txtTopicContent" name="neirong" value="" style="border:1px solid #C2C2C2; height:150px; resize:none;"></textarea></p>
				<input type="hidden" value="{wc:$quanzi['id']}" name="qzid" />
				<div class="Pub-btn-r">
					<a id="btnCancel" href="javascript:;" class="button06">取消</a>
					<input type="submit" id="btnPostTopicEx" style="float:right; margin-left:10px" name="submit" class="button05"value="发表话题" />
				</div>
			</form>
			</div>
		</div>		
		<div class="Topic-tab">
			<ul>
				<li class="tabcur">话题</li>
			</ul>
		</div>
		{wc:if $total==0}
		<div class="tips-con"><i></i>暂无话题，快抢沙发吧！</div>
		{wc:else}
		{wc:loop $qz $tiezi}
		<div class="Topiclist">
			<div class="Topiclist-img">
				<a type="showCard" href="{WEB_PATH}/uname/{wc:fun:idjia($tiezi['hueiyuan'])}" class="head-img">
				{wc:if userid($tiezi['hueiyuan'],'img')==null}
				<img src="{G_TEMPLATES_STYLE}/images/prmimg.jpg" width="50" height="50" />
				{wc:else}
				<img id="imgUserPhoto" src="{G_UPLOAD_PATH}/{wc:fun:userid($tiezi['hueiyuan'],'img')}" width="50" height="50" border="0"/>
				{wc:if:end}	
				</a>
				<a type="showCard" rel="nofollow" href="{WEB_PATH}/uname/{wc:fun:idjia($tiezi['hueiyuan'])}" class="blue">{wc:fun:userid($tiezi['hueiyuan'],'username')}</a>
			</div>
			<div class="Topiclist-RC "><b class="arrow"></b>
				<div class="R-tit gray">		
					{wc:if $tiezi['zhiding']=='Y'}
					<a href="{WEB_PATH}/group/nei/{wc:$tiezi['id']}" class="red">{wc:$tiezi['title']}</a>
					<i class="zhiding"></i>&nbsp;
					{wc:else}
					<a href="{WEB_PATH}/group/nei/{wc:$tiezi['id']}">{wc:$tiezi['title']}</a> 
				   <!--  <i class="jing"></i>&nbsp; -->
				   {wc:if:end}
					<span class="time">{wc:fun:date("Y年m月d日 H:i",$tiezi['time'])}</span>
				</div>
				<div class="gray02">{wc:fun:_strcut($tiezi['neirong'],160)}</div>
				<div class="topic-reply">
					<div>
						<a href="{WEB_PATH}/group/nei/{wc:$tiezi['id']}" class="gray02">回复<span class="gray03">({wc:$tiezi['hueifu']})</span></a>&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="{WEB_PATH}/group/nei/{wc:$tiezi['id']}" class="gray02">人气<span class="gray03">({wc:$tiezi['dianji']})</span></a>
					</div>
					<span class="gray03">最后回复：<a href="{WEB_PATH}/uname/{wc:fun:idjia($tiezi['zuihou'])}" class="blue">{wc:fun:userid($tiezi['zuihou'],'username')}</a>&nbsp;&nbsp;{wc:fun:date("Y年m月d日",$tiezi['time'])}&nbsp;&nbsp;</span>			
				</div>
			</div><p class="Topicline"></p>
		</div>					
		{wc:loop:end}
		{wc:if $total>$num}
		<div class="pagesx">{wc:page:two}</div>
		{wc:if:end}
		{wc:if:end}	
	</div>
	{wc:templates "group","right"}
</div>
<script>
$(function(){
	$("#btnJoinGroup,#btnJoinOutGroup").click(function(){
		var uid="{wc:$uid}";
		if(!uid){
			alert("你未登录！");
		}else{
			var qzid="{wc:$quanzi['id']}";
			var text=$("#btnJoinOutGroup").text();
			$.ajax({
				type:"POST",
				url:"{WEB_PATH}/group/group/goqz",
				data:{id:qzid,text:text},
				success:function(){
					location.replace(location);
				}
			});
		}		
	});
	$("#txtTopicTitle,#btnPostTopic").click(function(){
		var uid="{wc:fun:uidcookie('uid')}";
		var text=$("#btnJoinOutGroup").text();
		if(!uid){
			alert("你未登录！");
		}else if(!text){
			alert("你未加入圈子！");
		}else{
			$("#divEditor").removeClass("hidden");
			$(".Pub-inp-click").addClass("hidden");
		}
	});
	$("#btnCancel").click(function(){
		$("#divEditor").addClass("hidden");
		$(".Pub-inp-click").removeClass("hidden");
	});
	$("form").submit(function(){
		var text=$("#txtTopicTitleEx").val();
		var content=$("#txtTopicContent").val();
		if(!text || !content){			
			alert("标题内容不能为空!");
			return false;
		}
	})
})
</script>
 {wc:templates "index","footer"}