?? bbslist_jsp.java
字號:
package org.apache.jsp.web.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public final class bbslist_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
public String getServletInfo() {
return "database handler";
}
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(1);
_jspx_dependants.add("/web/jsp/incdb.jsp");
}
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
request.setCharacterEncoding("GB2312");
out.write("\r\n");
out.write("\r\n");
out.write("<!--?aê?μ?è?packages-->\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!--μ?è??áê?-->");
out.write('\r');
out.write('\n');
twm.bbs bbs = null;
synchronized (_jspx_page_context) {
bbs = (twm.bbs) _jspx_page_context.getAttribute("bbs", PageContext.PAGE_SCOPE);
if (bbs == null){
bbs = new twm.bbs();
_jspx_page_context.setAttribute("bbs", bbs, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
twm.bbsboard board = null;
synchronized (_jspx_page_context) {
board = (twm.bbsboard) _jspx_page_context.getAttribute("board", PageContext.PAGE_SCOPE);
if (board == null){
board = new twm.bbsboard();
_jspx_page_context.setAttribute("board", board, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
twm.bbscom bbscom = null;
synchronized (_jspx_page_context) {
bbscom = (twm.bbscom) _jspx_page_context.getAttribute("bbscom", PageContext.PAGE_SCOPE);
if (bbscom == null){
bbscom = new twm.bbscom();
_jspx_page_context.setAttribute("bbscom", bbscom, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
int boardid,method;
String tempSTR;
boardid=0;
method=0;
String delon="false";
//byte[] tmpbyte;
tempSTR=request.getParameter("boardid");
boardid=java.lang.Integer.parseInt(tempSTR);
tempSTR=request.getParameter("method");
if (tempSTR==null){ method=0;}
else{method=java.lang.Integer.parseInt(tempSTR);}
//'method=0正常顯示貼子
//'method=1搜索=主題
//'method=2搜索=發言人
//'method=3搜索=時間
//'method=4搜索=精華貼(所有版面)
//'method=8版主管理(DEL)
out.write('\r');
out.write('\n');
int iPageSize; // '每頁顯示的記錄數
int iPageCount; // '頁面總數
int iPageCurrent=0; // '顯示的當前頁面
int iPageLast=0; // '上一頁
int iPageNext=0; // '下一頁
int iRecordsShown;
int iRecordsCount; //記錄總數
int iRecordsStart; //起始記錄
int i;// '循環變量
String par="";// '查詢參數
java.sql.ResultSet rs;
java.sql.ResultSet sqlRst;
int bbsid,parentid,child,bbshits,length;
String username,useremail,userip,expression,usersign,bbstopic,bbscontent,bbshot;
String boardname,boardmaster,masterword,masteremail;
java.util.Date dateandtime= new java.util.Date();
username="";
boardname="";
boardmaster="";
masterword="";
masteremail="";
board.updateBoardHits(boardid,1); //'版面點擊數加1
if (board.getBoardInfo(boardid)){
boardname=board.getBoardName();
boardmaster=board.getBoardMaster();
masterword=board.getBoardMasterword();
masteremail=board.getBoardMasteremail();
} //'找出本版塊資料,版名,版主,版主的話
iRecordsCount=0;
iPageCount=0;
iPageSize =10; // '每頁顯示10條記錄,可更改部分.
//'如果是首次顯示,則當前頁為1,否則根據請求的頁數顯示
tempSTR=request.getParameter("pages");
if (tempSTR==null){ iPageCurrent=1;}
else{ iPageCurrent=java.lang.Integer.parseInt(tempSTR);}
par=request.getParameter("par");
if (par==null) {par="";}
//tmpbyte=par.getBytes("ISO8859_1");
//par=new String(tmpbyte);
iRecordsCount=bbs.getRecordsCount(method,boardid,par);
iPageCount=0;
if (iRecordsCount!=0) {
iPageCount=iRecordsCount/iPageSize;
if ((iRecordsCount%iPageSize)!=0){
iPageCount++; //頁面總數;
}
}
bbscom.setPages(iPageCount,iPageCurrent);
iPageLast=bbscom.getPagesLast();
iPageNext=bbscom.getPagesNext();
iPageCurrent=bbscom.getPagesCurrent();
if (method==8) { // '管理員開關
//'method=8版主管理(DEL)
delon="false";
if (session.getValue("superlogin")!="true"){ // '非正常版主登錄
out.write("\r\n");
out.write(" <script language=\"JavaScript\">\r\n");
out.write(" window.location=\"superlog.jsp\";\r\n");
out.write(" </script> \r\n");
out.write(" ");
}else{
delon="true";
}//' end if
} //'End if
out.write(" \r\n");
out.write("<html>\r\n");
out.write("\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<title>New Page 3</title>\r\n");
out.write("<style type=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write(".header {font: 11px Tahoma, Verdana; color: #000000; font-weight: bold; background-color: #99CC66 }\r\n");
out.write(".maintable {width: 100%; background-color: #EFFFCE }\r\n");
out.write(".tableborder {background: #D6E0EF; border: 1px solid #000000 }\r\n");
out.write("-->\r\n");
out.write("</style>\r\n");
out.write("<base target=\"rtop\">\r\n");
out.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"bbs01.css\">\r\n");
out.write("</head>\r\n");
out.write("<body >\r\n");
out.write("<div align=\"center\" bgcolor=\"#EFFFCE\"> \r\n");
out.write("\r\n");
out.write(" <table cellspacing=\"1\" cellpadding=\"4\" width=\"757\" align=\"center\" bgcolor=\"#EFFFCE\">\r\n");
out.write(" <tr class=\"header\">\r\n");
out.write(" <td height=\"58\"><h1><div align=\"center\">BBS</h1></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write("</div>\r\n");
out.write(" <div align=\"center\"> \r\n");
out.write("<table border=\"0\" width=\"757\"> \r\n");
out.write(" <tr> \r\n");
out.write(" <td align=middle width=\"18%\"><a href=\"mailto:");
out.print(masteremail);
out.write("\">(<img src=\"images/online_moderator.gif\"width=\"16\" height=\"15\" border=\"0\"> 版主:");
out.print(boardmaster);
out.write("</a>)</td> \r\n");
out.write("\t<td width=\"17%\" align=middle>主題:<b><i>");
out.print(boardname);
out.write("</i></b></td>\r\n");
out.write("\t<td width=\"65%\" align=middle>板塊說明:<font color=\"#FF0000\">");
out.print(masterword);
out.write("</font></td> \r\n");
out.write(" </tr> \r\n");
out.write("</table> \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write("<!--表頭部分 --><!--表頭部分結束 --> \r\n");
out.write("<table border=\"1\" width=\"759\" bordercolorlight=\"#000000\" bordercolordark=\"#FFFFFF\" bgcolor=\"#EFFFCE\" cellspacing=\"0\" cellpadding=\"3\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"30\" bgcolor=\"#99CC66\"><p align=\"center\"><a href=\"bbsadd.jsp?boardid=");
out.print(boardid);
out.write("\" target=\"_self\"><font color=\"#FFFFFF\">留言</font></a></p></td>\r\n");
out.write(" <td width=\"30\" bgcolor=\"#99CC66\"><p align=\"center\"><a href=\"bbslist.jsp?boardid=");
out.print(boardid);
out.write("\" target=\"_self\"><font color=\"#FFFFFF\">刷新</font></a></p></td>\r\n");
out.write(" <td width=\"30\" bgcolor=\"#99CC66\"><p align=\"center\"><a href=\"query.jsp\"><font color=\"#FFFFFF\">查詢</font></a></p></td>\r\n");
out.write(" <td width=\"100\" bgcolor=\"#99CC66\"><p align=\"center\"><a href=\"bbslist.jsp?boardid=");
out.print(boardid);
out.write("&method=4\"><font color=\"#FFFFFF\">精華區</font></a></p></td>\r\n");
out.write(" <td width=\"200\" bgcolor=\"#99CC66\"><p align=\"center\">\r\n");
out.write(" ");
if (iPageCount>1) {
out.write("\r\n");
out.write(" <a href=\"bbslist.jsp?boardid=");
out.print(boardid);
out.write("&pages=1&method=");
out.print(method);
out.write("&par=");
out.print(par);
out.write("\"> <font color=\"#FFFFFF\">首頁</font></a>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if (iPageLast!=0) {
out.write("\r\n");
out.write(" <a href=\"bbslist.jsp?boardid=");
out.print(boardid);
out.write("&pages=");
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -