📄 newposts.jsp
字号:
<%
/*##################################################################**
**# LyBBS ver 1.2.b2 (1.2.beta-2版) / 凌云论坛 ver 1.2.b2 #**
**# #**
**# 版权所有: 凌云工作室 (原流星电脑工作室) #**
**# #**
**# 制作人 : 星语凌 『teddy (Yongshan Ye)』 #**
**# #**
**# 主页地址: http://www.unix-now.com/lybbs 凌云论坛主页 #**
**# http://www.ierp.info/lybbs 凌云论坛镜像站 #**
**# http://horseye@sina.com/ 凌云论坛支持信箱 #**
**# #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="include/connect.jsp"%>
<%
int db=0;
String tempSTR="",submit="";
//用户cookie变量声明
int id=0,styleid=0,membergone=0;
String cookieid="",cookiename="",usermode="",cookiemode="";
//日期定义
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0,now_second=0;
String now_date="",now_time="";
//定义boardprepare.jsp中的变量
String onlineview="",dispview="",boardtitle="",boardname="",title="",version="",copyright="",support="",programmer="",programemail="",homename="",homeurl="",togb="1",status="",maintainreason="",announcement="1",boardurl="",showfastlogin="",dispborn="",styleQuery="";
//定义本页变量
int number=0,forumid=0,dbid=0;
String forumname="",dbname="";
ResultSet rs2,rs3;
%>
<%@ include file="include/boardprepare.jsp"%>
<%@ include file="include/style.jsp"%>
<%
tempSTR=request.getParameter("submit");
if(tempSTR!=null && !tempSTR.equals(""))
submit=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
%>
<!--//html from here-->
<%@ include file="include/head.jsp"%>
<style>
.gray {CURSOR:hand;filter:gray}
INPUT {BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc}
</style>
<script language="JavaScript">
function openscript2(url, width, height) {
var Win = window.open(url,"openwindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
}
</script>
<body <%=lbbody%>>
<p>
<br>
<%
if(cookiemode.equals("1")) {
boolean logok=false;
String username="",password="",userstatus="";
if(submit.equals("登 陆")) {
tempSTR=request.getParameter("username");
if(tempSTR!=null && !tempSTR.equals(""))
username=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("password");
if(tempSTR!=null && !tempSTR.equals(""))
password=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
if(!username.equals("") && !username.equals("客人") && !password.equals("")) {
number=connect.getRowNum("author where username='"+username+"' and password='"+password+"'");
if(number>0) {
rs=connect.executeQuery("select id,status,usermode from author where username='"+username+"' and password='"+password+"'");
if(rs.next()) {
cookieid=String.valueOf(rs.getInt(1));
userstatus=rs.getString(2);
cookiemode=String.valueOf(rs.getInt(3));
cookiename=username;
if(userstatus.equals("0")) {
%>
<%@ include file="include/setcookie.jsp"%>
<%
logok=connect.executeUpdate("update author set lastactivetime=now(),logintime=now(),online='1',visittimes=visittimes+1 where username='"+username+"' and password='"+password+"'");
}
}
}
}
}
if(logok) {
%>
<script>this.location.reload();</script>
<%
}
else {
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<form action="messanger.jsp" method="post">
<tr>
<td bgcolor=<%=miscbacktwo%> colspan=2 align=center>
<font color=<%=fontcolormisc%>><b>请输入您的用户名、密码登陆</b></font>
</td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的用户名</font></td>
<td bgcolor=<%=miscbackone%>><input type=text name="username" value="<%=cookiename%>"></td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的密码</font></td>
<td bgcolor=<%=miscbackone%>><input type=password name="password"></td>
</tr>
<tr>
<td bgcolor=<%=miscbacktwo%> colspan=2 align=center><input type=submit name="submit" value="登 陆"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%
}
}
else {
%>
<table width=<%=tablewidth%> align=center cellspacing=0 cellpadding=1 border=0 bgcolor=<%=tablebordercolor%>>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr>
<td bgcolor=<%=miscbacktwo%> align=center colspan=2><font color=<%=fontcolormisc%>><b>您最后访问本论坛后的新文章</b></font></td>
</tr>
<tr>
<td bgcolor=<%=miscbackone%> align=center colspan=2>
<font color=<%=fontcolormisc%>>注意:只有当您成功登陆后才能够检查</font>
</td>
</tr>
<%
//查看论坛是否有新帖
String activetime="0000-00-00";
if(!cookiemode.equals("1")) {
rs=connect.executeQuery("select activetime from author where id="+cookieid);
if(rs.next())
activetime=rs.getString(1);
}
number=connect.getRowNum("posts where postat>'"+activetime+"'");
if(number>0) {
rs=connect.executeQuery("select id,forumname from forum order by id");
while(rs.next()) {
forumid=rs.getInt(1);
forumname=rs.getString(2);
%>
<tr>
<td bgcolor=<%=catback%> colspan=2><font color=<%=catfontcolor%>><b><%=forumname%></b></font></td>
</tr>
<%
rs2=connect.executeQuery2("select id,dbname from db where forum="+forumid+" order by id");
while(rs2.next()) {
dbid=rs2.getInt(1);
dbname=rs2.getString(2);
number=connect.getRowNum("posts where db="+dbid+" and postat>'"+activetime+"'");
if(number>0) {
rs3=connect.executeQuery3("select groupid,title,author,date_format(postat,'%Y年%m月%d日 %H:%i') as postat from posts where db="+dbid+" and postat>'"+activetime+"'");
while(rs3.next()) {
%>
<tr>
<td bgcolor=<%=forumcolortwo%> colspan=2><font color=<%=forumfontcolor%>><b>-=> <%=dbname%></b></font></td>
</tr>
<tr>
<td bgcolor=<%=forumcolortwo%>><font color=<%=forumfontcolor%>><a href=topic.jsp?db=<%=dbid%>&topic=<%=rs3.getString(1)%> target=_blank><%=rs3.getString(2)%></a></td>
<td bgcolor=<%=forumcolortwo%>>
<font color=<%=forumfontcolor%>>发言者:<a href=profile.jsp?action=show&member=<%=rs3.getString(3)%> target=_blank><%=rs3.getString(3)%></a>
时间:<font color="<%=lastpostfontcolor%>"><%=rs3.getString(4)%></font>
</font>
</td>
</tr>
<%
}
}
}
}
}
else {
%>
<tr>
<td bgcolor=<%=forumcolortwo%> colspan=2 align=center>
<font color=<%=forumfontcolor%>><b>您最后一次访问本论坛后没有新文章。</b>
</font>
</td>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
<%
}
%>
<%
rs.close();
connect.close();
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -