<%template _header%>
<script type="text/javascript">
var templatepath = "{templatepath}";
var postminchars = parseInt({config.minpostsize});
var postmaxchars = parseInt({config.maxpostsize});
var disablepostctrl = parseInt({disablepostctrl});
var forumpath = "{forumpath}";
</script>
<script type="text/javascript" src="templates/{templatepath}/showtopic.js"></script>
<script type="text/javascript" src="editor/menu.js"></script>
<script type="text/javascript" src="templates/{templatepath}/ajax.js"></script>
<!--NtForumLocation start-->
<%set (int){loopi}=1%>
<%if page_err==0%>
{topicmagic}
<div id="foruminfo">
	<div class="userinfo">
		<h2><a id="NavHome" href="{config.forumurl}" 
			<%if {config.forumjump}==1%>
			onmouseover="showMenu(this.id);" onmouseout="showMenu(this.id);"
			<%/if%>
			>{config.forumtitle}</a><span>{forumnav}</span><strong>{topictitle}</strong>
		</h2>
	</div>
	<div class="forumstats">
		<div id="search">
				<%if {usergroupinfo.allowsearch}>0%>
					<%template _quicksearch%>
				<%/if%>
		</div>
	</div>
</div>
<%if {config.forumjump}==1%>
	{navhomemenu}
<%/if%>

<!--NtForumLocation end-->
<%template _pagewordadlist%>
<%template _newpmmsgbox%>
<%template _poll%>
<div class="forumpages">
	<div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}&nbsp;&nbsp;页</td>
			<td width="10">&nbsp;</td>
			<td class="forumallpages">{pagenumbers}</td>
			<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) { if({config.aspxrewrite}) {window.location='showtopic-{topicid}-' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) + '{config.extname}';}else{window.location='showtopic.aspx?topicid={topicid}&page=' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) ;}}"" size="4" maxlength="9"  class="colorblue2"/>页</td>
			<td class="viewnumber"><strong>查看:</strong>{topicviews}</td>
		</tr>					   
		</table>
	</div>
  <div class="pagesothers">
		<%if {canposttopic}%>
		<a href="posttopic.aspx?forumid={forumid}"><img src="templates/{templatepath}/images/write-bbs.gif" border="0" alt="发表新主题" /></a>
		<%/if%>
		<%if {topic.closed}==0 && {canreply}%>
		<a href="postreply.aspx?topicid={topicid}"><img src="templates/{templatepath}/images/hf-bbs.jpg" border="0" alt="回复该主题" /></a>
		<%/if%>
  </div>
</div>
<div class="ntforumbox">
	<div class="titlebar">
		<h2>
		标题: 
		<%if {forum.applytopictype}==1 && {forum.topictypeprefix}==1%>
			{topictypes} 
		<%/if%>
		{topictitle}
		<%if {topic.price}>0 && {topic.posterid}!={userid}%>
				  <a href="buytopic.aspx?topicid={topicid}&showpayments=1">浏览需支付 {userextcreditsinfo.name} {topic.price} {userextcreditsinfo.unit}</a>
		<%/if%>
		</h2>
	</div>
<%if {topic.moderated}>0 && {config.moderactions}>0%>
	<div class="navtopiccommend">{moderactions}</div>
<%/if%>
<form id="delpost" name="delpost" method="post" action="topicadmin.aspx?action=moderate&forumid={forumid}">
	<input name="forumid" type="hidden" value="{forumid}" />
	<input name="topicid" type="hidden" value="{topicid}" />
	<input name="operat" type="hidden" value="delposts" />
	<div id="postsContainer">
<%loop (ShowtopicPagePostInfo) post postlist%>

	<%if {post.id}==2 && {postleaderboardad}!=""%>
		<div id="postleaderboardad">
			{postleaderboardad}
		</div>
	<%/if%>
	<div class="viewthread">
	<table cellpadding="0" cellspacing="0" border="0">
		<tbody>
		<tr>
		<td class="postauthor" id="{post.pid}">
		<!--register user-->
				<%if {post.posterid}!=-1%>
						<div id="memberinfo_{loopi}" onmouseover="showMenu(this.id,false)">
							<div class="normalname" onmouseover="this.className='normalnameon'" onmouseout="this.className='normalname'">
							<%if {post.onlinestate}==1%>					
							<img src="templates/{templatepath}/images/friend_dot.gif" alt="在线" title="在线"/>
							<%else%>
							<img src="templates/{templatepath}/images/friend_dot2.gif"  alt="离线" title="离线"/>
							<%/if%>
							{post.poster}
							</div>
						</div>
						<div class="avatarphoto">
						    <%if {config.showavatars}==1%>
							<%if {post.avatar}!=""%>
								<img src="{post.avatar}"
												<%if {post.avatarwidth}>0%>
													width="{post.avatarwidth}"
													height="{post.avatarheight}"
												<%/if%> alt="头像"
								/>			
							<%/if%>
							<%/if%>
						</div>
						<%if {post.nickname}!=""%>
							<div class="nickname">{post.nickname}</div>
						<%/if%>
							<p>
									<script language="javascript" type="text/javascript">
										ShowStars({post.stars}, {config.starthreshold});
									</script>
							</p>
						<div class="profile">
							<ul>
								<%if {config.enablespace}==1 || {config.enablealbum}==1%>
									<li class="otherproduct">
								<%/if%>
								<%if {config.enablespace}==1%><strong><%if {post.spaceid}>0%><a href="{spaceurl}space/?uid={post.posterid}">个人空间</a><%else%><a href="###" onclick="nospace('{post.poster}');">个人空间</a><%/if%></strong><%/if%> <%if {config.enablealbum}==1%><em><a href="showalbumlist.aspx?uid={post.posterid}">相册</a></em><%/if%>
								<%if {config.enablespace}==1 || {config.enablealbum}==1%>
									</li>
								<%/if%>	
								
								<%if {config.userstatusby}==1%>
									<li>组别:<span>{post.status}</span></li>
								<%/if%>
								<li>性别:<span><script type="text/javascript">document.write(displayGender({post.gender}));</script></span></li>
								<%if {post.bday}!=""%>
									<li>生日:<span>{post.bday}</span></li>
								<%/if%>
								<li>来自:<span>{post.location}</span></li>
								<li>积分:<span>{post.credits}</span></li>
								<li>帖子:<span>{post.posts}</span></li>
								<li>注册:<span><%if {post.joindate}!=""%><%datetostr({post.joindate},"yyyy-MM-dd")%><%/if%></span></li>					
							</ul>
						</div>
						<%if {post.medals}!=""%>
							<div class="medals">{post.medals}</div>
						<%/if%>
				<%else%>
						<div class="ipshow"><strong>{post.poster}</strong>  {post.ip}
							<%if {useradminid}>0 && {admininfo.allowviewip}==1%>
										<a href="getip.aspx?pid={post.pid}&topicid={topicid}" title="查看IP"><img src="templates/{templatepath}/images/ip.gif" alt="查看IP"/></a>
							<%/if%>
						</div>
					<!--guest-->
						<div class="noregediter">
							未注册
						</div>
				<%/if%>	
		</td>
		<td class="postcontent">
			<div class="navpostinfo">
				<div class="postinfoleft">
					<span><%datetostr({post.postdatetime},"yyyy-MM-dd HH:mm")%></span>
					<%if {post.posterid}!=-1%>
					<em>|
						<%if {onlyauthor}=="1"%>
						    <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topicid},0)%>
							<a href="{aspxrewriteurl}">显示全部</a>  
						<%else%>
							<%if {topic.posterid}=={post.posterid}%>
							  <a href="showtopic.aspx?topicid={topicid}&onlyauthor=1">只看楼主</a>  
							<%/if%>
						<%/if%>
					</em>
					<%/if%>
				</div>	
				<div class="postinfoitem">
					<%if {userid}!=-1%>
						<%template _report%>|
					<%/if%>
					<a href="showtree.aspx?topicid={topicid}&postid={post.pid}">树型</a>|
					<a href="favorites.aspx?topicid={topicid}">收藏</a>|
					<%if {ismoder}==1%>
						<a href="editpost.aspx?topicid={topicid}&postid={post.pid}">编辑</a>|
						<a href="delpost.aspx?topicid={topicid}&postid={post.pid}" onclick="return confirm('确定要删除吗?');">删除</a>|
						<%if {post.posterid}!=-1%>
							<a href="###" onclick="action_onchange('rate',$('moderate'),'{post.pid}');">评分</a>|
							<%if {post.ratetimes}>0%>
							<a href="###" onclick="action_onchange('cancelrate',$('moderate'),'{post.pid}');">撤销评分</a>&nbsp;
							<%/if%>
						<%/if%>
						<input name="postid" id="postid" value="{post.pid}" type="checkbox" />
					<%else%>
						<%if {post.posterid}!=-1 && {userid}=={post.posterid}%>
							<%if {topic.closed}==0%>
								<a href="editpost.aspx?topicid={topicid}&postid={post.pid}">编辑</a>|
							<%/if%>
							<a href="delpost.aspx?topicid={topicid}&postid={post.pid}" onclick="return confirm('确定要删除吗?');">删除</a>|
						<%/if%>
						<%if {usergroupinfo.raterange}!="" && {post.posterid}!=-1%><a href="###" onclick="action_onchange('rate',$('moderate'),'{post.pid}');">评分</a>
						<%/if%>
					<%/if%>
					<a href="###" class="t_number" onclick="$('message{post.pid}').className='t_smallfont'">小</a>			
					<a href="###" class="t_number" onclick="$('message{post.pid}').className='t_msgfont'">中</a>
					<a href="###" class="t_number" onclick="$('message{post.pid}').className='t_bigfont'">大</a>
					<a href="###" class="bold" title="复制帖子链接到剪贴板" onclick="setcopy(window.location.toString().replace(/#(.*?)$/ig, '') + '#{post.pid}', '已经复制到剪贴板')"><span>{post.id}</span></a>
				</div>
			</div>
			<div id="ad_thread2_{post[_id]}"></div>
			<div class="defaultcontent">
					<%if {topic.identify}>0 && {post.id}==1%>
						<div class="ntprint" onclick="this.style.display='none';"><img src="images/identify/{topicidentify.filename}" alt="点击关闭鉴定图章" title="点击关闭鉴定图章" /></div>
					<%/if%>				 
				  <div class="forumarticle">
					<h3>{post.title}</h3>
					<div id="message{post.pid}" class="t_msgfont">
						<div id="ad_thread3_{post[_id]}"></div>
						{post.message}
					 </div>
			</div>
			<%if {post.ratetimes}>0%>
				 <%template _ratelog%>
			<%/if%>
			<%loop (ShowtopicPageAttachmentInfo) attachment attachmentlist%>
				<%if {attachment.pid}=={post.pid}%>
					<!--附件开始-->
					<div class="quote" id="attachment_{attachment.aid}">
						<div class="text"><h1><img src="templates/{templatepath}/images/attachment.gif" alt="附件"/>附件:</h1>
						<h2>
							<%if {attachment.getattachperm}==1%>
									<%if {attachment.allowread}==1%>
									<%template _attachmentinfo%>
									<%else%>
									<span class="notdown">你的下载权限 {usergroupinfo.readaccess} 低于此附件所需权限 {attachment.readperm}, 你无权查看此附件</span>
									<%/if%>
							<%else%>
									<span class="attachnotdown">您所在的用户组无法下载或查看附件</span>
							<%/if%>
						</h2>
						</div>
					</div>
					<!--附件结束-->
				<%/if%>
			<%/loop%>
			<%if {post.lastedit}!=""%>
			<!--最后编辑开始-->
			<div class="lastediter"><img src="templates/{templatepath}/images/lastedit.gif" alt="最后编辑"/>{post.lastedit}</div>
			<!--最后编辑结束-->
			<%/if%>
				</div>
			<%if {config.showsignatures}==1%>
			<%if {post.usesig}==1%>
				<%if {post.signature}!=""%>
			<!--签名开始-->
				<div class="postertext">
					<%if {config.maxsigrows}>0%>
						<%set (int){ieheight} = {config.maxsigrows}*12%>
						<div class="t_signature" style="overflow: hidden; max-height: {config.maxsigrows}em;maxHeightIE:{ieheight}px">{post.signature}</div>
					<%else%>
						{post.signature}
					<%/if%>
				</div>
			<!--签名结束-->
				<%/if%>
			<%/if%>
		<%/if%>
	</td>
	</tr>
	</tbody>
	<tbody>
	<tr>
			<td class="postauthor threadfoot">
					<img src="templates/{templatepath}/images/gototop.gif" alt="gototop"  onclick="window.scrollTo(0,0)" class="cursor"/>
			</td>
			<td class="threadfootright threadfoot">
				<div id="ad_thread1_{post[_id]}" class="forumcontentad"></div>
				<div class="forumanswer">
				<%if {topic.closed}==0%>
				<a href="postreply.aspx?topicid={topicid}&postid={post.pid}&quote=yes"><img src="templates/{templatepath}/images/button_use.gif" alt="引用"  /></a>
					<%if {canreply}%>
						<a href="###" onclick="replyToFloor('{post.id}', '{post.poster}', '{post.pid}')"><img src="templates/{templatepath}/images/dot_replay.gif" alt="回复"/></a>
					<%/if%>
				<%/if%>
				
				</div>
			</td>
	</tr>
	</tbody>
	</table>
	</div>
	<div class="forumdetailline">&nbsp;</div>
