修复论坛空白输入,上传文件未完成
This commit is contained in:
@@ -44,38 +44,44 @@
|
||||
<h2>帖子列表</h2>
|
||||
</div>
|
||||
<div class="col-md-2 pull-right">
|
||||
<a class="btn btn-default pull-right createNew" href="send.jsp"
|
||||
role="button">发表帖子</a>
|
||||
<a class="btn btn-default pull-right createNew"
|
||||
href="sendForum.jsp" role="button">发表帖子</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="mail-tools">
|
||||
<div class="btn-group pull-right"></div>
|
||||
|
||||
<%
|
||||
Connection con;
|
||||
Statement sql;
|
||||
ResultSet rs;
|
||||
int id = 0;
|
||||
String subject = "", content = "";
|
||||
Date time = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat();
|
||||
sdf.format(time);
|
||||
try {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
out.print("驱动异常");
|
||||
}
|
||||
con = DriverManager.getConnection("jdbc:mysql://localhost/db_bbs?useUnicode=true&characterEncoding=utf-8",
|
||||
"root", "");
|
||||
sql = con.createStatement();
|
||||
String send = null;
|
||||
content = "select id,subject,time from send";
|
||||
rs = sql.executeQuery(content);
|
||||
while (rs.next()) {
|
||||
id = rs.getInt("id");
|
||||
subject = rs.getString("subject");
|
||||
%>
|
||||
<form action="forum/deletesend.jsp" method="post">
|
||||
<input class="btn btn-danger deleteTitle pull-right"
|
||||
type="submit" value="删除帖子">
|
||||
<%
|
||||
Connection con;
|
||||
Statement sql;
|
||||
ResultSet rs;
|
||||
int id = 0;
|
||||
String regex1 = "<(?!img).*?>";
|
||||
/* String username = "admin"; */
|
||||
String subject = "", content = "", username = "";
|
||||
Date time = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat();
|
||||
sdf.format(time);
|
||||
try {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
out.print("驱动异常");
|
||||
}
|
||||
con = DriverManager.getConnection("jdbc:mysql://localhost/db_bbs?useUnicode=true&characterEncoding=utf-8",
|
||||
"root", "");
|
||||
sql = con.createStatement();
|
||||
String send = null;
|
||||
content = "select id,subject,username,time,flag from send order by flag desc,id";
|
||||
rs = sql.executeQuery(content);
|
||||
while (rs.next()) {
|
||||
id = rs.getInt("id");
|
||||
subject = rs.getString("subject");
|
||||
username = rs.getString("username");
|
||||
String str = String.valueOf(id);
|
||||
%>
|
||||
|
||||
|
||||
|
||||
@@ -83,53 +89,97 @@
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<table class="table table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="checkbox"></td>
|
||||
<td><a href="detail.jsp?id=<%=id%>"><%=subject%></a></td>
|
||||
<td class="text-right mail-date"><%=rs.getDate("time")%> <%=rs.getTime("time")%></td>
|
||||
</tr>
|
||||
<table class="table table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="checkbox" name="chk"
|
||||
id="chk" value=<%=id%>></td>
|
||||
<%
|
||||
if (rs.getInt("flag") == 1 && subject.matches(regex1)) {
|
||||
//置顶且匹配
|
||||
%>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
con.close();
|
||||
%>
|
||||
<td><a href=" >"><strong><script
|
||||
type='text/html' style='display:inline;color:red;'><%=subject%></script></strong></a>
|
||||
</td>
|
||||
<%
|
||||
}
|
||||
if (rs.getInt("flag") == 0 && !(subject.matches(regex1))) {
|
||||
//不置顶不匹配
|
||||
%>
|
||||
|
||||
<td><a href="detail.jsp?id=<%=id%>"><%=subject%></a>
|
||||
</td>
|
||||
|
||||
<%
|
||||
}
|
||||
if (rs.getInt("flag") == 1 && !(subject.matches(regex1))) {
|
||||
//置顶但不匹配
|
||||
%>
|
||||
|
||||
<td><a href="detail.jsp?id=<%=id%>"><strong><script
|
||||
type='text/html' style='display:inline;color:red;'><%=subject%></script></strong></a>
|
||||
</td>
|
||||
|
||||
<%
|
||||
}
|
||||
if (rs.getInt("flag") == 0 && subject.matches(regex1)) {
|
||||
//不置顶但匹配
|
||||
%>
|
||||
<td><a href="detail.jsp?id=<%=id%>"><script
|
||||
type='text/html' style='display:inline'><%=subject%></script></a>
|
||||
</td>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<td class="text-right mail-date"><%=username%>  <%=rs.getDate("time")%> <%=rs.getTime("time")%></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
con.close();
|
||||
%>
|
||||
|
||||
</form>
|
||||
<div class="col-md-4 pull-right"></div>
|
||||
</div>
|
||||
</div>
|
||||
<%@ include file="module/footer.jsp"%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<%@ include file="module/footer.jsp"%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Mainly scripts -->
|
||||
<script src="js/jquery-2.1.1.js"></script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
|
||||
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
|
||||
<!-- Mainly scripts -->
|
||||
<script src="js/jquery-2.1.1.js"></script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
|
||||
<script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
|
||||
|
||||
<!-- Custom and plugin javascript -->
|
||||
<script src="js/inspinia.js"></script>
|
||||
<script src="js/plugins/pace/pace.min.js"></script>
|
||||
<!-- Custom and plugin javascript -->
|
||||
<script src="js/inspinia.js"></script>
|
||||
<script src="js/plugins/pace/pace.min.js"></script>
|
||||
|
||||
<!-- iCheck -->
|
||||
<script src="js/plugins/iCheck/icheck.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.i-checks').iCheck({
|
||||
checkboxClass : 'icheckbox_square-green',
|
||||
radioClass : 'iradio_square-green',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- iCheck -->
|
||||
<script src="js/plugins/iCheck/icheck.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.i-checks').iCheck({
|
||||
checkboxClass : 'icheckbox_square-green',
|
||||
radioClass : 'iradio_square-green',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user