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

📄 catalog.jsp

📁 LyBBS基于Struts1.3/Ajax的架构
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ include file="common/include/taglibs.jsp" %>
<html:html>
<head>
<title><lybbs:web key="forumName"/></title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="bookmark" href="favicon.ico" type="image/x-icon">
<%@ include file="common/include/header.jsp" %>
</head>
<body topmargin=0 leftmargin=0>
<TABLE class=tableCommonStyle cellSpacing=1 cellPadding=3 border=0 align=center>
 <TR>
  <TD height=4 class=bgStyle></TD>
 </TR>
 <TR>
  <TD class=noBgStyle>
    <lybbs:typeAdTag/>
  </TD>
 </TR>
 <TR>
  <TD height=4 class=bgStyle></TD>
 </TR>
 <tr>
  <td class=menuStyle height=22>
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td align=left>
    <lybbs:typeUserHeaderTag forumID="0"/>
    </td>
    <td align=right>
      <lybbs:web key="returnHomeLink"/>
    </td>
    </tr>
    </table>
  </td>
 </tr>
</table>
<br>
<table class=tableCommonStyle cellpadding=3 cellspacing=1 border=0 align=center>
 <tr>
  <td class=navStyle vAlign=center height=25>
    <img src="lybbs/images/forum_nav.gif" width="9" height="9" align="absMiddle"> <a href="bbs_index.do"><lybbs:web key="forumName"/></a> <bean:message key="common.lybbs.arrow"/> <bean:message key="jsp.admincenter.forum.catalogname"/>
  </td>
 </tr>
</table>
<br>
<lybbs:typeHomePageNewTopicTag/>
<span id="catalogStr0" style='DISPLAY: none'></span>
<lybbs:web key="foot"/>

<script language="JavaScript">
var catalogStr='';
var sessionHiddenCatalogIDStr="<bean:write name="userBean" property="hiddenCatalogIDStr" scope="session"/>";
var sessionHiddenForumIDStr="<bean:write name="userBean" property="hiddenForumIDStr" scope="session"/>";
function doOpenCatalog(catalogID,spanId,expand) {
  buffalo.remoteCall("commonService.doOpenCatalog",[catalogID,expand], function(reply) {
    var result=reply.getResult();
    //if catalogID does not exist, return catalog[0],so here not be null forever.
    if(result!=null) {
      var currentCatalogIDStr=","+catalogID+",";
      if(expand && sessionHiddenCatalogIDStr.indexOf(currentCatalogIDStr)!=-1) {
        sessionHiddenCatalogIDStr=sessionHiddenCatalogIDStr.replace(currentCatalogIDStr,",");
      }
      else if(!expand && sessionHiddenCatalogIDStr.indexOf(currentCatalogIDStr)==-1) {
        sessionHiddenCatalogIDStr=sessionHiddenCatalogIDStr+catalogID+",";
      }
      showCatalog(result,spanId);
    }
  });
}
function doOpenCatalog2(catalogID,spanId) {
  buffalo.remoteCall("commonService.doOpenCatalog2",[catalogID], function(reply) {
    var result=reply.getResult();
    //if catalogID does not exist, return catalog[0],so here not be null forever.
    if(result!=null) {
      showCatalog(result,spanId);
    }
  });
}
function showCatalog(catalog,i) {
  catalogStr='';
  var catalogTarget = document.getElementById("catalogStr"+i);
  if(catalogTarget==null) {
    alert("You need add span named catalogStr to your bbs_index.jsp.");
  }
  else {
    var currentCatalogIDStr=","+catalog.catalogID+",";
    var isCatalogExpand=false;
    if(sessionHiddenCatalogIDStr.length==0) {
      isCatalogExpand=catalog.catalogExpand=="1"?true:false;
    }
    else {
      isCatalogExpand=sessionHiddenCatalogIDStr.indexOf(currentCatalogIDStr)==-1?true:false;
    }
    catalogStr+="<table class=tableCommonStyle cellpadding=0 cellspacing=1 align=center border=0><tr><td height=30 class=catStyle colspan=2><table width=100% cellpadding=0 cellspacing=0 border=0><tr><td align=left class=catFontStyle>";
    catalogStr+=isCatalogExpand?"&nbsp;<a href='javascript:doOpenCatalog("+catalog.catalogID+","+i+",false)'><img src=lybbs/images/cat1.gif border=0></a>&nbsp;":"&nbsp;<a href='javascript:doOpenCatalog("+catalog.catalogID+","+i+",true)'><img src=lybbs/images/cat.gif border=0></a>&nbsp;";
    catalogStr+="<b>"+catalog.catalogName+"</b></td><td align=right>";
    printCatalogAdmin(catalog.catalogAdmin);
    catalogStr+=" <a href='#top'><img src='lybbs/images/gotop.gif' align='absbottom' border=0></a> <a href='#bottom'><img src='lybbs/images/gobottom.gif' align='absbottom' border=0></a></td></tr></table></td></tr></table>";
    
    isCatalogExpand?expandCatalog(catalog.primaryForumList):shrinkCatalog(catalog.primaryForumList);
    catalogTarget.style.display='';
    catalogTarget.innerHTML=catalogStr;
  }
}
function printCatalogAdmin(catalogAdminNameAll) {
  if(catalogAdminNameAll!=null && catalogAdminNameAll.length>0) {
    catalogStr+="<select name=catalogAdminName><option><bean:message key="common.lybbs.catalogadmin"/></option><option>---------------</option>";
    var catalogAdminNameArray=catalogAdminNameAll.split(',');
    for(var i=0,m=catalogAdminNameArray.length;i<m;i++) {
      catalogStr+="<option>"+catalogAdminNameArray[i]+"</option>";
    }
    catalogStr+="</select>";
  }
}
function expandCatalog(forumList) {
  if(forumList!=null) {
    var forum;
    var lastTopic;
    catalogStr+="<table class=tableCommonStyle cellpadding=0 cellspacing=1 align=center border=0>";
    catalogStr+="<tr>";
    for(var i=0,m=forumList.length;i<m;i++) {
      forum=forumList[i];
      if(sessionHiddenForumIDStr.length>0 && sessionHiddenForumIDStr.indexOf(forum.forumID)!=-1) {
        continue;
      }
      lastTopic=forum.lastTopic;
      
      catalogStr+="<td class=forumColorOne align=center width=30>";
      catalogStr+="<img src=lybbs/images/"+forum.forumIcon+" width=13 height=16 border=0>";
      catalogStr+="</td>";
      catalogStr+="<td class=forumColorTwo>";
      catalogStr+="<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>";
      catalogStr+="<tr>";
      catalogStr+="<td>";
      catalogStr+="<table width=100% cellpadding=0 cellspacing=0 border=0>";
      catalogStr+="<tr>";
      catalogStr+="<td width=5></td>";
      catalogStr+="<td width=1>";
      if(forum.teamLogo!=null && forum.teamLogo.length>0) {
        catalogStr+="<a href=";
        //firefox deal "" as null
        if(forum.teamUrl==null || forum.teamUrl.length==0 || forum.teamUrl=="http://") {
          catalogStr+="bbs_forum.do?forumID="+forum.forumID;
        }
        else {
          catalogStr+=forum.teamUrl;
        }
        catalogStr+="><img src="+forum.teamLogo+" border=0 align=center></a>";
      }
      catalogStr+="</td>";
      catalogStr+="<td width=5></td>";
      catalogStr+="<td>";
      catalogStr+="<table width=100% cellpadding=0 cellspacing=0 border=0>";
      catalogStr+="<tr>";
      catalogStr+="<td valign=middle>";
      catalogStr+="<a href=bbs_forum.do?forumID="+forum.forumID+">『 "+forum.forumName+" 』</a>";
      if(forum.secondaryForumNumber>0) {
        catalogStr+="&nbsp;("+forum.secondaryForumNumber+")";
      }
      catalogStr+="</td>";
      catalogStr+="<td align=right>";
      catalogStr+=" <a href='bbs_post.do?action=new&forumID="+forum.forumID+"'><img src='lybbs/images/ipost1.gif' width=12 height=13 border=0 alt='<bean:message key="tag.typehomepagepost.postnew"/>'></a>";
      catalogStr+=" <a href='bbs_post.do?action=poll&forumID="+forum.forumID+"'><img src='lybbs/images/ipost2.gif' width=12 height=13 border=0 alt='<bean:message key="tag.typehomepagepost.pollnew"/>'></a>";
      catalogStr+=" <a href='bbs_forum.do?forumID="+forum.forumID+"&readFlag=1'><img src='lybbs/images/ipost3.gif' width=12 height=13 border=0 alt='<bean:message key="tag.typehomepagepost.jinghua"/>'></a>";
      catalogStr+="</td>";
      catalogStr+="</tr>";
      catalogStr+="<tr>";
      catalogStr+="<td background=lybbs/images/dian.gif height=1 colspan=2></td>";
      catalogStr+="</tr>";
      catalogStr+="<tr>";
      catalogStr+="<td colspan=2 style='LINE-HEIGHT: 18px' valign=middle>";
      catalogStr+="<IMG src='lybbs/images/dot.bmp' width=10 height=10 valign=middle>";
      catalogStr+=forum.forumDescription;
      if(forum.secondaryForumNumber>0) {
        catalogStr+="<br>";
        catalogStr+="<IMG src='lybbs/images/dot.bmp' width=10 height=10 valign=middle>";
        catalogStr+="<bean:message key="jsp.admincenter.forum.secondaryforum"/>"
        catalogStr+=":&nbsp;";
        processSecondaryForumList(forum.secondaryForumList);
      }
      catalogStr+="</td>";
      catalogStr+="</tr>";
      catalogStr+="</table>";
      catalogStr+="</td>";
      catalogStr+="<td width=10></td>";
      catalogStr+="</tr>";
      catalogStr+="</table>";
      
      catalogStr+="</td>";
      catalogStr+="<td width=305 valign=middle>";
      catalogStr+="&nbsp;";
      if(lastTopic.topicNumber==0) {
        catalogStr+="<bean:message key="tag.typehomepagepost.nopost"/>";
      }
      else {
        catalogStr+="<bean:message key="common.lybbs.subject"/>";
        catalogStr+=":&nbsp;<a href=bbs_topic.do?forumID="+forum.forumID+"&postID="+lastTopic.lastPostID+"&replyNum=last title=\""+lastTopic.lastPostTitle+"\">";
        catalogStr+=lastTopic.lastPostClue;
        catalogStr+="</a><BR>";
        catalogStr+="&nbsp;<bean:message key="common.lybbs.reply"/>";
        catalogStr+=":&nbsp;<a href=\"bbs_userShow.do?userID="+lastTopic.lastPostAuthorID+"\"><span class=lastPostUser>";
        catalogStr+=lastTopic.lastPostAuthor;
        catalogStr+="</span></a> <img src='lybbs/images/lastpost.gif' width=11 height=10><BR>";
        catalogStr+="&nbsp;<bean:message key="common.lybbs.date"/>";
        catalogStr+=":&nbsp;"+lastTopic.lastPostAt;
        catalogStr+="<BR>";
      }
      catalogStr+="</td>";
      catalogStr+="</tr>";
      catalogStr+="<tr>";
      catalogStr+="<td background='lybbs/images/dian.gif' height=1 colspan=2></td>";
      catalogStr+="</tr>";
      catalogStr+="<tr>";
      catalogStr+="<td class=navStyle valign=middle height=28> &nbsp;<bean:message key="common.lybbs.admin"/>";
      catalogStr+=":";
      printForumAdmin(forum.forumAdmin,0);
      catalogStr+="</td>";
      catalogStr+="<td class=navStyle valign=middle>";
      catalogStr+=" &nbsp;<bean:message key="common.lybbs.post.todaynumber"/>";
      catalogStr+=" <font color=#FF0000>"+lastTopic.todayPostNumber;
      catalogStr+="</font> <bean:message key="common.lybbs.post.yesterdaynumber"/>";
      catalogStr+=" "+lastTopic.yesterdayPostNumber;
      catalogStr+="&nbsp;";
      if(false) {
        //topicNumber,totalNumber
        catalogStr+="<bean:message key="common.lybbs.topicnumber"/> "+lastTopic.topicNumber;
        catalogStr+=" <bean:message key="common.lybbs.totalnumber"/>";
        catalogStr+=" "+(lastTopic.topicNumber+lastTopic.replyNumber);
      }
      else {
        //topicNumber,replyNumber
        catalogStr+="<bean:message key="common.lybbs.topicnumber"/> "+lastTopic.topicNumber;
        catalogStr+=" <bean:message key="common.lybbs.replynumber"/>";
        catalogStr+=" "+lastTopic.replyNumber;
      }
      catalogStr+="</td>";
      catalogStr+="</tr>";
      catalogStr+="</table>";
      catalogStr+="</td></tr>";
    }
    catalogStr+="</table><br>";
  }
}
function shrinkCatalog(forumList) {
  if(forumList!=null) {
    var forum;
    var lastTopic;
    catalogStr+="<table class=tableCommonStyle cellpadding=0 cellspacing=1 align=center border=0>";
    catalogStr+="<tr>";
    var i=0;
    for(var m=forumList.length;i<m;i++) {
      forum=forumList[i];
      if(i%4==0) {
        catalogStr+="<tr>";
      }
      catalogStr+="<td width=25% class=forumColorTwo>";
      catalogStr+="<table width=100% cellpadding=0 cellspacing=0 border=0>";
      catalogStr+="<tr>";
      catalogStr+="<td class=forumColorTwo height=30>";
      catalogStr+="&nbsp;<a href=bbs_forum.do?forumID="+forum.forumID+">『 "+forum.forumName+" 』</a>";
      if(forum.secondaryForumNumber>0) {
        catalogStr+="&nbsp;("+forum.secondaryForumNumber+")";
      }
      catalogStr+="</td>";
      catalogStr+="</tr>";
      catalogStr+="<tr>";
      catalogStr+="<td class=navStyle height=25>&nbsp;&nbsp;<bean:message key="common.lybbs.admin"/>";
      catalogStr+=":";
      printForumAdmin(forum.forumAdmin,0);
      catalogStr+="</td>";
      catalogStr+="</tr>";
      catalogStr+="</table>";
      catalogStr+="</td>";
      if(i%4==3) {
        catalogStr+="</tr>";
      }
    }
    var k=i%4;
    if(k>0) {
      for(;k<4;k++) {
        catalogStr+="<td width=25%><table width=100% cellpadding=0 cellspacing=0 border=0><tr><td class=forumColorTwo height=30></td></tr><tr><td class=navStyle height=25></table></td>";
      }
      catalogStr+="</tr>";
    }
    catalogStr+="</table><br>";
  }
}
function processSecondaryForumList(forumList) {
  if(forumList!=null) {
    var forum;
    for(var i=0,m=forumList.length;i<m;i++) {
      forum=forumList[i];
      catalogStr+="<a href=bbs_forum.do?forumID="+forum.forumID+">"+forum.forumName+"</a>&nbsp;&nbsp;";
    }
  }
}
function printForumAdmin(forumAdminNameAll,maxNum) {
  if(forumAdminNameAll==null || forumAdminNameAll.length==0) {
     catalogStr+="<bean:message key="tag.typehomepagepost.tempopen"/>";
  }
  else {
    var forumAdminNameArray = forumAdminNameAll.split(",");
    for(var k=0;k<forumAdminNameArray.length;k++) {
      if(maxNum>0 && k>=maxNum) {
        catalogStr+="more";
        break;
      }
      catalogStr+="<a href='bbs_userShow.do?userName="+forumAdminNameArray[k]+"' title='<bean:message key="common.lybbs.forumadmin"/>'><span class=modUser>"+forumAdminNameArray[k]+"</span></a> ";
    }
  }
}
doOpenCatalog2(<bean:write name="catalogID"/>,0);
</script>
</body>
</html:html>

⌨️ 快捷键说明

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