<%if {post.posterid}!=-1%>
	<!-- member menu -->
			<div class="menuwindow" id="memberinfo_{loopi}_menu" style="display:none;">
						<div class="popupmenu">
							<div class="popupmenuitem" style="border-top:none;">
								<p class="recivemessage"><a href="usercppostpm.aspx?msgtoid={post.posterid}" target="_blank">发送短消息</a></p>
							<%if {useradminid}>0%>
								<%if {admininfo.allowviewip}==1%>
								<p  class="seeip"><a href="getip.aspx?pid={post.pid}&topicid={topicid}" title="查看IP">查看IP</a></p>
								<%/if%>
								<%if {admininfo.allowbanuser}==1%>
								<p><a href="useradmin.aspx?action=banuser&uid={post.posterid}" title="禁止用户">禁止用户</a></p>
								<%/if%>
							<%/if%>
							</div>
							<div class="popupmenuitem">
								<p>
							        <%set {aspxrewriteurl} = this.UserInfoAspxRewrite({post.posterid})%>
								<a href="{aspxrewriteurl}" target="_blank">查看公共资料</a></p>
								<p><a href="search.aspx?posterid={post.posterid}">查找该会员全部帖子</a></p>
							</div>
							<div class="popupmenuitem">
								<ul>
								<li>UID:<span>{post.posterid}</span></li>
								<li>精华:<span><%if {post.digestposts}>0%><a href="search.aspx?posterid={post.posterid}&type=digest">{post.digestposts}</a><%else%>{post.digestposts}<%/if%></span></li>
								<%if {score[1]}!=""%>
									<li>{score[1]}:<span>{post.extcredits1} {scoreunit[1]}</span></li>
								<%/if%>
								<%if {score[2]}!=""%>
									<li>{score[2]}:<span>{post.extcredits2} {scoreunit[2]}</span></li>
								<%/if%>
								<%if {score[3]}!=""%>
									<li>{score[3]}:<span>{post.extcredits3} {scoreunit[3]}</span></li>
								<%/if%>
								<%if {score[4]}!=""%>
									<li>{score[4]}:<span>{post.extcredits4} {scoreunit[4]}</span></li>
								<%/if%>
								<%if {score[5]}!=""%>
									<li>{score[5]}:<span>{post.extcredits5} {scoreunit[5]}</span></li>
								<%/if%>
								<%if {score[6]}!=""%>
									<li>{score[6]}:<span>{post.extcredits6} {scoreunit[6]}</span></li>
								<%/if%>
								<%if {score[7]}!=""%>
									<li>{score[7]}:<span>{post.extcredits7} {scoreunit[7]}</span></li>
								<%/if%>
								<%if {score[8]}!=""%>
									<li>{score[8]}:<span>{post.extcredits8} {scoreunit[8]}</span></li>
								<%/if%>
								</ul>
							</div>
							<div class="popupmenuitem">
								<p>状态:<span><%if {post.onlinestate}==1%>
									在线
									<%else%>
									离线
									<%/if%></span>
								</p>
								<ul class="tools">
									<%if {post.msn}!=""%>
									<li>
										<img src="templates/{templatepath}/images/tools-msn.gif" alt="MSN Messenger: {post.msn}"/>
										<a href="mailto:{post.msn}" target="_blank">{post.msn}</a>
									</li>
									<%/if%>
									<%if {post.skype}!=""%>
									<li>
										<img src="templates/{templatepath}/images/tools-skype.gif" alt="Skype: {post.skype}"/>
										<a href="skype:{post.skype}" target="_blank">{post.skype}</a>
									</li>
									<%/if%>
									<%if {post.icq}!=""%>
									<li>
										<img src="templates/{templatepath}/images/tools-icq.gif" alt="ICQ: {post.icq}" />
										<a href="http://wwp.icq.com/scripts/search.dll?to={post.icq}" target="_blank">{post.icq}</a>
									</li>
									<%/if%>
									<%if {post.qq}!=""%>
									<li>
										<img src="templates/{templatepath}/images/tools-qq.gif" alt="QQ: {post.qq}"/>
										<a href="http://wpa.qq.com/msgrd?V=1&Uin={post.qq}&Site={config.forumtitle}&Menu=yes" target="_blank">{post.qq}</a>
									</li>
									<%/if%>
									<%if {post.yahoo}!=""%>
									<li>
										<img src="templates/{templatepath}/images/tools-yahoo.gif" width="16" alt="Yahoo Messenger: {post.yahoo}"/>
										<a href="http://edit.yahoo.com/config/send_webmesg?.target={post.yahoo}&.src=pg" target="_blank">{post.yahoo}</a>
									</li>
									<%/if%>
								</ul>
							</div>
						</div>
			</div>
			<!-- member menu -->
<%/if%>
<%set {loopi}={loopi}+1%>
<%/loop%>
</div>
</form>
<div class="navnextpage">
			&lt;&lt;<a href="showtopic.aspx?forumid={forumid}&topicid={topicid}&go=prev">上一主题</a>|<a href="showtopic.aspx?forumid={forumid}&topicid={topicid}&go=next">下一主题</a>&gt;&gt;
</div>
</div>
<!--ntforumbox end-->

<div class="forumpages">
  <div class="forumpagesnumbers">
		<table border="0" cellpadding="0" cellspacing="0">
				   	<tr>
						<td class="forumallpages"><strong>{pageid}</strong>&nbsp;&nbsp;/&nbsp;&nbsp;{pagecount}&nbsp;&nbsp;页</td>
						<td width="10">&nbsp;</td>
						<td class="forumallpages">{pagenumbers}</td>
						<td class="forumallpages3">跳转<input name="gopage" type="text" id="gopage" onKeyDown="if(event.keyCode==13) { if({config.aspxrewrite}) {window.location='showtopic-{topicid}-' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) + '{config.extname}';}else{window.location='showtopic.aspx?topicid={topicid}&page=' + (parseInt(this.value) > 0 ? parseInt(this.value) : 1) ;}}"" size="4" maxlength="9"  class="colorblue2"/>页</td></tr>
		</table>
  </div>
  <div class="pagesothers">
		<%if {canposttopic}%>
		<a href="posttopic.aspx?forumid={forumid}"><img src="templates/{templatepath}/images/write-bbs2.gif"  alt="发表新主题" /></a>
		<%/if%>
		<%if {topic.closed}==0 && {canreply}%>
		<a href="postreply.aspx?topicid={topicid}"><img src="templates/{templatepath}/images/hf-bbs.gif" alt="回复该主题" /></a>
		<%/if%>
  </div>
</div>


<%if {canreply} && {userid}!=-1%>
	<%if {topic.closed}==0 %>
<!--quickreply-->
	<!--快速回复主题,将_ajaxquickreply替换成_quickreply可变为传统form提交方式-->
		<%template _ajaxquickreply%>
<!--quickreply-->	
	<%/if%>
<%/if%>

<!--forumjumping start-->
<div id="forumjumping">
			<div class="manageritem">
			<%if {useradminid}>0%>
					<script type="text/javascript">
						function action_onchange(value,objfrm,postid){
							if (value != ''){
								objfrm.operat.value = value;
								objfrm.postid.value = postid;
								if(value != 'delpost'){
									objfrm.submit();
								}
								else{
									$('delpost').submit();
								}
							}
						}
					</script>
					<form id="moderate" name="moderate" method="post" action="topicadmin.aspx?action=moderate&forumid={forumid}">
						<input name="forumid" type="hidden" value="{forumid}" />
						<input name="topicid" type="hidden" value="{topicid}" />
						<input name="postid" type="hidden" value="" />
						<input name="operat" type="hidden" value="" />
			
						<select id="operatSel" onchange="action_onchange(this.options[this.selectedIndex].value,this.form,0);"
							name="operatSel">
							<option value="" selected="selected">管理选项</option>
							<option value="delete">删除主题</option>
							<option value="delpost">批量删帖</option>
							<option value="close">关闭主题</option>
							<option value="move">移动主题</option>
							<option value="copy">复制主题</option>
							<option value="highlight">高亮显示</option>
							<option value="digest">设置精华</option>
							<option value="identify">鉴定主题</option>
							<option value="displayorder">主题置顶</option>
							<option value="split">分割主题</option>
							<option value="merge">合并主题</option>
							<option value="repair">修复主题</option>
						</select>
			
					</form>
			<%else if {usergroupinfo.raterange}!=""%>
				<script type="text/javascript">
					function action_onchange(value,objfrm,postid){
						if (value != ''){
							objfrm.operat.value = value;
							objfrm.postid.value = postid;
							if(value != 'delpost'){
								objfrm.submit();
							}
							else{
								$('delpost').submit();
							}
						}
					}
				</script>
				<form id="moderate" name="moderate" method="post" action="topicadmin.aspx?action=moderate&forumid={forumid}">
					<input name="forumid" type="hidden" value="{forumid}" />
					<input name="topicid" type="hidden" value="{topicid}" />
					<input name="postid" type="hidden" value="" />
					<input name="operat" type="hidden" value="" />
	
				</form>
			<%/if%>
		</div>
		<div class="forumjump">
				<select onchange="if(this.options[this.selectedIndex].value != '') {if({config.aspxrewrite}) {
				window.location='showforum-'+this.options[this.selectedIndex].value+'{config.extname}'; }else{window.location='showforum.aspx?forumid='+this.options[this.selectedIndex].value;}}">
					  <option>论坛跳转...</option>
					{forumlistboxoptions}
				</select>
		</div>
</div>
<!--forumjumping end-->
</div>
<%else%>
	<%if {needlogin}%>
		<%template _login%>
	<%else%>
		<%template _errmsgbox%>
	<%/if%>
<%/if%>
{inpostad}
<%template _copyright%>
<%template _adlist%>
<%template _footer%>
