<%@ page contentType="text/html;charset=utf-8"%> <%@ page import="com.redmoon.forum.ui.*"%> <%@ page import="cn.js.fan.db.*"%> <%@ page import="cn.js.fan.util.*"%> <%@ page import="com.redmoon.forum.*"%> <%@ page import="com.redmoon.forum.person.*"%> <%@ page import="java.util.*"%> <%@ page import="com.redmoon.forum.plugin.*"%> <%@ page import="com.redmoon.forum.plugin2.*"%> <%@ page import="com.redmoon.forum.plugin.sweet.*"%> <%@ page import="com.redmoon.forum.plugin.base.*"%> <% String querystring = StrUtil.getNullString(request.getQueryString()); String privurl=request.getRequestURL()+"?"+StrUtil.UrlEncode(querystring); if (!privilege.isUserLogin(request)) { if (!ForumDb.getInstance().canGuestSeeTopic()) { response.sendRedirect("../info.jsp?op=login&info=" + StrUtil.UrlEncode(SkinUtil.LoadString(request, "info_please_login")) + "&privurl=" + privurl); return; } } long rootid; try { rootid = ParamUtil.getLong(request, "rootid"); } catch (Exception e) { out.println(StrUtil.Alert("标识非法!")); return; } MsgDb msgdb = new MsgDb(); msgdb = msgdb.getMsgDb(rootid); // 保存下来,以用于快速回复区的插件提示 MsgDb rootMsgDb = msgdb; if (!msgdb.isLoaded()) { out.print(cn.js.fan.web.SkinUtil.makeInfo(request, "该贴已不存在!")); return; } String boardcode = msgdb.getboardcode(); try { privilege.checkCanEnterBoard(request, boardcode); } catch (ErrMsgException e) { response.sendRedirect("../info.jsp?info=" + StrUtil.UrlEncode(e.getMessage())); return; } Leaf msgLeaf = new Leaf(); msgLeaf = msgLeaf.getLeaf(boardcode); String boardname = msgLeaf.getName(); UserSession.setBoardCode(request, boardcode); // 取得皮肤路径 String skincode = msgLeaf.getSkin(); if (skincode.equals("") || skincode.equals(UserSet.defaultSkin)) { skincode = UserSet.getSkin(request); if (skincode==null || skincode.equals("")) skincode = UserSet.defaultSkin; } SkinMgr skm = new SkinMgr(); Skin skin = skm.getSkin(skincode); String skinPath = skin.getPath(); com.redmoon.forum.Config cfg1 = new com.redmoon.forum.Config(); int msgTitleLengthMin = cfg1.getIntProperty("forum.msgTitleLengthMin"); int msgTitleLengthMax = cfg1.getIntProperty("forum.msgTitleLengthMax"); int msgLengthMin = cfg1.getIntProperty("forum.msgLengthMin"); int msgLengthMax = cfg1.getIntProperty("forum.msgLengthMax"); int maxAttachmentCount = cfg1.getIntProperty("forum.maxAttachmentCount"); int maxAttachmentSize = cfg1.getIntProperty("forum.maxAttachmentSize"); %> <%=Global.AppName%> - <%=msgdb.getTitle()%> <%@ include file="inc/header.jsp"%> <% // 每隔5分钟刷新在位时间 userservice.refreshStayTime(request, response); String sqlt = "select id from sq_thread where boardcode=" + StrUtil.sqlstr(boardcode)+" ORDER BY level desc,redate desc"; ThreadBlockIterator irthread = msgdb.getThreads(sqlt, boardcode, 0, 200); irthread.setIndex(msgdb); %> <% PluginMgr pmnote = new PluginMgr(); Vector vplugin = pmnote.getAllPluginUnitOfBoard(boardcode); if (vplugin.size()>0) { %>
<% Iterator irpluginnote = vplugin.iterator(); while (irpluginnote.hasNext()) { PluginUnit pu = (PluginUnit)irpluginnote.next(); IPluginUI ipu = pu.getUI(request); IPluginViewShowMsg pv = ipu.getViewShowMsg(boardcode, msgdb); if (pv.IsPluginBoard()) out.print(pu.getName(request) + " " + pv.render(UIShowMsg.POS_NOTE) + "
"); } %>
<%}%> <% String sql = SQLBuilder.getShowtopicSql(rootid); // "select id from sq_message where rootid=" + rootid + " ORDER BY lydate asc"; //orders"; 这样会使得顺序上不按时间,平板式时会让人觉得奇怪 int pagesize = 10; int totalmsg = msgdb.getMsgCount(sql, boardcode, rootid); Paginator paginator = new Paginator(request, totalmsg, pagesize); int curpage = paginator.getCPage(request); //设置当前页数和总页数 int totalpages = paginator.getTotalPages(); if (totalpages==0) { curpage = 1; totalpages = 1; } int start = (curpage-1)*pagesize; int end = curpage*pagesize; MsgBlockIterator irmsg = msgdb.getMsgs(sql, boardcode, rootid, start, end); %>
<% String addpage = "addtopic_new.jsp"; String replypage = "addreply_new.jsp"; if (msgLeaf.getWebeditAllowType()==Leaf.WEBEDIT_ALLOW_TYPE_REDMOON_FIRST) { addpage = "addtopic_we.jsp"; replypage = "addreply_we.jsp"; } %> 发新贴子 回复贴子 <% Vector vplugin2 = msgLeaf.getAllPlugin2(); Iterator irplugin2 = vplugin2.iterator(); while (irplugin2.hasNext()) { com.redmoon.forum.plugin2.Plugin2Unit p2u = (com.redmoon.forum.plugin2.Plugin2Unit)irplugin2.next(); %> " border="0"> <%} %> 您是本帖第 个阅读者     <% if (irthread.hasPrevious()) { MsgDb prevMsg = (MsgDb)irthread.previous(); // advance the iterator pointer back to the original index irthread.next(); %> 浏览上一篇主题<% } else { %>   <% } %> 刷新本主题 <% if (irthread.hasNext()) { MsgDb nextMsg = (MsgDb)irthread.next(); %> 浏览下一篇主题 <% } else { %>   <% } %>
 主题: [打印] [收藏]
<% // 取得显示设置 BoardRenderDb boardRender = new BoardRenderDb(); boardRender = boardRender.getBoardRenderDb(boardcode); IPluginRender render = boardRender.getRender(); String name="",lydate="",content="",topic=""; String RegDate="",Gender="",RealPic="",email="",sign="",myface=""; int experience=0; int addcount=0; long id; int credit=0; int islocked=0,iselite=0,lylevel=0,isguide=0; String voteoption="",voteresult=""; String roottopic = ""; int type=0; int myfacewidth=120,myfaceheight=150; int show_ubbcode=1,show_smile=1; int iswebedit = 0; int i = 0; while (irmsg.hasNext()) { msgdb = (MsgDb)irmsg.next(); i++; id = msgdb.getId(); name = msgdb.getName(); topic = msgdb.getTitle(); content = msgdb.getContent(); lydate = SkinUtil.formatDateTime(request, msgdb.getAddDate()); type = msgdb.getType(); voteoption = msgdb.getVoteOption(); voteresult = msgdb.getVoteResult(); islocked = msgdb.getIsLocked(); iselite = msgdb.getIsElite(); lylevel = msgdb.getLevel(); iswebedit = msgdb.getIsWebedit(); show_ubbcode = msgdb.getShowUbbcode(); show_smile = msgdb.getShowSmile(); if (i==1) { roottopic = topic; %> <% } UserDb user = new UserDb(); user = user.getUser(name); RealPic = user.getRealPic(); Gender = StrUtil.getNullStr(user.getGender()); if (Gender.equals("M")) Gender = "男"; else if (Gender.equals("F")) Gender = "女"; else Gender = "不详"; RegDate = SkinUtil.formatDate(request, user.getRegDate()); experience = user.getExperience(); credit = user.getCredit(); addcount = user.getAddCount(); email = user.getEmail(); sign = StrUtil.getNullStr(user.getSign()); myface = StrUtil.getNullString(user.getMyface()); myfacewidth = user.getMyfaceWidth(); myfaceheight = user.getMyfaceHeight(); %>
<%=name%>
<%if (myface.equals("")) {%> <%}else{%> height=<%=myfaceheight%>> <%}%>
<%=Gender%>
等级:<%=user.getLevelDesc()%>
经验:<%=experience%>
信用:<%=credit%>
<% ScoreMgr sm = new ScoreMgr(); ScoreUnit su = sm.getScoreUnit("gold"); out.print(StrUtil.toHtml(su.getName())); %>:<%=user.getGold()%>
发贴:<%=addcount%>
精华:<%=user.getEliteCount()%>
注册:<%=RegDate%>
状态:<% OnlineUserDb ou = new OnlineUserDb(); ou = ou.getOnlineUserDb(user.getName()); if (ou.isLoaded()) out.print("在线"); else out.print("离线"); %>
<% if (rootid==id) //当为根贴时可置为被锁定 { String toptitle="",locktitle="",elitetitle="",guidetitle=""; int dotop = (lylevel==MsgDb.LEVEL_TOP_BOARD)?0:MsgDb.LEVEL_TOP_BOARD; if (dotop==MsgDb.LEVEL_TOP_BOARD) toptitle = "版块置顶"; else toptitle = "置为非顶"; int dolock = (islocked==1)?0:1; if (dolock==1) locktitle = "锁定"; else locktitle = "解锁"; int doelite = (iselite==1)?0:1; if (doelite==1) elitetitle = "置为精华"; else elitetitle = "置为非精华"; %> <% if (privilege.isMasterLogin(request)) { // 全局置顶 String alltoptitle=""; int doalltop = (lylevel==MsgDb.LEVEL_TOP_FORUM)?MsgDb.LEVEL_TOP_BOARD:MsgDb.LEVEL_TOP_FORUM; if (doalltop==MsgDb.LEVEL_TOP_FORUM) alltoptitle = "论坛置顶"; else alltoptitle = "置为非顶"; %> &action=setOnTop&id=<%=id%>&value=<%=doalltop%>"><%=alltoptitle%>  <%}%> &action=setOnTop&id=<%=id%>&value=<%=dotop%>"><%=toptitle%>  &action=setLocked&id=<%=id%>&value=<%=dolock%>"><%=locktitle%> &action=setElite&id=<%=id%>&value=<%=doelite%>"><%=elitetitle%> 改变显示颜色 &boardcode=<%=StrUtil.UrlEncode(boardcode)%>&boardname=<%=StrUtil.UrlEncode(boardname,"utf-8")%>&id=<%=id%>">转至其它版块 <% } %>
> "> 查看<%=StrUtil.toHtml(name)%的个人资料 border=0 align="absmiddle"> ',320,260)">发送短消息息给<%=StrUtil.toHtml(name)%>  ">把<%=name%加入好友 border=0 align="absmiddle"> &searchtype=byauthor&timelimit=all&selboard=<%=boardcode%>&boardcode=<%=boardcode%>&boardname=<%=StrUtil.UrlEncode(boardname,"utf-8")%>">搜索<%=StrUtil.toHtml(name)%>在『<%=boardname%> 』的所有主题 发送电邮给<%=StrUtil.toHtml(name)%> 复制这个帖子 &replyid=<%=id%>&retopic=<%=StrUtil.UrlEncode(topic,"utf-8")%>"e=1" class="normal"> 引用回复这个帖子  <% if (islocked==0) {%> 回复这个帖子 <% } %>   <%if (Global.hasBlog) {%>  <%}%>

 <%=msgdb.getTitle()%>
<% if (vplugin.size()>0) { Iterator irplugin = vplugin.iterator(); while (irplugin.hasNext()) { PluginUnit pu = (PluginUnit)irplugin.next(); IPluginUI ipu = pu.getUI(request); IPluginViewShowMsg pv = ipu.getViewShowMsg(boardcode, msgdb); if (pv.IsPluginBoard()) { out.print(pu.getName(request) + " " + pv.render(UIShowMsg.POS_BEFORE_MSG) + "
"); } } } %>
<% String[] voptions = null; voteoption = render.RenderVote(request, msgdb); // 如果不可见则voteoption为null if (type==1 && voteoption!=null) { voptions = voteoption.split("\\|"); int len = voptions.length; %>
<% for (int k=0; k <%=k+1%>、    <%=voptions[k]%>
<% } %> <% String[] result = voteresult.split("\\|"); len = result.length; int[] re = new int[len]; int[] bfb = new int[len]; int total = 0; for (int k=0; k <% int barId = 0; for (int k=0; k <% barId ++; if (barId==10) barId = 0; } %>
<%=k+1%>、 .gif width="<%=bfb[k]%>%" height=10>   <%=re[k]%> (<%=bfb[k]%>%)
 共有<%=total%>人参加调查

<%} if (!msgdb.getPlugin2Code().equals("")) { Plugin2Mgr p2m = new Plugin2Mgr(); Plugin2Unit p2u = p2m.getPlugin2Unit(msgdb.getPlugin2Code()); out.print(p2u.getUnit().getRender().rend(request, msgdb)); } out.print(render.RenderContent(request, msgdb)); // if (msgdb.getIsWebedit()==msgdb.WEBEDIT_REDMOON) { String att = render.RenderAttachment(request, msgdb); out.print(att); // } %>
<% if (!sign.equals("")) { out.print("----------------------------------------------
"); sign = StrUtil.toHtml(sign); if (cfg1.getBooleanProperty("forum.sign_ubb")) out.print(StrUtil.ubb(sign,true)); else out.print(sign); //out.print("
----------------------------------------------
"); } %>
<% String ip = ""; if (privilege.isMasterLogin(request)) ip=msgdb.getIp(); else ip = "您无权察看"; %> IP:<%=ip%> <%=lydate%>
<%if (iswebedit==MsgDb.WEBEDIT_UBB) {%> <%}else if (iswebedit==MsgDb.WEBEDIT_NORMAL) {%> <%}else{%> <%}%> &delid=<%=id%>">   <%if (msgdb.getReplyid()==-1) {%> 楼主 <%}else{%> <%=(curpage-1)*pagesize+i%> 楼 <%}%>   顶端
<% } if (paginator.getTotal()>0) { msgdb.increaseHit(rootid); } %>
<% String querystr = "&rootid="+rootid; out.print(paginator.getCurPageBlock(request, "showtopic.jsp?boardcode=" + boardcode + querystr)); %>
<%if (privilege.isUserLogin(request)) {%>
  快速回复主题  
<% if (vplugin.size()>0) { Iterator irplugin = vplugin.iterator(); while (irplugin.hasNext()) { PluginUnit pu = (PluginUnit)irplugin.next(); IPluginUI ipu = pu.getUI(request); IPluginViewShowMsg pv = ipu.getViewShowMsg(boardcode, rootMsgDb); if (pv.IsPluginBoard()) { out.print(pu.getName(request) + " " + pv.render(UIShowMsg.POS_QUICK_REPLY_NOTE) + "
"); out.print(pv.render(UIShowMsg.POS_QUICK_REPLY_ELEMENT) + "
"); } } } %>
  选择表情
禁止UBB代码
禁止表情字符
" size="40"> <% if (cfg1.getBooleanProperty("forum.addUseValidateCode")) { %> 请输入验证码: <%}%>

   
<%}%> <%@ include file="inc/footer.jsp"%>