?? main_jsp.java
字號:
out.write("\">\r\n");
out.write("\t\t\t\t ");
}
out.write("\r\n");
out.write(" <input type=text name=\"searchcontent\" size=25 class=p1 value=\"\">\r\n");
out.write(" <select name=\"searchkind\" style=\"width:70\">\r\n");
out.write(" <option value=\"title\" selected>按主題</option>\r\n");
out.write(" <option value=\"user_id\" >按用戶名</option>\r\n");
out.write(" </select>\r\n");
out.write(" <input name=\"search\" src=\"images/d_search.gif\" type=\"image\" value=\"Submit\" width=\"37\" height=\"21\" border=\"0\" align=\"absmiddle\">\r\n");
out.write(" <img src=\"images/refesh.gif\" width=\"37\" height=\"21\" align=\"absmiddle\" onClick=\"javascript:window.location.reload();\" style=\"CURSOR: hand\">\r\n");
out.write(" </div>\r\n");
out.write(" </td>\r\n");
out.write(" </form>\r\n");
out.write(" <form name=\"form1\" method=\"post\" style=\"MARGIN-BOTTOM: 0px\"> \r\n");
out.write(" <td width=\"20%\" valign=\"middle\"> \r\n");
out.write(" <div align=\"center\">排序 \r\n");
out.write(" <select name=\"menu1\" style=\"width:75px\" onChange=\"MM_jumpMenu('self',this,0)\">\r\n");
out.write(" <option value=\"main.jsp?order_key=date\">發(fā)帖時(shí)間\r\n");
out.write(" <option value=\"main.jsp?order_key=redate\">跟帖時(shí)間 \r\n");
out.write(" <option value=\"main.jsp?order_key=hit\">瀏覽量 \r\n");
out.write(" <option value=\"main.jsp?order_key=rep\">跟帖數(shù) \r\n");
out.write(" </select>\r\n");
out.write(" <input name=\"layer_2\" type=\"hidden\" id=\"layer_2\" value=\"");
out.print(layer_2);
out.write("\">\r\n");
out.write("\t\t\t\t <input name=\"layer_1\" type=\"hidden\" id=\"layer_1\" value=\"");
out.print(layer_1);
out.write("\">\r\n");
out.write(" </div>\r\n");
out.write(" </td>\r\n");
out.write(" </form>\r\n");
out.write(" </tr>\r\n");
out.write(" </tbody> \r\n");
out.write(" </table>\r\n");
out.write(" <table width=\"100%\" border=0 cellpadding=2 cellspacing=1 bgcolor=\"#A4B6D7\" align=\"center\">\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr align=middle> \r\n");
out.write(" <td width=\"6%\" background=\"../images/bbs_bg1.gif\">點(diǎn)擊</td>\r\n");
out.write(" <td width=\"52%\" background=\"../images/bbs_bg1.gif\" >論壇主題</td>\r\n");
out.write(" <td width=\"5%\" background=\"../images/bbs_bg1.gif\" >回復(fù)</td>\r\n");
out.write(" <td width=\"11%\" background=\"../images/bbs_bg1.gif\" >作者</td>\r\n");
out.write(" <td width=\"25%\" background=\"../images/bbs_bg1.gif\" >更新時(shí)間</td>\r\n");
out.write(" </tr>\r\n");
if(layer_1!=null)
{
if (layer_2!=null)
{
sql="select * from bbstitle where deleted=0 "+signstr+" "+huatistr+" "+searchkindstr+" and BoardID_1='" + layer_1 + "' and BoardID_2='" + layer_2 + "' order by "+order_key; //bbstop desc,redate desc";
}
else
{
sql="select * from bbstitle where deleted=0 "+signstr+" "+huatistr+" "+searchkindstr+" and BoardID_1='" + layer_1 + "' order by "+order_key;
}
}
else
{
sql="select * from bbstitle where deleted=0 "+signstr+" "+huatistr+" "+searchkindstr+" order by "+order_key;
}
//out.print(sql);
ResultSet rs=stmt.executeQuery(sql);
int intPageSize; //一頁顯示的記錄數(shù)
int intRowCount; //記錄總數(shù)
int intPageCount; //總頁數(shù)
int intPage; //待顯示頁碼
String strPage;
int i;
//設(shè)置一頁顯示的記錄數(shù)
intPageSize = 25;
//取得待顯示頁碼
strPage = request.getParameter("pages");
if(strPage==null){
//表明在QueryString中沒有page這一個(gè)參數(shù),此時(shí)顯示第一頁數(shù)據(jù)
intPage = 1;
}
else
{
//將字符串轉(zhuǎn)換成整型
intPage = Integer.parseInt(strPage);
if(intPage<1){ intPage = 1;}
}
//獲取記錄總數(shù)
rs.last();
intRowCount = rs.getRow();
//計(jì)算總頁數(shù)
intPageCount =(intRowCount+intPageSize-1) / intPageSize;
//調(diào)整待顯示的頁碼
if(intPage>intPageCount) intPage = intPageCount;
if(intPageCount>0){
//將記錄指針定位到待顯示頁的第一條記錄上
rs.absolute((intPage-1) * intPageSize+1);
//顯示數(shù)據(jù)
i = 0;
//if (rs.next()){
while(i< intPageSize && !rs.isAfterLast()){
int id=rs.getInt("id");
String repTime=rs.getString("redate");
String bbs_img_display=rs.getString("bbs_img_display");
String dTime=repTime.substring(2,16);
String stsql="select top 1 user_id,rename from bbsmenu where pid="+id+" order by id desc";
Statement stmt3=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs3=stmt3.executeQuery(stsql);
out.write("\r\n");
out.write(" <tr align=middle> \r\n");
out.write(" <td bgcolor=\"#ECF5FF\" width=\"6%\" height=\"28\">");
out.print(rs.getString("hit"));
out.write("</td>\r\n");
out.write(" <td width=\"52%\" align=left valign=\"middle\" bgcolor=\"#F2F8FF\">\r\n");
out.write(" ");
if(rs.getString("bbstop").equals("1")){
out.write("\r\n");
out.write(" <img src=\"images/ding.gif\" width=\"15\" height=\"13\" align=\"absmiddle\"> \r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if(rs.getString("sign").equals("1")){
out.write("\r\n");
out.write(" <img src=\"images/jian.gif\" width=\"15\" height=\"13\" align=\"absmiddle\"> \r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if(rs.getString("huati").equals("1")){
out.write("\r\n");
out.write(" <img src=\"images/jing.gif\" width=\"15\" height=\"13\" align=\"absmiddle\"> \r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if(rs.getString("P_display").equals("0")){
out.write("\r\n");
out.write(" <img src=\"images/suo.gif\" width=\"12\" height=\"13\" align=\"absmiddle\"> \r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if(rs.getInt("P_display")!=0 && rs.getInt("bbstop")!=1 && rs.getInt("sign")!=1 && rs.getInt("huati")!=1){
out.write("\r\n");
out.write(" <img src=\"../images/");
out.print(rs.getString("picture"));
out.write("\" width=\"19\" height=\"19\" align=\"absmiddle\"> \r\n");
out.write(" ");
}
out.write("\r\n");
out.write("\t\t\t <a class=f14 href=\"checkasp.jsp?id=");
out.print(id);
out.write('"');
out.write('>');
out.print(rs.getString("title"));
out.write("</a>\r\n");
out.write("\t\t\t ");
if(rs.getString("bbs_img")!=null){
out.write("\r\n");
out.write(" <font color=red> [圖]</font> \r\n");
out.write(" ");
}
out.write("\r\n");
out.write("\t\t\t</td>\r\n");
out.write(" <td bgcolor=\"#ECF5FF\" width=\"7%\" >");
out.print(rs.getString("rep"));
out.write("</td>\r\n");
out.write(" <td bgcolor=\"#F2F8FF\" width=\"9%\" ><a href=\"main.jsp?searchkind=user_id&searchcontent=");
out.print(rs.getString("user_id"));
out.write("&layer_1=");
out.print(rs.getString("boardid_1"));
out.write('"');
out.write('>');
out.print(rs.getString("user_id"));
out.write("</a></td>\r\n");
out.write(" <td bgcolor=\"#F2F8FF\" width=\"16%\" align=left>");
out.print(dTime);
if(rs3.next()){
out.write("<font color=red>|</font>");
out.print(rs3.getString("user_id"));
}
out.write("\r\n");
out.write("\t\t\t</td>\r\n");
out.write(" </tr>\r\n");
rs.next();
i++;
}
}
rs.close();
stmt.close();
conn.close();
out.write("\r\n");
out.write(" <tr valign=\"top\"> \r\n");
out.write(" <td colspan=\"6\" background=\"../images/bbs_bg1.gif\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\r\n");
out.write(" <tr> \r\n");
out.write(" <td align=\"left\" width=\"322\"> \r\n");
out.write(" ");
out.print("共<font color=red>"+intRowCount+"</font>個(gè)主題 <font color=red>"+intPageSize+"</font>/頁 共<font color=red>"+intPageCount+"</font>頁");
out.write("\r\n");
out.write(" 當(dāng)前第<font color=red>");
out.print(intPage);
out.write("</font>頁 </td>\r\n");
out.write(" <td width=\"439\" height=\"23\" align=\"right\"> \r\n");
out.write("\t\t\t\t ");
if(intPage<=1){
out.write("\r\n");
out.write("\t\t\t\t 首頁\r\n");
out.write("\t\t\t\t ");
}else{
out.write("\r\n");
out.write(" <a href=\"main.jsp?pages=1");
out.print(lk1);
out.print(lk2);
out.write("\">首頁</a>\r\n");
out.write("\t\t\t\t\t");
}
out.write("\r\n");
out.write(" ");
if(intPage>1){
out.write("\r\n");
out.write(" <a href=\"main.jsp?pages=");
out.print(intPage-1);
out.print(lk1);
out.print(lk2);
out.write("\">上一頁</a> \r\n");
out.write(" ");
}else{
out.write("\r\n");
out.write(" 上一頁 \r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if(intPage<intPageCount){
out.write("\r\n");
out.write(" <a href=\"main.jsp?pages=");
out.print(intPage+1);
out.print(lk1);
out.print(lk2);
out.write("\">下一頁</a> \r\n");
out.write(" ");
}else{
out.write("\r\n");
out.write(" 下一頁 \r\n");
out.write(" ");
}
out.write("\r\n");
out.write("\t\t\t\t ");
if(intPageCount<=1||intPage==intPageCount){
out.write("\r\n");
out.write("\t\t\t\t 尾頁\r\n");
out.write("\t\t\t\t ");
}else{
out.write("\r\n");
out.write(" <a href=\"main.jsp?pages=");
out.print(intPageCount);
out.print(lk1);
out.print(lk2);
out.write("\">尾頁</a> \r\n");
out.write("\t\t\t\t\t");
}
out.write("\t\t\t\t\t\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table></td>\r\n");
out.write(" </tr>\r\n");
//}
//else{
/*
out.write("\r\n");
out.write(" <tr bgcolor=\"#EFF7FA\"> \r\n");
out.write(" <td colspan=6 align=center height=20> 歡迎到本論壇發(fā)表貼子! </td>\r\n");
out.write(" </tr>\r\n");
//}
*/
out.write("\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<div align=\"center\">\r\n");
out.write(" <hr width=99% size=1>\r\n");
out.write(" <table width=99% align=center cellpadding=2 cellspacing=0>\r\n");
out.write(" <tr> \r\n");
out.write(" <td height=22 bgcolor=\"#F2F8FF\"> \r\n");
out.write(" <div align=center><a class=map href=\"http://www.xmfangzi.com/bbs/\">飛天論壇(ftbbs \r\n");
out.write(" SQL 2.0 JSP商業(yè)版)</a> 版權(quán)歸飛天論壇所有. </div>\r\n");
out.write(" </td>\r\n");
out.write(" </tr> \r\n");
out.write("\t<tr> \r\n");
out.write(" <td height=22 bgcolor=\"#F2F8FF\"> \r\n");
out.write(" <div align=center> Copyright (C) 2004-2006 XMFANGZI.com,All Rights Reserved.</div>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td height=22 bgcolor=\"#F2F8FF\"> \r\n");
out.write(" <div align=\"center\">網(wǎng)管E-mail:<a class=map href=\"mailto:xmfangzi@126.com\">xmfangzi@126.com</a> \r\n");
out.write(" 投訴E-mail:<a class=map href=\"mailto:xmwuye@163.com\">xmwuye@163.com</a></div>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr> \r\n");
out.write(" <td height=28 bgcolor=\"#F2F8FF\" valign=\"middle\"> \r\n");
out.write(" <div align=center>業(yè)務(wù)聯(lián)系QQ:149501601,123291926 E-mail:cht21@163.com</div>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write("</div>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -