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

📄 forum_display.jsp

📁 论坛元程序
💻 JSP
字号:
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*,java.lang.*"  %>
<jsp:useBean id="yy" scope="page" class="yy.jdbc"/>
<link rel='stylesheet' type='text/css' href='imbed/forum.css'>
<SCRIPT language=JavaScript>
    function commitForm1(destJsp){
  document.form1.action=destJsp;
  document.form1.submit();
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td colspan="3"><img src="images/qtop5.jpg" width="497" height="55"><img src="images/dot.gif" width="12" height="11"><font size="2"> 
       <a href="javascript:window.external.addFavorite('http://59.64.156.13','911论坛')" title="911论坛">收藏本站</a>&nbsp;&nbsp;</font> <img src="images/dot.gif" width="12" height="11"> 
      <font size="2"><a href="index.jsp">返回首页</a></font></td>
  </tr>
  <tr> 
    <td width="40%"><img src="images/qleft6.jpg" width="410" height="37"></td>
    <td colspan="2" background="images/qback6.gif" width="60%">
    <%
    
    String hostname,Host_Name;
    String community_name="";
    String fid=request.getParameter("fid");
     Connection con=yy.getConn();
     Statement  stmt=con.createStatement();
     ResultSet  rs=null;
     String sql="Select host_name,community_name From Community where community_id="+fid;
    rs=stmt.executeQuery(sql);
    if(rs.next())
    {
    hostname=rs.getString("host_name");
    community_name=rs.getString("community_name");
    Host_Name="<a href=member.jsp?member="+hostname+">"+hostname+"</a>";
    if (session.getValue("UserName")==null)
		{ %>
		有问题请于版主:<a href=member.jsp?member="+Forum_Mastor+"><%=Host_Name%> 联系
		<% }	
		else
		 { out.println(session.getValue("UserName")+" 欢迎您");%>
		  &nbsp;&nbsp;&nbsp;&nbsp;有问题请于版主:<%=Host_Name%> 联系
		  <%}}%>
		  </td>
    <tr> 
    <td width="40%"><img src="images/qleft7.jpg" width="410" height="154"></td>
    <td width="25%"><img src="images/qleft8.jpg" width="256" height="154"></td>
    <td width="35%"><img src="images/qleft9.gif" width="358" height="154"></td>
  </tr>
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr> 
    <td height="53" colspan="3"> &nbsp;&nbsp;<a href="index.jsp">论坛首页</a> &gt; <%=community_name%></td>
  </tr>
</table>
<form name="form" method="post" action="subject_display.jsp">
<table width="100%" height="77" border="1" cellpadding="0" cellspacing="0">
  <tr bordercolor="#CCCCCC"> 
    <td width="35%" height="37">主题</td>
    <td width="20%">作者</td>
    <td width="10%">回复数量</td>
    <td width="10%">浏览数量</td>
    <td width="25%">最后回复</td>
  </tr>
  <%	int n=0;
  int count=0;
  int pages=1;//当前页数,默认为1
  int pagesize=2;
  String nowpage=request.getParameter("pages");
  if((nowpage!=null)&&(nowpage!=""))
     pages=Integer.parseInt(request.getParameter("pages"));
     //out.println(pages);
  if(pages>0)
  {
     try{
     sql="select count(*) as id from Subject where community_id="+fid;
     
     rs=yy.executeQuery(sql);
     }catch(Exception e)
     {
     out.println(e.getMessage());
     }
  }if(rs.next())
     count=rs.getInt("id");
     if(count>0)
     {
		String Subject_title="";
		String Publish_time="";
		String Author="";
		String Numofsee="";
		String Numofreply="";
		String Lastreplier="";
		String Lastreplytime="";
		String Subject_topic="";
		String Subject_id="";
		sql="SELECT * FROM Subject where community_id="+fid;
		rs=stmt.executeQuery(sql);
		for(int i=1;i<=(pages-1)*pagesize;i++)
		rs.next();
		for(int j=0;j<pagesize;j++)
		{
		if (rs.next())
		  {
		        Subject_id=rs.getString("subject_id");
		        Subject_title=rs.getString("subject_title");		       
                Publish_time=rs.getString("publish_time");
                Author=rs.getString("author");
                
                Numofsee=rs.getString("numofsee");
                Numofreply=rs.getString("numofreply");
                
                Lastreplytime=rs.getString("last_replytime");
                Lastreplier=rs.getString("last_replier");
                Subject_topic=rs.getString("subject_topic");
				if(Publish_time==null)
				   Publish_time="";
				if (Subject_topic==null)
			       Subject_topic="";
			    if (Lastreplytime==null)
			       Lastreplytime="";
			    if(Lastreplier==null)
			       Lastreplier="无";
			   			
				%>
				<tr bordercolor="#CCCCCC">
          <td align="center"  height="26" width="30%"><a href="subject_display.jsp?sid=<%=Subject_id%>"><font size='2'><%=Subject_title%></a><br>发布时间:<%=Publish_time.substring(0,10)%></font></td>
          <td height="26" width="20%" ><a href="member.jsp?member=<%=Author%>"><font size='2'><%=Author%></font></a></td>
          <td align="center" height="26" width="10%"><font size='2'><%=Numofreply%></font></td>
          
    <td align="center" height="26" width="10%"><font size='2'><%=Numofsee%></font></td>
          <td height="26" width="25%"><font size='2'>
          <%
              if(Lastreplier.equals(""))
             { %>
               时间:<br>
               回复者:</td>
              <%} else {%>
             <font size='2'> 时间:<%=Lastreplytime.trim().substring(0,10)%><br>
              回复者:<a href="member.jsp?member=<%=Lastreplier%>"><%=Lastreplier%></a></td></font>
              <%}
              }
              }n=(int)(count/pagesize);
    if(n*pagesize<count)
      n++;
      if(n>=1)
      {%><font size='2'>共<%=n%>页:
      <%
         for(int i=1;i<=n;i++)
         out.println("<a href=forum_display.jsp?pages="+i+"&fid="+fid+">"+i+"&nbsp;</a>");
      }}
              %></font>
             
         
        </tr>

		
 </table>                <br>                <div               align='right'><a
 href="new_subject.jsp?community_id=<%=fid%>"><img
 src="images/TOPIC.GIF" width="84" height="29" border="0"></a> </div>

⌨️ 快捷键说明

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