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

📄 listforum.java

📁 BBS-CS是采用JSP+JavaBean+Servlet开发的一套网络虚拟社区系统. 运行平台: Liunx + JDK + Apache + Tomcat + MYSQL 或 Window
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package com.laoer.bbscs.bbs;import java.sql.*;import java.io.*;import java.util.*;import com.laoer.bbscs.db.*;import com.laoer.bbscs.txthtml.*;import com.laoer.bbscs.admin.BBSConf;/** * <p>Title: BBS-CS</p> * <p>Description: BBS-CS(BBS式虚拟社区系统)</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: loveroom.com.cn</p> * @author 龚天乙(laoer) * @version 3.0 */public class ListForum {  String SQL = "";  DbTrans DBSQL;  DoText myDoText;  DoDate myDoDate;  ResultSet rs = null;  public ListForum() {      this.DBSQL = new DbTrans();      this.myDoText = new DoText();      this.myDoDate = new DoDate();  }  public String getListForum(ResultSet rsListForum, String tablemaincolor, String tabletintcolor, String tabledarkcolor, String bid, String pages) {      String strListForum = "";      String tablecolor = "";      strListForum += "<table width=98% border=0 align=center cellpadding=1 cellspacing=1 style=\"table-layout:fixed;word-break:break-all\">\n<tr bgcolor="+tablemaincolor+">";      strListForum += "<td width=5%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>回复</span></font></div>\n";      strListForum += "</td>\n<td width=7%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>表情</span></font></div>\n";      strListForum += "</td>\n<td width=55%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>题目</span></font></div>\n";      strListForum += "</td>\n<td width=20%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>发表人</span></font></div>\n";      strListForum += "</td>\n<td width=11%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>时间</span></font></div>\n";      strListForum += "</td>\n</tr>\n";      /*try {          while (rsListForum.next()) {              strListForum += rsListForum.getString("name");          }          rsListForum.close();      }      catch (SQLException e) {      }*/      try {           int i = 1;           int n = 2;           while (rsListForum.next()) {               if ((i %= n)==1) {                   tablecolor = tabletintcolor;               }               else {                   tablecolor = tabledarkcolor;               }               strListForum += "<tr bgcolor="+ tablecolor +">\n";               strListForum += "<td width=5%><CENTER><span class=bt>";               if (rsListForum.getInt("re")==0) {                   strListForum += rsListForum.getString("artsize");               }               else {                   strListForum += "<font color=#ff0000>[+"+ rsListForum.getInt("re") +"]<font>";               }               strListForum += "</span></CENTER></td>\n";               strListForum += "<td width=7%>&nbsp;<img src='images/"+rsListForum.getInt("bq")+".gif'>";               if (rsListForum.getInt("cannotdel")==1) {                   strListForum += "<font color=#8f0000>&nbsp;M</font>";               }               strListForum += "</td>\n";               strListForum += "<td width=55%><a href='showdoc.jsp?bid="+bid+"&recid="+rsListForum.getInt("id")+"&pages="+pages+"' title ='点击:"+rsListForum.getInt("click")+"'>"+myDoText.iso2gb(rsListForum.getString("title"))+"</a>";               if (rsListForum.getInt("jd") != 0) {                   strListForum += "<font color=#FF0000><span class=bt>荐</span></font>";               }               strListForum += "</td>\n";               strListForum += "<td ALIGN=left nowrap><span class=bt><a href='userinfo.jsp?UID="+rsListForum.getInt("UID")+"'>"+myDoText.iso2gb(rsListForum.getString("nickname"))+" <font color=#666666>["+ myDoText.iso2gb(rsListForum.getString("name")) +"]</font></a></span></td>\n";               strListForum += "<td width=11%><CENTER><span class=bt>"+ myDoDate.fotmatDate6(rsListForum.getTimestamp("time"))+"</span></CENTER></td></tr>\n";           i++;           }           rsListForum.close();      }      catch (SQLException e) {      }      strListForum += "</table>";      return strListForum;  }    public String getListForumS(ResultSet rsListForum, String tablemaincolor, String tabletintcolor, String tabledarkcolor, String bid, String pages,String tj,String zhuti) {      String strListForum = "";      String tablecolor = "";      strListForum += "<table width=98% border=0 align=center cellpadding=1 cellspacing=1 style=\"table-layout:fixed;word-break:break-all\">\n<tr bgcolor="+tablemaincolor+">";      strListForum += "<td width=5%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>回复</span></font></div>\n";      strListForum += "</td>\n<td width=7%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>表情</span></font></div>\n";      strListForum += "</td>\n<td width=55%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>题目</span></font></div>\n";      strListForum += "</td>\n<td width=20%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>发表人</span></font></div>\n";      strListForum += "</td>\n<td width=11%>\n";      strListForum += "<div align=center><font color=#FFFFFF><span class=bt>时间</span></font></div>\n";      strListForum += "</td>\n</tr>\n";      /*try {          while (rsListForum.next()) {              strListForum += rsListForum.getString("name");          }          rsListForum.close();      }      catch (SQLException e) {      }*/      try {           int i = 1;           int n = 2;           while (rsListForum.next()) {               if ((i %= n)==1) {                   tablecolor = tabletintcolor;               }               else {                   tablecolor = tabledarkcolor;               }               strListForum += "<tr bgcolor="+ tablecolor +">\n";               strListForum += "<td width=5%><CENTER><span class=bt>";               if (rsListForum.getInt("re")==0) {                   strListForum += rsListForum.getString("artsize");               }               else {                   strListForum += "<font color=#ff0000>[+"+ rsListForum.getInt("re") +"]<font>";               }               strListForum += "</span></CENTER></td>\n";               strListForum += "<td width=7%>&nbsp;<img src='images/"+rsListForum.getInt("bq")+".gif'>";               if (rsListForum.getInt("cannotdel")==1) {                   strListForum += "<font color=#8f0000>&nbsp;M</font>";               }               strListForum += "</td>\n";               strListForum += "<td width=55%><a href='readsc.jsp?bid="+bid+"&recid="+rsListForum.getInt("id")+"&pages="+pages+"&tj="+tj+"&zhuti="+java.net.URLEncoder.encode(myDoText.iso2gb(zhuti))+"&search=1' title ='点击:"+rsListForum.getInt("click")+"'>"+myDoText.iso2gb(rsListForum.getString("title"))+"</a>";               if (rsListForum.getInt("jd") != 0) {                   strListForum += "<font color=#FF0000><span class=bt>荐</span></font>";               }               strListForum += "</td>\n";               strListForum += "<td ALIGN=left nowrap><span class=bt><a href='userinfo.jsp?UID="+rsListForum.getInt("UID")+"'>"+myDoText.iso2gb(rsListForum.getString("nickname"))+" <font color=#666666>["+ myDoText.iso2gb(rsListForum.getString("name")) +"]</font></a></span></td>\n";               strListForum += "<td width=11%><CENTER><span class=bt>"+ myDoDate.fotmatDate6(rsListForum.getTimestamp("time"))+"</span></CENTER></td></tr>\n";           i++;           }           rsListForum.close();      }      catch (SQLException e) {

⌨️ 快捷键说明

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