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

📄 editdisplay.jsp

📁 现今的社会是一个信息飞速发达的社会
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="con" scope="page" class="numb1.com.db"/>
<jsp:useBean id="ht" scope="page" class="numb1.com.Dohtml"/>
<%@ include file = "include/config.jsp" %>
<% 
String id=(String)session.getAttribute("id");id=ht.donull(id);
String root=(String)session.getAttribute("root");root=ht.donull(root);
String bdid=request.getParameter("bdid");
String bbsid=request.getParameter("bbsid");
String stringpage=request.getParameter("page");//stringpage为未处理的字符串型的页码数
String table="btable1";
String retable="";
String bdname="";

String title="";
String txt="";
String writerid="";
String writer="";
String tim="";
String retim="";
String penname="";
String main="main.jsp";
String display="display.jsp";


if(id.compareTo("")==0){
response.sendRedirect("login.jsp");
}else{
if(root.compareTo("")==0){root="0";}
int step=Integer.parseInt(root);

int x=0;//计数器
int showrow=8;//每页显示条数
int pages=1;//当前页数
int startrow; //本页开始条数

pages=ht.getInteger(stringpage,1);
if(!ht.isNumber(bdid) || !ht.isNumber(bbsid)){
out.print("<meta http-equiv=\"refresh\" content=\"3;URL=index.jsp\"><center><h3><font color=#ff0000>参数错误!</font></h3></center>");

}else{
String bdsql="SELECT btable, name, page FROM board where id="+bdid;
ResultSet bd=con.query(bdsql);bd.next();
if(bd.getRow()!=0){
table=bd.getString(1);
bdname=con.getStr(bd.getString(2));
}
con.close();

String bbssql="SELECT title, txt, userid, username, tim, penname FROM "+table+" WHERE id="+bbsid;
ResultSet bbs=con.query(bbssql);bbs.next();
if(bbs.getRow()!=0){
title=con.getStr(bbs.getString(1));
txt=con.getStr(bbs.getString(2));
writerid=bbs.getString(3);
writer=con.getStr(bbs.getString(4));
if(bbs.getString(5).length()<21){tim="";}else{tim=bbs.getString(5).substring(5,16);}
}
con.close();

//计算页数,回帖数
retable="re"+table;
String resql="SELECT id, retitle, txt, userid, username, time FROM "+retable+" WHERE bbsid="+bbsid;
ResultSet rers=con.query(resql);rers.last();
int count=rers.getRow();
int pageall=count/showrow;
if(count%showrow>0){pageall=pageall+1;}
if(pageall<2)pageall=1;
if(pages>pageall)pages=pageall;
if(pages<2)pages=1;
startrow=(pages-1)*showrow+1;
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>编辑:<%=title%></title>
<style type="text/css">
<!--
p{text-indent:18pt;font-size:13px}
td{font-size:13px}
th{font-size:15px}
a:link{text-decoration:none;color:#0000ff}
a:visited{text-decoration:none;color:#0000ff}
a:hover{text-decoration:underline;color:#96CCFE}
.style1 {color: #FFFFFF}
.style5 {color: #3D5AD3}
.style6 {color: #0000FF}

.link {color:#585858}
.link a:link{text-decoration:none;color:#585858}
.link a:visited{text-decoration:none;color:#585858}
.link a:hover{text-decoration:underline;color:#96CCFE}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
function htmlIMG()
{
	var location = prompt("请输入图片的地址:","http://");
	if(location)
	{
		//var info = prompt("请输入图片的说明文字:","");
		form1.text.value=form1.text.value+"[img]"+location+"[/img]";
	}
}

function bbsdel() {
	
		if (confirm("确实要彻底删除吗?") == false)
			return ;
        window.open("action/delmaster.jsp?bbsid=<%=bbsid%>&bdid=<%=bdid%>");
		window.close();
}


function redel(id) {
	
		if (confirm("确实要彻底删除吗?") == false)
			return ;
        window.open("action/delslave.jsp?id="+id+"&bdid=<%=bdid%>&bbsid=<%=bbsid%>");
		window.close();
}
</script>
</head>

<body>
<table width="750"  border="0" align="center">
  <tr>
    <td><div align="right" style="font-size:12px "> [<a href="first.jsp" target="_parent">论坛首页</a>]
      <% if(bdname.compareTo("")!=0){out.print(" [<a href="+main+"?id="+bdid+"><font color=\"#FF0000\">"+bdname+"</font></a>]");} %>[<a href=javascript:history.back()>返回</a>] [<a href="shutdown.jsp">离开</a>]&nbsp;&nbsp; </div></td>
  </tr>
</table>
<table width="750" border="0" align="center">
  <tr>
    <td height="50"><img src="img/jsbbs.jpg" width="744" height="61"></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0">
      <tr>
        <td height="8">&nbsp;</td>
      </tr>
      <tr>
        <td height="20" bgcolor="#f8f8f8">&nbsp;&nbsp;<a href="index.jsp">计算机论坛</a> &gt; <% out.print("<a href="+main+"?id="+bdid+">"+bdname+"</a> &gt; <a href="+display+"?bdid="+bdid+"&bbsid="+bbsid+"><font color=\"#FF0000\">"+title+"</font></a>");%> </td>
      </tr>
    </table></td>
  </tr>
</table>
  <table width="750" border="0" align="center">
    <tr>
      <td><div align="right">
       <% if(pageall>1){ if(pages>1){%><a
	   href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>"></a> <a
	   href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>&page=<%=(pages-1)%>">上一页</a><% }
	   if(pages<pageall){%> <a  href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>&page=<%=(pages+1)%>">下一页</a> <a
	   href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>&page=<%=pageall%>">尾页</a><% }}%>
        第<%=pages%>页 共<%=pageall%>页 回复<%=count%>帖&nbsp;&nbsp;</div></td>
    </tr>
</table>
<%
if(pages==1){
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f8f8f8" style="table-layout:fixed ">
  <tr>
    <td height="20" colspan="2" bgcolor="#7188e0" class="style1">&nbsp;&nbsp;&nbsp;主题:<%=title%><div align="right"></td>
  </tr>
  <tr>
    <td width="345" height="20" class="link"> &nbsp; &nbsp;作者:<a href="aboutuser.jsp?id=<%=writerid%>" target="_blank"><%=writer%></a> [<%=writerid%>] 发表于<%=tim%></td>
    <td width="405" height="20" class="link"><div align="right">[<a href="reply.jsp?id=<%=bdid%>&bbsid=<%=bbsid%>&user=<%=writerid%>">回复</a>]<% if(step>3||writerid.equals(id)){%> [<a href="editmast.jsp?bdid=<%=bdid%>&bbsid=<%=bbsid%>">修改</a>]  [<a href="javascript:bbsdel()">删除</a>]
        <%}%>
        &nbsp;&nbsp;</div></td>
  </tr>
  <tr>
    <td background="img/bg01.gif" height="1" colspan="2"></td>
  </tr>
  <tr>
    <td height="8" colspan="2"></td>
  </tr>
  <tr>
    <td colspan="2">
      <table width="97%"  border="0" align="center">
        <tr>
          <td>
		  <%
		  out.print(ht.dotxt1(txt));
		  out.print("<font color=#989898><br><br>=====<br>作者:"+writer+"<br>发表时间:"+tim+"<br>=====</font>");
          %></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="8"  colspan="2"></td>
  </tr>
</table>
<% } 
rers.absolute(startrow);
rers.previous();
while(rers.next()){
if(rers.getString(6).length()<21){tim="";}else{tim=rers.getString(6).substring(5,16);}
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f8f8f8" style="table-layout:fixed ">
  <tr>
    <td height="20" colspan="2" bgcolor="#7188e0" class="style1">&nbsp;&nbsp;&nbsp;主题:<%=con.getStr(rers.getString(2))%></td>
  </tr>
  <tr>
    <td width="347" height="20" class="link"> &nbsp; &nbsp;作者:<a href="aboutuser.jsp?id=<%=rers.getString(4)%>" target="_blank"><%=con.getStr(rers.getString(5))%></a> [<%=rers.getString(4)%>] 发表于<%=tim%></td>
    <td width="403" height="20" class="link"><div align="right">
      [<a href="reply.jsp?id=<%=bdid%>&bbsid=<%=bbsid%>&user=<%=rers.getString(4)%>">回复</a>]<% if(step>3||rers.getString(4).equals(id)){%> [<a href="editslave.jsp?bdid=<%=bdid%>&bbsid=<%=bbsid%>&reid=<%=rers.getString(1)%>">修改</a>] [<a href="javascript:redel(<%=rers.getString(1)%>)">删除</a>]
      <%}%> 
      &nbsp;&nbsp;</div></td>
  </tr>
  <tr>
    <td height="1" colspan="2" background="img/bg01.gif"></td>
  </tr>
  <tr>
    <td height="8" colspan="2"></td>
  </tr>
  <tr>
    <td colspan="2"><table width="97%"  border="0" align="center">
        <tr>
          <td><%
		  out.print(ht.dotxt1(con.getStr(rers.getString(3))));
		  out.print("<font color=#989898><br><br>=====<br>作者:"+con.getStr(rers.getString(4))+"<br>发表时间:"+tim+"<br>=====</font>");
		  %></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
<%
x++;if(x==showrow)break;}
%>
<table width="750"  border="0" align="center">
  <tr>
    <td bgcolor="#e8e8f8"><div align="right">
       <% if(pageall>1){ if(pages>1){%><a
	   href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>"></a> <a
	   href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>&page=<%=(pages-1)%>">上一页</a><% }
	   if(pages<pageall){%> <a  href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>&page=<%=(pages+1)%>">下一页</a> <a
	   href="<%=_self%>?bdid=<%=bdid%>&bbsid=<%=bbsid%>&page=<%=pageall%>">尾页</a><% }}%>
        第<%=pages%>页 共<%=pageall%>页 回复<%=count%>帖&nbsp;&nbsp;</div></td>
  </tr>
</table>
<form name="form1" method="post" action="action/actreply.jsp">
<table width="640"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#7188e0" style="BORDER-BOTTOM: #7188e0 1px solid; BORDER-LEFT: #7188e0 1px solid; BORDER-RIGHT: #7188e0 1px solid; BORDER-TOP: #7188e0 1px solid">
  <tr>
    <td colspan="2" bgcolor="#fefefe"><table width="100%"  border="0" cellpadding="0" cellspacing="1">
      <tr>
        <th bgcolor="#7188e0"><span class="style1"><a name="1"></a>快速回复</span></th>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td width="13%" height="22" bgcolor="#fefefe"><div align="right">主&nbsp;&nbsp;题:</div></td>
    <td width="83%" bgcolor="#fefefe">&nbsp;<input name="title" type="text" id="title" value="Re:" size="58" style="BORDER: #7188e0 1px solid;color:#1818FF;">
      [<a href="display.jsp?id=<%=bdid%>&<% if(pages>1){ out.print("page="+pages+"&");} out.print("bbsid="+bbsid);%>#1" onclick=htmlIMG()>贴图</a>]</td>
    </tr>
  <tr>
    <td valign="top" bgcolor="#fefefe"><div align="right">正&nbsp;&nbsp;文:</div></td>
    <td bgcolor="#fefefe">&nbsp;<textarea name="text" cols="66" rows="8" style="BORDER: #7188e0 1px solid; background:#f8f8f8; color:#1818FF;  overflow:auto;"></textarea></td>
    </tr>
  <tr>
    <td height="22" bgcolor="#fefefe"><div align="right">签名:</div></td>
    <td height="20" bgcolor="#fefefe"><input type="radio" name="pn" value="pn1">
	<a href="#1" onClick="window.open('showpenname.jsp?pn1=y','pn','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,top=150,left=100,width=360,height=210');">第一签名</a>&nbsp;
<input type="radio" name="pn" value="pn2">
<a href="#1" onClick="window.open('showpenname.jsp?pn1=y','pn','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,top=150,left=100,width=360,height=210');">第二签名</a>&nbsp;
<input type="radio" name="pn" value="no">
<span class="style6">不使用签名</span></td>
    </tr>
  <tr>
    <td height="22" colspan="2" bgcolor="#fefefe"><div align="center">
         <input name="imageField" type="image" src="img/ok1.gif" width="60" height="22" border="0" onMouseout="this.src='img/ok1.gif'" onMouseOver="this.src='img/ok2.gif'">
         &nbsp;
         <input name="bbsid" type="hidden" id="bbsid" value="<%=bbsid%>">
        <input name="bdid" type="hidden" id="board" value="<%=bdid%>">
&nbsp;        
<a href="javascript:window.close()"><img src="img/close1.gif" width="60" height="22" border="0" onMouseout="this.src='img/close1.gif'" onMouseOver="this.src='img/close2.gif'"></a>    </div></td>
    </tr>
</table>

</form>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="20" bgcolor="#f0f0f0">&nbsp;</td>
  </tr>
</table>
</body>
</html>

<%
}
}
%>

⌨️ 快捷键说明

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