资源简介
一个简单的bbs论坛模板+数据库+静态页面

代码片段和文件信息
package com.bbs.common;
import com.bbs.DAO.*;
import com.bbs.entitiy.*;
import java.util.*;
public class TopicPageMaker {
//第一页页码
private int firstPage = 1;
//最后一页页码
private int lastPage;
//上一页
private int prePage;
//下一页
private int nextPage;
//当前页
private int currentPage;
//每页显示数量
private int sizeOfPage = 10;
//板块ID
private int boardID ;
private TopicInfoDAO topicDao = new TopicInfoDAO();
private ReplyInfoDAO replyDao = new ReplyInfoDAO();
public TopicPageMaker(int currentPageint boardID){
this.currentPage = currentPage;
this.firstPage = 1;
//如果是刚好可以除尽的数量 ,则商就是页数;否则商+1为页数
this.lastPage = topicDao.GetAllTopicCount(boardID) % sizeOfPage == 0 ? topicDao.GetAllTopicCount(boardID) / sizeOfPage:topicDao.GetAllTopicCount(boardID) / sizeOfPage+1;
}
public TopicPageMaker(int currentPageint boardIDint topicID){
this.currentPage = currentPage;
this.firstPage = 1;
//如果是刚好可以除尽的数量 ,则商就是页数;否则商+1为页数
this.lastPage = replyDao.GetAllReplyCount(topicID) % sizeOfPage == 0 ? replyDao.GetAllReplyCount(topicID) / sizeOfPage:replyDao.GetAllReplyCount(topicID) / sizeOfPage+1;
}
public int getPrePage(){
if(this.currentPage == 1){
this.prePage = 1;
}else{
this.prePage = this.currentPage -1;
}
return this.prePage;
}
public int getNextPage(){
if(this.currentPage == this.lastPage){
this.nextPage = this.lastPage;
}else{
this.nextPage = this.currentPage + 1;
}
return this.nextPage;
}
public List getTopicByPage(int boardID){
List list = new ArrayList();
int count = (this.currentPage-1)*sizeOfPage;
//根据页码查询帖子
String sql = “select top “+sizeOfPage+“ * from TopicInfo where boardID = “+boardID+“ and TopicID not in (select top “+count+“ topicID from TopicInfo where boardID=“+boardID+“)“;
list = topicDao.GetTopicInfoBySql(sql);
return list;
}
public List GetReplyByPage(int topicID){
List list = new ArrayList();
int count = (this.currentPage-1)*(sizeOfPage-1);
String sql =“select top “+(sizeOfPage-1)+“ * from ReplyInfo where topicID = “+topicID+“ and replyID not in (select top “+count+“ replyID from replyInfo where topicID=“+topicID+“)“;
list = replyDao.GetReplyInfoBySql(sql);
return list;
}
public void setBoardID(int boardID) {
this.boardID = boardID;
}
public int getBoardID() {
return boardID;
}
public int getFirstPage(){
return this.firstPage;
}
public int getLastPage(){
return this.lastPage;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3181 2007-09-30 09:51 bbs\bbs静态页面\detail.html
文件 712 2007-07-03 08:15 bbs\bbs静态页面\image\board.gif
文件 3728 2007-07-26 22:47 bbs\bbs静态页面\image\head\1.gif
文件 3491 2007-07-26 22:47 bbs\bbs静态页面\image\head\10.gif
文件 3574 2007-07-26 22:47 bbs\bbs静态页面\image\head\11.gif
文件 3624 2007-07-26 22:47 bbs\bbs静态页面\image\head\12.gif
文件 3362 2007-07-26 22:47 bbs\bbs静态页面\image\head\13.gif
文件 3472 2007-07-26 22:47 bbs\bbs静态页面\image\head\14.gif
文件 3343 2007-07-26 22:47 bbs\bbs静态页面\image\head\15.gif
文件 3945 2007-07-26 22:48 bbs\bbs静态页面\image\head\2.gif
文件 3762 2007-07-26 22:47 bbs\bbs静态页面\image\head\3.gif
文件 3560 2007-07-26 22:48 bbs\bbs静态页面\image\head\4.gif
文件 3819 2007-07-26 22:47 bbs\bbs静态页面\image\head\5.gif
文件 3427 2007-07-26 22:47 bbs\bbs静态页面\image\head\6.gif
文件 3256 2007-07-26 22:47 bbs\bbs静态页面\image\head\7.gif
文件 3520 2007-07-26 22:47 bbs\bbs静态页面\image\head\8.gif
文件 3660 2007-07-26 22:47 bbs\bbs静态页面\image\head\9.gif
..A.SH. 8704 2007-08-06 11:50 bbs\bbs静态页面\image\head\Thumbs.db
文件 3825 2007-07-18 14:25 bbs\bbs静态页面\image\logo.gif
文件 1907 2007-07-27 19:18 bbs\bbs静态页面\image\post.gif
文件 1958 2007-07-27 19:19 bbs\bbs静态页面\image\reply.gif
..A.SH. 12288 2007-08-06 11:50 bbs\bbs静态页面\image\Thumbs.db
文件 311 2007-07-26 22:32 bbs\bbs静态页面\image\topic.gif
文件 5441 2007-09-30 09:50 bbs\bbs静态页面\index.html
文件 3622 2007-09-30 09:49 bbs\bbs静态页面\list.html
文件 1544 2007-09-30 09:46 bbs\bbs静态页面\login.html
文件 2445 2007-09-30 09:48 bbs\bbs静态页面\post.html
文件 3212 2007-09-30 09:47 bbs\bbs静态页面\reg.html
文件 2728 2007-07-30 09:38 bbs\bbs静态页面\st
文件 2464 2007-09-30 09:48 bbs\bbs静态页面\update.html
............此处省略117个文件信息
- 上一篇:XRD处理软件JADE
- 下一篇:STM32F407 DMA+串口接收不定长数据程序
相关资源
- Scratch源码
- 西门坡论坛pb框架 普通版 2.0 非常漂
- E4A无障碍跨程序操作类库(带源码、
- 设备管理系统源码
- 安卓wifi直连app源码
- 我的世界源码(易语言版)
- labview编程软件滤波器以及编写程序设
- 我的界面(visual foxpro)源码
- 易语言:一键cf基址源码
- The Secret Path 3D 3D魔方迷宫[源码][scra
- scratch垃圾分类源码(最终版本).sb
- 安卓QQ6.71协议源码易语言,qq协议源码
- 编译原理实验工具及参考源码(lex&
- E盾偷后台工具源码
- UNIX/LINUX编程实践教程的源码
- 十以内加减法练习 powerbuilder源码
- 农场开发项目
- OCR源码
- PLC上位机编程软件
- 用foobar2000听google音乐[更新一下]
- 学生信息管理系统源码
- about 论坛信息管理系统
- 用VC 编写的仿QQ聊天室程序源代码
- 毕业论文之温度传感器DS18B20(源码
- 可自定义导航网站源码
- 栅栏填充算法源码(VC)
- msp430F149操作红外接收模块源码
- [免费]图像识别c 源码
- 周易排盘源码
- RSA算法源码
评论
共有 条评论