⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listtopic_tree.jsp

📁 oa 源代码
💻 JSP
📖 第 1 页 / 共 3 页
字号:
  	MsgDb md = new MsgDb();
	LeafChildrenCacheMgr lccm = new LeafChildrenCacheMgr(boardcode);
	java.util.Vector v3 = lccm.getChildren();
	Iterator ir3 = v3.iterator();
	int colCount = 4;
	int curCol = 0;
	while (ir3.hasNext()) {
		Leaf lf = (Leaf) ir3.next();
		md = md.getMsgDb(lf.getAddId());
		if (curCol==0)
			out.print("<tr>");
%>
        <td><table width="100%" height="65" border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td width="47%" height="22" align="center">『 <a href="<%=ForumPage.getListTopicPage(request, lf.getCode())%>"><%=lf.getName()%></a> 』
<%
Vector vplugin1 = pmnote.getAllPluginUnitOfBoard(lf.getCode());
if (vplugin1.size()>0) {
	out.print("<font color=#aaaaaa>");
	Iterator irpluginnote = vplugin1.iterator();
	while (irpluginnote.hasNext()) {
		PluginUnit pu = (PluginUnit)irpluginnote.next();
		out.print(pu.getName(request) + "&nbsp;");
	}
	out.print("</font>");
}
%>              </td>
            </tr>
            <tr>
              <td align="center" style="padding:5px">
			      <%
				  String logo = StrUtil.getNullString(lf.getLogo());
				  if (!logo.equals("")) {
				  %>
                <img src="images/board_logo/<%=logo%>" align="absmiddle" alt="<%=lf.getDescription()%>">&nbsp;&nbsp;
              <%}%></td>
            </tr>
            <tr>
              <td height="23" align="center" bgcolor="#EEEEEE">              &nbsp;<img alt="<lt:Label res="res.label.forum.listtopic" key="today_post"/>" src="images/Forum_today.gif" width="25" height="10" align="absmiddle">&nbsp;&nbsp;<%=lf.getTodayCount()%>&nbsp;&nbsp;<img alt="<lt:Label res="res.label.forum.listtopic" key="topic_count"/>" src="images/Forum_topic.gif" width="25" height="10" align="absmiddle">&nbsp;&nbsp;<%=lf.getTopicCount()%>&nbsp;&nbsp;<img src="images/Forum_post.gif" alt="<lt:Label res="res.label.forum.listtopic" key="post_count"/>" width="25" height="10" align="absmiddle">&nbsp;<%=lf.getPostCount()%></td>
            </tr>
        </table></td>
      <%
	  	curCol++;
	  	if (curCol==colCount) {
		    out.print("</tr>");
			curCol = 0;
		}
	  }
	  int tds = colCount - curCol;
	  if (curCol!=0 && tds!=0) {
	  	for (int k=0; k<tds; k++) {
			out.print("<td>&nbsp;</td>");
		}
		out.print("</tr>");
	  }
	  %>
    </tbody>
</table>
  <br>  
  <%}
}%>
  <TABLE cellSpacing=0 cellPadding=2 width="98%" align=center border=0>
    <TBODY>
      <TR> 
        <TD width="50%"><%
		String addpage = "addtopic_new.jsp";
		if (curleaf.getWebeditAllowType()==Leaf.WEBEDIT_ALLOW_TYPE_REDMOON_FIRST)
			addpage = "addtopic_we.jsp";
		%>
		<A href="<%=addpage%>?boardcode=<%=boardcode%>&threadType=<%=threadType%>&privurl=<%=privurl%>"> 
          <IMG src="<%=skinPath%>/images/post_<%=SkinUtil.getLocale(request)%>.gif" border=0 width=99 height=25 alt="<lt:Label res="res.label.forum.listtopic" key="post_btn"/>"></A>
		<a href="<%=addpage%>?isvote=1&boardcode=<%=boardcode%>&threadType=<%=threadType%>&privurl=<%=privurl%>"><img src="<%=skinPath%>/images/votenew_<%=SkinUtil.getLocale(request)%>.gif" border=0 width=99 height=25 alt="<lt:Label res="res.label.forum.listtopic" key="vote_btn"/>"></a>
		<%
		if (vplugin.size()>0) {
			Iterator irplugin = vplugin.iterator();
			while (irplugin.hasNext()) {
				PluginUnit pu = (PluginUnit)irplugin.next();
				IPluginUI ipu = pu.getUI(request, response, out);
				IPluginViewListThread pv = ipu.getViewListThread(boardcode);
				if (pv.IsPluginBoard() && pu.getType().equals(pu.TYPE_TOPIC) && !pu.getButton().equals("")) {%>
					<a href="<%=addpage%>?pluginCode=<%=pu.getCode()%>&boardcode=<%=StrUtil.UrlEncode(boardcode)%>&threadType=<%=threadType%>&privurl=<%=privurl%>"><img src="<%=skinPath + "/" + pu.getButton()%>_<%=SkinUtil.getLocale(request)%>.gif" border="0"></a>
				<%}
			}
		}
		%>
		<%
			Vector vplugin2 = curleaf.getAllPlugin2();
			Iterator irplugin2 = vplugin2.iterator();
			while (irplugin2.hasNext()) {
				com.redmoon.forum.plugin2.Plugin2Unit p2u = (com.redmoon.forum.plugin2.Plugin2Unit)irplugin2.next();
			%>
				<a href="<%=addpage%>?plugin2Code=<%=p2u.getCode()%>&boardcode=<%=StrUtil.UrlEncode(boardcode)%>&threadType=<%=threadType%>&privurl=<%=privurl%>"><img src="<%=skinPath + "/images/" + p2u.getButton()%>_<%=SkinUtil.getLocale(request)%>.gif" border="0"></a>
		<%}%>	    </TD>
        <TD align="right">
<%
int msgcount = 0;
if (privilege.isUserLogin(request)) {
%>
<jsp:useBean id="Msg" scope="page" class="com.redmoon.forum.message.MessageMgr"/>
<%
	msgcount = Msg.getNewMsgCount(request);
%>
<%if (msgcount>0) {%>
<script language=javascript>
		openWin("../message/message.jsp",320,260);
		</script>
<%
	}
}
%>
<%if (msgcount>0) {%>
<a href="javascript:openWin('../message/message.jsp',320,260)"><font color="#CC0000"><img src="images/brow/17.gif" border="0" align="absmiddle">&nbsp; <%=msgcount%>
<lt:Label res="res.label.forum.listtopic" key="new_short_msg"/>
</font></a>
<%}%>&nbsp;<a href="<%=ForumPage.getListTopicPage(request, boardcode)%>" title="<lt:Label res="res.label.forum.showtopic" key="flat_view"/>"><img border=0 src="images/flatview.gif"></a>&nbsp;<a href="listtopic.jsp?op=showelite&boardcode=<%=boardcode%>">
<lt:Label res="res.label.forum.listtopic" key="elite"/>
</a>
          <SELECT onChange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}" 
      name=select2>
	  <OPTION selected><lt:Label res="res.label.forum.listtopic" key="manager"/></OPTION>
	  <OPTION>-------</OPTION>
	  <%
	  String username = privilege.getUser(request);

	  // 置用户所在版块
	  if (username!=null && !username.equals("")) {
	  	OnlineUserDb ou = new OnlineUserDb();
		ou = ou.getOnlineUserDb(username);
		ou.setUserInBoard(boardcode);
	  }
	  
	  MsgMgr mm = new MsgMgr();
	  Vector managers = mm.getBoardManagers(boardcode);
	  Iterator irmgr = managers.iterator();
	  boolean isUserBoardManager = false;
	  while (irmgr.hasNext()) {
	  	UserDb user = (UserDb) irmgr.next();
		if (user.getName().equals(username))
			isUserBoardManager = true;
	  %>
	  <OPTION value="../userinfo.jsp?username=<%=StrUtil.UrlEncode(user.getName())%>"><%=user.getNick()%></OPTION>
	  <%}%>
	  </SELECT>&nbsp; <SELECT onChange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value+'&op=<%=op%>';}" 
      name=seltimelimit>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=all" selected><lt:Label res="res.label.forum.listtopic" key="topic_all"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=1"><lt:Label res="res.label.forum.listtopic" key="topic_one_day"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=2"><lt:Label res="res.label.forum.listtopic" key="topic_two_day"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=7"><lt:Label res="res.label.forum.listtopic" key="topic_week"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=15"><lt:Label res="res.label.forum.listtopic" key="topic_half_month"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=30"><lt:Label res="res.label.forum.listtopic" key="topic_one_month"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=60"><lt:Label res="res.label.forum.listtopic" key="topic_two_month"/></OPTION>
		<OPTION value="listtopic.jsp?boardcode=<%=boardcode%>&timelimit=180"><lt:Label res="res.label.forum.listtopic" key="topic_half_year"/></OPTION>
		</SELECT>
		<script language=javascript>
		</script>
		<script language=javascript><!--
		seltimelimit.value = "listtopic.jsp?boardcode=<%=boardcode%>&timelimit=<%=timelimit%>"
		//-->
		</script>
		&nbsp;		
		<A href="javascript:this.location.reload()" title="<lt:Label res="res.label.forum.listtopic" key="refresh"/>"><IMG src="images/refresh.gif" border=0></A>
	  &nbsp;<a href="rss.jsp?boardCode=<%=StrUtil.UrlEncode(boardcode)%>"><img src="../images/rss.gif" alt="rss<lt:Label res="res.label.forum.listtopic" key="subscription"/>" width="36" height="14" border="0" align="absmiddle"></a></TD>
      </TR>
    </TBODY>
</TABLE>
  <table align="center" width="98%">
    <tr>
      <td height="2px"></td>
    </tr>
  </table>
  <%
ThreadTypeDb ttd = new ThreadTypeDb();
Vector ttv = ttd.getThreadTypesOfBoard(boardcode);
if (ttv.size()>0) {
%>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="5"></td>
    </tr>
    <tr>
      <td><div id="navDiv">
          <table cellpadding="0" cellspacing="1">
            <tr>
              <%
Iterator ir = ttv.iterator();
String className = "";
while (ir.hasNext()) {
	ttd = (ThreadTypeDb)ir.next();
	if (ttd.getId()==threadType)
		className = "td_hover";
	else
		className = "";
	String ttName = ttd.getName();
	if (!ttd.getColor().equals(""))
		ttName = "<font color='" + ttd.getColor() + "'>" + ttName + "</font>";		
%>
              <td class="<%=className%>" onMouseOver="this.className='td_hover'" onMouseOut="this.className='<%=className%>'"><span><a href="<%=ForumPage.getListTopicPage(request, boardcode, 1, 1, ttd.getId())%>"><%=ttName%></a></span></td>
              <%}
	if (threadType==ThreadTypeDb.THREAD_TYPE_NONE)
		className = "td_hover";
	else
		className = "";
%>
              <td class="<%=className%>" onMouseOver="this.className='td_hover'" onMouseOut="this.className='<%=className%>'"><span><a href="<%=ForumPage.getListTopicPage(request, boardcode, 1, 1, ThreadTypeDb.THREAD_TYPE_NONE)%>">
                <lt:Label res="res.label.forum.listtopic" key="topic_all"/>
              </a></span></td>
            </tr>
          </table>
      </div></td>
    </tr>
  </table>
  <%}%>
  <%
String sql = SQLBuilder.getListtopicSql(boardcode, op, timelimit, threadType);

MsgDb msgdb = new MsgDb();
int total = msgdb.getThreadsCount(sql, boardcode);

int pagesize = 20;
		
ForumPaginator paginator = new ForumPaginator(request, total, pagesize);
int curpage = paginator.getCPage(request);
int totalpages = paginator.getTotalPages();
if (totalpages==0)
{
	curpage = 1;
	totalpages = 1;
}
		
long start = (curpage-1)*pagesize;
long end = curpage*pagesize;
		
ThreadBlockIterator irmsg = msgdb.getThreads(sql, boardcode, start, end);
%>
  <TABLE borderColor=#edeced cellSpacing=0 cellPadding=1 width="98%" align=center border=1 class="list">
    <TBODY>
      <TR height=25> 
        <TD height="26" colSpan=3 align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title">
		<lt:Label res="res.label.forum.listtopic" key="topis_list"/></TD>
        <TD width=91 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.forum.listtopic" key="author"/></TD>
        <TD width=55 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.forum.listtopic" key="reply"/></TD>
        <TD width=55 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.forum.listtopic" key="hit"/></TD>
        <TD width=80 height="26" align=middle noWrap background="<%=skinPath%>/images/bg1.gif" class="list_title_date"><lt:Label res="res.label.forum.listtopic" key="reply_date"/></TD>
      </TR>
    </TBODY>
  </TABLE>
<%		
String id="",topic = "",name="",lydate="",rename="",redate="";
int level=0,iselite=0,islocked=0,expression=0;
int i = 0,recount=0,hit=0,type=0;
// 取出论坛置顶的贴子
ForumDb forum = new ForumDb();
long[] topmsgs = forum.getTopMsgs();
int tlen = topmsgs.length;
com.redmoon.forum.person.UserMgr um = new com.redmoon.forum.person.UserMgr();
UserDb ud = null;
UserDb reUserDb = null;
while (i<tlen) {
	 	  msgdb = msgdb.getMsgDb((int)topmsgs[i]);
		  i++;
		  id = ""+msgdb.getId();
		  topic = StrUtil.toHtml(msgdb.getTitle());
		  name = msgdb.getName();
		  ud = um.getUser(name);
		  lydate = com.redmoon.forum.ForumSkin.formatDateTime(request, msgdb.getAddDate());
		  recount = msgdb.getRecount();
		  hit = msgdb.getHit();
		  expression = msgdb.getExpression();
		  type = msgdb.getType();
		  iselite = msgdb.getIsElite();
		  islocked = msgdb.getIsLocked();
		  level = msgdb.getLevel();
		  rename = StrUtil.getNullString(msgdb.getRename());
		  if (!rename.equals(""))
			  reUserDb = um.getUser(rename);
		  redate = com.redmoon.forum.ForumSkin.formatDateTime(request, msgdb.getRedate());
	  %>
<table class="list" bordercolor="<%=skin.getTableBorderClr()%>" cellspacing=0 cellpadding=1 width="98%" align=center border=1>
    <tbody>
      <tr> 
        <td noWrap align=middle width=30 bgcolor=#f8f8f8> 
				<%if (recount>20){ %>
					<img alt="<lt:Label res="res.label.forum.listtopic" key="open_topic_hot"/>" src="<%=skinPath%>/images/f_hot.gif"> 
				<%}
	  			else if (recount>0) {%>
					<img alt="<lt:Label res="res.label.forum.listtopic" key="open_topic_reply"/>" src="<%=skinPath%>/images/f_new.gif">
				<%}
	  			else {%>
					<img alt="<lt:Label res="res.label.forum.listtopic" key="open_topic_no_reply"/>" src="<%=skinPath%>/images/f_norm.gif">
				<%}%>		</td>
        <td class="list_td_emote" align=middle width=17 bgcolor=#ffffff> <% String urlboardname = StrUtil.UrlEncode(boardname,"utf-8"); %> <a href="<%=ForumPage.getShowTopicPage(request, 1, msgdb.getId(), msgdb.getId(), 1, "")%>" target=_blank> 
          <% 
		  if (islocked==1) { %>
          <IMG height=15 alt="" src="<%=skinPath%>/images/f_locked.gif" width=17 border=0> 
          <% }
		  else {
			  if (type==1) { %>
          <IMG height=15 alt="" src="<%=skinPath%>/images/f_poll.gif" width=17 border=0> 
          <%}else { %>
          <img src="images/brow/<%=expression%>.gif" border=0> 
          <%}
		  } %>
          </a></td>
        <td onMouseOver="this.style.backgroundColor='#ffffff'" 
    onMouseOut="this.style.backgroundColor=''" align=left bgcolor=#f8f8f8><%
		if (recount>0) {
		%>
          <img id=followImg<%=id%> title="<lt:Label res="res.label.forum.listtopic" key="collapse_reply"/>" style="CURSOR: hand" onClick="loadThreadFollow(<%=id%>,<%=id%>,'&boardcode=<%=boardcode%>')" src="<%=skinPath%>/images/minus.gif" loaded="no">
          <% }else { %>
    <img id=followImg<%=id%> title="<lt:Label res="res.label.forum.listtopic" key="no_reply"/>" src="<%=skinPath%>/images/minus.gif" loaded="no">
    <% } %>
    <strong><lt:Label res="res.label.forum.listtopic" key="top"/></strong>
    <!--<a href="showtopic_tree.jsp?rootid=<%=id%>">(树形)<%=topic%></a>-->
    <%
		  String attIcon = MsgUtil.getIconImg(msgdb);
		  if (!attIcon.equals("")) {
		  	out.print("<img src='../images/fileicon/" + attIcon + "'>");
		  }
		  %>
    <a href="<%=ForumPage.getShowTopicPage(request, msgdb.getId())%>">
    <%
		String color = StrUtil.getNullString(msgdb.getColor());
		String tp = topic;
		if (!color.equals(""))
			tp = "<font color='" + color + "'>" + tp + "</font>";
		if (msgdb.isBold())
			tp = "<B>" + tp + "</B>";
	%>
    <%=tp%> </a>
    <%if (iselite==1) { %>
    <IMG src="images/topicgood.gif">
    <%}%>
    <%
		//计算共有多少页回贴
		int allpages = Math.round((float)recount/10+0.5f);
		if (allpages>1)
		{
			int pg = allpages;
			if (allpages>10)
				pg = 10;
		 	out.print("[");
			for (int m=1; m<=pg; m++)
			{%>
    <a href="<%=ForumPage.getShowTopicPage(request, msgdb.getId(), m)%>"><%=m%></a>
    <%}
			if (allpages>10) {%>
...<a href="<%=ForumPage.getShowTopicPage(request, msgdb.getId(), allpages)%>"><%=allpages%></a>
<%}
		  	out.print("]");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -