📄 forumcomponent.java
字号:
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</strong></font>");
sb.append("</a>");
} else {
sb.append("<a href=\"");
if (Constant.USE_URL_REWRITE) {
sb.append("read-history-" + f.getBoardID() + "-" + f.getMainID() + "-" + tagId + "-" + fcpage + "-"
+ fcaction + "-1" + ".html");
} else {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=history&id=" + f.getMainID() + "&bid="
+ f.getBoardID() + "&fcpage=" + fcpage + "&fcaction=" + fcaction + "&tagId=" + tagId,
request));
}
sb.append("\">");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</a>");
}
this.write(writer, sb.toString());
return result;
}
if (type.equalsIgnoreCase("titlemanage")) {
Object boardObj = this.getStack().findValue(this.boardValue);
int boardType = 3;
Board board = (Board) boardObj;
boardType = board.getBoardType();
int fcpage = 1;
String fcaction = "index";
String tagId = "0";
if (boardType == 2) {
if (board.getId().longValue() != f.getBoardID()) {
sb.append("[");
sb.append(f.getBoardName());
sb.append("] ");
}
}
if (!f.getTagID().equals("0")) {
sb.append("[");
sb.append(f.getTagName());
sb.append("] ");
}
if (f.getIsVote() == 1) {
// sb.append("[投票] ");
sb.append(messageSource.getMessage("post.vote.title", null, this.request.getLocale()));
sb.append(" ");
}
if (f.getTitleColor() != 0) {
sb.append("<a href=\"");
if (Constant.USE_URL_REWRITE) {
sb.append("read-topic-" + f.getBoardID() + "-" + f.getMainID() + "-" + tagId + "-" + fcpage + "-"
+ fcaction + "-1" + ".html");
} else {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=topic&id=" + f.getMainID() + "&bid="
+ f.getBoardID() + "&fcpage=" + fcpage + "&fcaction=" + fcaction + "&tagId=" + tagId,
request));
}
sb.append("\">");
sb.append("<font color=\"");
sb.append(Constant.TITLECOLOR[f.getTitleColor()]);
sb.append("\"><strong>");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</strong></font>");
sb.append("</a>");
} else {
sb.append("<a href=\"");
if (Constant.USE_URL_REWRITE) {
sb.append("read-topic-" + f.getBoardID() + "-" + f.getMainID() + "-" + tagId + "-" + fcpage + "-"
+ fcaction + "-1" + ".html");
} else {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=topic&id=" + f.getMainID() + "&bid="
+ f.getBoardID() + "&fcpage=" + fcpage + "&fcaction=" + fcaction + "&tagId=" + tagId,
request));
}
sb.append("\">");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</a>");
}
this.write(writer, sb.toString());
return result;
}
if (type.equalsIgnoreCase("titlewaste")) {
Object boardObj = this.getStack().findValue(this.boardValue);
int boardType = 3;
Board board = (Board) boardObj;
boardType = board.getBoardType();
String tagId = "0";
Object tagIdObj = this.getStack().findValue(this.tagIdValue);
if (tagIdObj != null) {
tagId = (String) tagIdObj;
}
if (boardType == 2) {
if (board.getId().longValue() != f.getBoardID()) {
sb.append("[");
sb.append(f.getBoardName());
sb.append("] ");
}
}
if (!f.getTagID().equals("0") && tagId.equals("0")) {
sb.append("[");
sb.append(f.getTagName());
sb.append("] ");
}
if (f.getIsVote() == 1) {
// sb.append("[投票] ");
sb.append(messageSource.getMessage("post.vote.title", null, this.request.getLocale()));
sb.append(" ");
}
if (f.getTitleColor() != 0) {
sb.append("<a href=\"");
sb.append(BBSCSUtil.getActionMappingURL("/read?action=waste&mainid=" + f.getMainID() + "&bid="
+ f.getBoardID(), request));
sb.append("\">");
sb.append("<font color=\"");
sb.append(Constant.TITLECOLOR[f.getTitleColor()]);
sb.append("\"><strong>");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</strong></font>");
sb.append("</a>");
} else {
sb.append("<a href=\"");
sb.append(BBSCSUtil.getActionMappingURL("/read?action=waste&mainid=" + f.getMainID() + "&bid="
+ f.getBoardID(), request));
sb.append("\">");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</a>");
}
this.write(writer, sb.toString());
return result;
}
if (type.equalsIgnoreCase("titleauditing") || type.equalsIgnoreCase("titleauditingattach")) {
Object boardObj = this.getStack().findValue(this.boardValue);
int boardType = 3;
Board board = (Board) boardObj;
boardType = board.getBoardType();
String tagId = "0";
Object tagIdObj = this.getStack().findValue(this.tagIdValue);
if (tagIdObj != null) {
tagId = (String) tagIdObj;
}
if (boardType == 2) {
if (board.getId().longValue() != f.getBoardID()) {
sb.append("[");
sb.append(f.getBoardName());
sb.append("] ");
}
}
if (!f.getTagID().equals("0") && tagId.equals("0")) {
sb.append("[");
sb.append(f.getTagName());
sb.append("] ");
}
if (f.getIsVote() == 1) {
// sb.append("[投票] ");
sb.append(messageSource.getMessage("post.vote.title", null, this.request.getLocale()));
sb.append(" ");
}
if (f.getTitleColor() != 0) {
sb.append("<a href=\"");
if (type.equalsIgnoreCase("titleauditing")) {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=auditing&mainid=" + f.getMainID() + "&bid="
+ f.getBoardID(), request));
}
if (type.equalsIgnoreCase("titleauditingattach")) {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=auditingAttach&mainid=" + f.getMainID()
+ "&bid=" + f.getBoardID(), request));
}
sb.append("\">");
sb.append("<font color=\"");
sb.append(Constant.TITLECOLOR[f.getTitleColor()]);
sb.append("\"><strong>");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</strong></font>");
sb.append("</a>");
} else {
sb.append("<a href=\"");
if (type.equalsIgnoreCase("titleauditing")) {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=auditing&mainid=" + f.getMainID() + "&bid="
+ f.getBoardID(), request));
}
if (type.equalsIgnoreCase("titleauditingattach")) {
sb.append(BBSCSUtil.getActionMappingURL("/read?action=auditingAttach&mainid=" + f.getMainID()
+ "&bid=" + f.getBoardID(), request));
}
sb.append("\">");
sb.append(TextUtils.htmlEncode(f.getTitle()));
sb.append("</a>");
}
this.write(writer, sb.toString());
return result;
}
if (type.equalsIgnoreCase("titleitem")) {
if (sysConfig.getUseLinkToPages() == 1) {
UserCookie uc = new UserCookie(request, response, sysConfig);
Object forumCurrentPageObj = this.getStack().findValue(this.currentPageValue);
int fcpage = 1;
if (forumCurrentPageObj != null) {
fcpage = ((Integer) forumCurrentPageObj).intValue();
}
String fcaction = "index";
Object fcactionObj = this.getStack().findValue(this.currentActionValue);
if (fcactionObj != null) {
fcaction = (String) fcactionObj;
}
String tagId = "0";
Object tagIdObj = this.getStack().findValue(this.tagIdValue);
if (tagIdObj != null) {
tagId = (String) tagIdObj;
}
int totalNum = f.getReNum() + 1;
int perNum = this.getUserPostPerNum(uc.getPostPerNum(), sysConfig.getPostPerPage());
if (totalNum > perNum) {
sb.append(" [<img src='images/multipage.gif' align='absmiddle'>");
int totalPages = (int) Math.ceil((totalNum + perNum - 1) / perNum);
String fileName = "";
if (Constant.USE_URL_REWRITE) {
fileName = "read-topic-" + f.getBoardID() + "-" + f.getId() + "-" + tagId + "-" + fcpage + "-"
+ fcaction + "-{inpages}.html";
} else {
fileName = BBSCSUtil.getActionMappingURL("/read?action=topic&id=" + f.getId() + "&bid="
+ f.getBoardID() + "&fcpage=" + fcpage + "&fcaction=" + fcaction + "&tagId=" + tagId
+ "&inpages={inpages}", request);
}
for (int i = 1; i <= totalPages; i++) {
if (i > sysConfig.getMaxMultiPage()) {
sb.append(" ... <a href=\"");
// sb.append(fileName);
// sb.append(totalPages);
sb.append(fileName.replaceAll("\\{inpages\\}", String.valueOf(totalPages)));
sb.append("\">");
sb.append(messageSource.getMessage("post.endpage", null, request.getLocale()));
sb.append("</a>");
break;
}
sb.append(" <a href=\"");
// sb.append(fileName);
// sb.append(i);
sb.append(fileName.replaceAll("\\{inpages\\}", String.valueOf(i)));
sb.append("\">");
sb.append(i);
sb.append("</a>");
}
sb.append("] ");
}
}
sb.append("<a href=\"javascript:;\" onclick=\"viewSummary('");
sb.append(f.getBoardID());
sb.append("','");
sb.append(f.getId());
sb.append("');\">");
sb.append("<img src=\"images/summary0.gif\" alt=\"");
sb.append(messageSource.getMessage("post.summary", null, request.getLocale()));
sb.append("\" border=\"0\" align=\"absmiddle\"/>");
sb.append("</a>");
sb.append("<span class=\"");
sb.append(this.getItemClass());
sb.append("\">");
if (f.getHaveAttachFile() != 0 && f.getAttachFileName() != null && !f.getAttachFileName().isEmpty()) {
sb.append(" [<img src=\"images/icons/");
sb.append(BBSCSUtil
.getFileTypeIcon(FilenameUtils.getExtension((String) (f.getAttachFileName().get(0)))));
sb.append("\" align=\"absmiddle\"/> ");
sb.append(messageSource.getMessage("post.attachfile", null, request.getLocale()));
sb.append("]");
}
if (f.getIsTop() != 0) {
sb.append(" ");
sb.append(messageSource.getMessage("post.istop", null, request.getLocale()));
}
if (f.getIsLock() != 0) {
sb.append(" ");
sb.append(messageSource.getMessage("post.islock", null, request.getLocale()));
}
if (f.getElite() != 0) {
sb.append(" ");
sb.append(messageSource.getMessage("post.elite", null, request.getLocale()));
}
if (f.getCommend() != 0) {
sb.append(" ");
sb.append(messageSource.getMessage("post.commend", null, request.getLocale()));
}
sb.append("</span>");
this.write(writer, sb.toString());
return result;
}
if (type.equalsIgnoreCase("titleitemhistory")) {
if (sysConfig.getUseLinkToPages() == 1) {
UserCookie uc = new UserCookie(request, response, sysConfig);
Object forumCurrentPageObj = this.getStack().findValue(this.currentPageValue);
int fcpage = 1;
if (forumCurrentPageObj != null) {
fcpage = ((Integer) forumCurrentPageObj).intValue();
}
String fcaction = "index";
Object fcactionObj = this.getStack().findValue(this.currentActionValue);
if (fcactionObj != null) {
fcaction = (String) fcactionObj;
}
String tagId = "0";
Object tagIdObj = this.getStack().findValue(this.tagIdValue);
if (tagIdObj != null) {
tagId = (String) tagIdObj;
}
int totalNum = f.getReNum() + 1;
int perNum = this.getUserPostPerNum(uc.getPostPerNum(), sysConfig.getPostPerPage());
if (totalNum > perNum) {
sb.append(" [<img src='images/multipage.gif' align='absmiddle'>");
int totalPages = (int) Math.ceil((totalNum + perNum - 1) / perNum);
String fileName = "";
if (Constant.USE_URL_REWRITE) {
fileName = "read-history-" + f.getBoardID() + "-" + f.getId() + "-" + tagId + "-" + fcpage
+ "-" + fcaction + "-{inpages}.html";
} else {
fileName = BBSCSUtil.getActionMappingURL("/read?action=history&id=" + f.getId() + "&bid="
+ f.getBoardID() + "&fcpage=" + fcpage + "&fcaction=" + fcaction + "&tagId=" + tagId
+ "&inpages={inpages}", request);
}
for (int i = 1; i <= totalPages; i++) {
if (i > sysConfig.getMaxMultiPage()) {
sb.append(" ... <a href=\"");
// sb.append(fileName);
// sb.append(totalPages);
sb.append(fileName.replaceAll("\\{inpages\\}", String.valueOf(totalPages)));
sb.append("\">");
sb.append(messageSource.getMessage("post.endpage", null, request.getLocale()));
sb.append("</a>");
break;
}
sb.append(" <a href=\"");
// sb.append(fileName);
// sb.append(i);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -