分享
 
 
 

一种新的编程思路(下):附 bbs之forum.jsp

王朝java/jsp·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

forum.jsp

--------------------------------------------------------------------------

<%@page contentType="text/html;charset=GBK" %>

<%@include file="head.jsp"%>

<%@include file="ntGBDP2002_Define.jsp" %>

<%

file://全局变量定义

globalTableName = "bbs_article";

parentKey = "帖子";

parentValue = "";

dbName = "mhoa";

%>

<%

int forumId = 0;

if( request.getParameter("forumId") == null )

{

out.println("<script>alert('没有指定论坛: forumId !');history.back();</script>");

return;

}

forumId = Integer.parseInt(request.getParameter("forumId"));

sql =

" select top "+ maxReturnRows +" * from " + globalTableName + "_datetime " +

" where k ='改贴时间' "+

" and pid in ( select id from " + globalTableName + "_main "+

" where k='"+parentKey+"' and v='"+parentValue+"' ) "+

" and pid in ( select pid from " + globalTableName + "_int "+

" where k='论坛id' and v = "+ forumId +" ) "+

" and pid in ( select pid from " + globalTableName + "_int "+

" where k='父贴id' and v = 0 ) "+

" order by v desc "+

"";

ntP.executeQuery( dbName , sql);

file://校正次序

out.println("<!-- "+ sql +" -->");

%>

<%@include file="ntPage.jsp"%>

<html>

<head>

<title>闵行办公自动化系统BBS</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="../css/mhs.css" type="text/css">

</head>

<body bgcolor="#FFFFFF" text="#000000">

<table width="750" border="0" cellspacing="1" cellpadding="0" bgcolor="#345487" align="center">

<tr>

<td><img src="images/bbs_top.gif" width="750" height="59"></td>

</tr>

</table>

<table width="750" border="0" cellspacing="1" cellpadding="0" bgcolor="#345487" align="center">

<tr>

<td bgcolor="#EEF2F7" height="20">

<div align="right"><img

title=Search

src="images/top10.gif"

align=absMiddle border=0 name=search width="15" height="15"> <a href="register.jsp">注册</a>

| <img

title=Search

src="images/userlist.gif"

align=absMiddle border=0 name=search width="16" height="16"> <a href="data.jsp">个人资料</a>

| <img

title="Members List"

src="images/yj.gif"

align=absMiddle border=0 name=members width="16" height="16"> <a href="login.jsp">用户登入</a>

| <img

title=Search

src="images/icon_search.gif"

align=absMiddle border=0 name=search width="16" height="15"> <a href="bbs_search.jsp">论坛搜索</a>

| <img

title=Search

src="images/gohome.gif"

align=absMiddle border=0 name=search width="15" height="15"> <a href="bbs.jsp">返回论坛首页</a>

| <img

title=Search

src="images/gohome.gif"

align=absMiddle border=0 name=search width="15" height="15"> <a href="../index.jsp">返回OA首页</a>&nbsp;&nbsp;

</div>

</td>

</tr>

</table>

<table width="750" border="0" cellspacing="0" cellpadding="3" align="center">

<tr>

<td width="31"><img src="images/nav.gif" width="21" height="21"></td>

<td width="371">

<%@include file="forum_jump_select.jsp"%>

</td>

<td width="372">

<div align="right"><a href="newthread.jsp?forumId=<%= request.getParameter("forumId")%>"><img src="images/t_new.gif" width="89" height="25" border="0"></a>&nbsp;&nbsp;</div>

</td>

</tr>

<tr>

<td colspan="3">

<table width="750" border="0" cellspacing="1" cellpadding="0" bgcolor="#345487" align="center">

<tr>

<td background="images/tile_back.gif">

<table width="750" border="0" cellspacing="0" cellpadding="0" align="center" height="20">

<tr>

<td background="images/tile_back.gif" width="31">

<div align="center"><img src="images/nav_m.gif" width="8" height="8"></div>

</td>

<td background="images/tile_back.gif" width="744">&nbsp;<font color="#FFFFFF"><%= nt.getKV( dbName,"forumDefine", forumId ,"论坛名称") %>&nbsp;&gt;&nbsp;( 版主: <%= nt.getKV( dbName,"forumDefine", forumId ,"斑竹") %> )</font></td>

</tr>

</table>

</td>

</tr>

</table>

<table width="750" border="0" cellspacing="1" cellpadding="0" bgcolor="#345487" align="center">

<tr>

<td bgcolor="#FFFFFF">

<table width="750" border="0" cellspacing="1" cellpadding="2">

<tr>

<td colspan="2" bgcolor="#B5CBEA">

<div align="center"><font color="#3A4F6C">主&nbsp;题</font></div>

</td>

<td width="69" bgcolor="#B5CBEA">

<div align="center"><font color="#3A4F6C">作者</font></div>

</td>

<td width="65" bgcolor="#B5CBEA">

<div align="center"><font color="#3A4F6C">回复数</font></div>

</td>

<td width="66" bgcolor="#B5CBEA">

<div align="center"><font color="#3A4F6C">人气指数</font></div>

</td>

<td width="145" bgcolor="#B5CBEA">

<div align="center"><font color="#3A4F6C">最后发表</font></div>

</td>

</tr>

<%

for(int i=iStart;i<iCount;i++) {

int _pid = Integer.parseInt( ntP.data(i,"pid"));

String _name = nt.getKV( dbName,globalTableName ,_pid ,"贴子标题");

if( _name.equals("") )

_name = "( 空 )";

if( !nt.getKV( dbName,globalTableName+"_int" ,_pid ,"父贴id").equals("0") )

_name = "&nbsp;&nbsp;"+_name;

%>

<tr>

<td width="27" bgcolor="#E4EAF2">

<div align="center"><a href="newthread.jsp?forumId=<%= forumId %>&id=<%=_pid%>"><img src="face/<%= nt.getKV( dbName,globalTableName ,_pid ,"表情图标") %>" width="20" height="20" border=0></a>

</div>

</td>

<td width="373" bgcolor="#E4EAF2"><a href="showthread.jsp?forumId=<%= forumId %>&id=<%=_pid%>"><%= _name %>&nbsp;</a></td>

<td width="69" bgcolor="#E4EAF2" align="center" >

<%=

nt.getKV( dbName,"bbs_users" ,nt.getKV( dbName,globalTableName+"_int" ,_pid ,"发贴人id"),"用户名")

%>

</td>

<td width="65" bgcolor="#E4EAF2">

<div align="center"><%=

nt.executeQuery( dbName,

" select * from bbs_article_int where k ='父贴id' and v= "+ _pid +" ")

%></div>

</td>

<td width="66" bgcolor="#E4EAF2">

<div align="center"><%= nt.getKV( dbName,globalTableName+"_int" , _pid ,"人气") %></div>

</td>

<td width="145" bgcolor="#E4EAF2">

<div align="center"><%= nt.getKV( dbName,globalTableName+"_datetime" ,_pid ,"发贴时间",0,19) %></div>

</td>

</tr>

<% } %>

<tr bgcolor="#E4EAF2">

<td colspan="6"> <br>

<%@include file="ntPageShow.jsp"%>

</td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td width="31"><img src="images/nav.gif" width="21" height="21"></td>

<td width="371">

<%@include file="forum_jump_select.jsp"%>

</td>

<td width="372">

<div align="right"><a href="newthread.jsp?forumId=<%= request.getParameter("forumId")%>"><img src="images/t_new.gif" width="89" height="25" border="0"></a>&nbsp;&nbsp;</div>

</td>

</tr>

<form name="form1" method="post" action="">

</form>

</table>

<br>

</body>

</html>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有