?? showdoc.java
字號:
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 ShowDoc { String SQL = ""; DbTrans DBSQL; DoText myDoText; ResultSet rs = null; static String strWebURL = ""; public ShowDoc() { this.DBSQL = new DbTrans(); this.myDoText = new DoText(); } public String getShowDoc(String recid,String bid,String pages,String strUserID, String strUserName,String strPost,int attrib,boolean isGuestUser,boolean isSuper,boolean isBulletin,boolean isBoardMaster,boolean isBoardsMaster,boolean isBoardsMaster1,boolean isBoardsMaster2) { BBSConf myBBSConf = new BBSConf(); strWebURL = myBBSConf.getWebURL(); String strShowDoc = ""; setAddClick(recid); String tabledarkcolor = myBBSConf.gettabledarkcolor(); String tablemaincolor = myBBSConf.gettablemaincolor(); String tabletintcolor = myBBSConf.gettabletintcolor(); SQL = "select * from forum where id2="+ recid +" and delsign = 0 order by id"; try { rs = DBSQL.executeQuery(SQL); while (rs.next()) { strShowDoc += "<table width=98% border=0 align=center cellpadding=0 cellspacing=0>\n<tr>\n"; strShowDoc += "<td bgcolor="+tablemaincolor+" height=23> <font color=#FFFFFF>主題:"+myDoText.iso2gb(rs.getString("title"))+"</font></td>\n</tr>\n"; strShowDoc += "<tr>\n"; strShowDoc += "<td height=84 bgcolor="+tabletintcolor+">\n"; strShowDoc += "<table width=98% border=0 align=center>\n<tr>\n"; strShowDoc += "<td width=73%><img src='images/"+rs.getInt("bq")+".gif' align=absmiddle>"; if (rs.getInt("cannotdel")==1) { strShowDoc += "<font color=#8f0000> M</font>"; } strShowDoc += " <span class=bt>作者:"+myDoText.iso2gb(rs.getString("name"))+"("+myDoText.iso2gb(rs.getString("nickname"))+") "+rs.getString("time")+"</td>\n"; strShowDoc += "<td width=25%>\n"; strShowDoc += "<div align=right>"; if (!isGuestUser) { strShowDoc += "<a href='vot.jsp?bid="+bid+"&recid="+rs.getInt("id")+"&mainid="+rs.getInt("id2")+"&pages="+pages+"&action=zc' target=mainFrame>"; strShowDoc += "<img alt=贊成 border=0 height=16 src=images/app.gif width=16></a>:"+rs.getInt("zc"); } else { strShowDoc += " <img alt=贊成 border=0 height=16 src=images/app.gif width=16>:"+rs.getInt("zc"); } if (!isGuestUser) { strShowDoc += " <a href='vot.jsp?bid="+bid+"&recid="+rs.getInt("id")+"&mainid="+rs.getInt("id2")+"&pages="+pages+"&action=fd' target=mainFrame>"; strShowDoc += "<img alt=反對 border=0 height=16 src=images/obj.gif width=16></a>:"+rs.getInt("fd"); } else { strShowDoc += " <img alt=反對 border=0 height=16 src=images/obj.gif width=16>:"+rs.getInt("fd"); } if (!isGuestUser) { strShowDoc += " <a href='userinfo.jsp?UID="+rs.getInt("UID")+"' target=mainFrame><img alt=用戶信息 border=0 height=16 src=images/per_info.gif width=16></a> "; strShowDoc += "<a href='guestbook.jsp?Fname="+myDoText.iso2gb(rs.getString("name"))+"'target=new><img alt=發送短信 border=0 height=16 src=images/sendmsg.gif width=16></a> "; } else { strShowDoc += " <img alt=用戶信息 border=0 height=16 src=images/per_info.gif width=16> "; strShowDoc += "<img alt=發送短信 border=0 height=16 src=images/sendmsg.gif width=16> "; } strShowDoc += "<img alt='用戶IP:"; if (isSuper || isBoardMaster || isBoardsMaster || isBoardsMaster1 || isBoardsMaster2) { strShowDoc += rs.getString("ip"); } else { strShowDoc += "隱藏"; } strShowDoc += "' border=0 height=16 src=images/ip.gif width=16></div>\n</td>\n</tr>\n<tr>"; strShowDoc += "<td colspan=2>\n"; strShowDoc += "<div align=right><span class=bt>"; if ((isSuper || isBoardMaster || isBoardsMaster || isBoardsMaster1 || isBoardsMaster2) && (!isGuestUser)) { strShowDoc += "[<a href='cannotdel.jsp?recid="+ rs.getInt("id") +"&mainid="+ rs.getInt("id2") +"&bid="+ bid +"&pages="+ pages +"&UID="+ rs.getInt("UID") +"' target=mainFrame>保留標記</a>] "; } if ((isSuper || isBoardMaster || isBoardsMaster || isBoardsMaster1 || isBoardsMaster2) && (!isGuestUser)) { strShowDoc += "[<a href='jrjh.jsp?recid="+ rs.getInt("id") +"&mainid="+ rs.getInt("id2") +"&bid="+ bid +"&pages="+ pages +"&UID="+ rs.getInt("UID") +"' target=mainFrame>加入精華</a>] "; } if ((isSuper || isBoardMaster || isBoardsMaster || isBoardsMaster1 || isBoardsMaster2) && (!isGuestUser) && (rs.getInt("havepic")==1)) { strShowDoc += "[<a href='delpic.jsp?recid="+ rs.getInt("id") +"&mainid="+ rs.getInt("id2")+"&bid="+ bid +"&pages="+ pages +"' target=mainFrame>刪除圖片</a>] "; } if ((isSuper || isBoardMaster || isBoardsMaster || isBoardsMaster1 || isBoardsMaster2 || (rs.getString("name").equals(strUserName) && rs.getInt("cannotre") == 0)) && (!isGuestUser)) { strShowDoc += "[<a href='delforum.jsp?recid="+ rs.getInt("id") +"&bid="+ bid +"&pages="+ pages +"' target=mainFrame>刪除</a>] "; } if (((rs.getString("name").equals(strUserName) && rs.getInt("cannotre") == 0) || isSuper || isBoardMaster || isBoardsMaster || isBoardsMaster1 || isBoardsMaster2) && (!isGuestUser)) { strShowDoc += "[<a href='change.jsp?bid="+ bid +"&recid="+ rs.getInt("id") +"&mainid="+ rs.getInt("id2") +"&pages="+ pages +"' target=mainFrame>修改</a>] "; } if (attrib!=2 && strPost.equals("0") && (!isGuestUser)) { strShowDoc += "[<a href='repost.jsp?bid="+bid+"&recid="+rs.getInt("id")+"&mainid="+rs.getInt("id2")+"&pages="+pages+"' target=mainFrame>回復</a>] "; } if (!isGuestUser) { strShowDoc += "[<a href='zhuantie.jsp?bid="+bid+"&recid="+rs.getInt("id")+"&mainid="+rs.getInt("id2")+"&pages="+pages+"' target=mainFrame>轉貼</a>]</span></div>"; } strShowDoc += "</td>\n</tr>\n"; strShowDoc += "<tr bgcolor=#FFFFFF>\n"; strShowDoc += "<td colspan=2 height=13>\n"; strShowDoc += "<table width=98% border=0 align=center cellpadding=2 cellspacing=3>\n"; strShowDoc += "<tr>\n<td>\n"; if (rs.getInt("havepic")==1) { strShowDoc += "<img src='bbsupload/"+rs.getString("picname")+"'><br><br>"; } strShowDoc += myDoText.iso2gb(myDoText.changeColor(rs.getString("detail")))+"<br>"; String sign = rs.getString("sign"); if (sign!=null && sign.length()>0) { strShowDoc += "<br><br>------<br>"+ myDoText.iso2gb(sign); } if (rs.getString("amend") != null && rs.getString("amend").length()>0) { strShowDoc += "<br>------<br><span class=bt><font color=#0099CC>"+myDoText.iso2gb(rs.getString("amend"))+"</font></span>"; } strShowDoc += "</td>\n</tr>\n<tr>\n<td>\n"; strShowDoc += "<div align=right><a href=javascript:view1('send.jsp?recid="+rs.getInt("id")+"&bid="+bid+"'); target=mainFrame>將本文推薦給好友</a></div>\n"; strShowDoc += "</td>\n</tr>\n</table>\n</td>\n</tr>\n<tr>\n<td colspan=2>\n"; strShowDoc += "<div align=center><b><font face=Tahoma size=1 color=#FF0000>"+strWebURL+"</font></b></div>\n"; strShowDoc += "</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n<table width=615 border=0>\n<tr>\n<td height=2></td>\n</tr>\n</table>\n"; } rs.close(); } catch (SQLException e) { } myBBSConf.close(); return strShowDoc; } public String getShowDoc(String recid,String bid,String pages,String strUserID, String strUserName,boolean isBoardsMaster,boolean isBoardsMaster1,boolean isBoardsMaster2) { BBSConf myBBSConf = new BBSConf(); strWebURL = myBBSConf.getWebURL(); String strShowDoc = ""; //setAddClick(recid); String tabledarkcolor = myBBSConf.gettabledarkcolor(); String tablemaincolor = myBBSConf.gettablemaincolor(); String tabletintcolor = myBBSConf.gettabletintcolor(); SQL = "select * from forum where id2="+ recid +" and delsign = 1 order by id"; try { rs = DBSQL.executeQuery(SQL); while (rs.next()) { strShowDoc += "<table width=98% border=0 align=center cellpadding=0 cellspacing=0>\n<tr>\n"; strShowDoc += "<td bgcolor="+tablemaincolor+" height=23> <font color=#FFFFFF>主題:"+myDoText.iso2gb(rs.getString("title"))+"</font></td>\n</tr>\n"; strShowDoc += "<tr>\n"; strShowDoc += "<td height=84 bgcolor="+tabletintcolor+">\n"; strShowDoc += "<table width=98% border=0 align=center>\n<tr>\n"; strShowDoc += "<td width=73%><img src='images/"+rs.getInt("bq")+".gif' align=absmiddle>"; if (rs.getInt("cannotdel")==1) { strShowDoc += "<font color=#8f0000> M</font>"; } strShowDoc += " <span class=bt>作者:"+myDoText.iso2gb(rs.getString("name"))+"("+myDoText.iso2gb(rs.getString("nickname"))+") "+rs.getString("time")+"</td>\n"; strShowDoc += "<td width=25%>\n"; strShowDoc += "<div align=right>"; //if (!isGuestUser) { strShowDoc += " <a href='userinfo.jsp?UID="+rs.getInt("UID")+"' target=mainFrame><img alt=用戶信息 border=0 height=16 src=images/per_info.gif width=16></a> "; strShowDoc += "<a href='guestbook.jsp?Fname="+myDoText.iso2gb(rs.getString("name"))+"'target=new><img alt=發送短信 border=0 height=16 src=images/sendmsg.gif width=16></a> "; //} //else { //strShowDoc += " <img alt=用戶信息 border=0 height=16 src=images/per_info.gif width=16> "; //strShowDoc += "<img alt=發送短信 border=0 height=16 src=images/sendmsg.gif width=16> "; //} strShowDoc += "<img alt='用戶IP:"; if (isBoardsMaster || isBoardsMaster1 || isBoardsMaster2) {
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -