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

📄 setbadwords.jsp

📁 jsp bbs源代码
💻 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="config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="../include/connect.jsp"%>
<%
int lastfoldindex=0;
String admindir="",installdir="";
boolean installdirex=true;
admindir=connect.ReplaceChar(request.getRealPath("/"),'\\','/');
lastfoldindex=admindir.lastIndexOf("/");
installdir=admindir.substring(0,lastfoldindex)+"/install";
File dir=new File(installdir);
installdirex=dir.exists();
if(installdirex) {
%>
<HTML>
<HEAD><TITLE>安装错误</TITLE></HEAD>
<BODY BGCOLOR=#ffffff TEXT=#000000>
 <H1>LyBBS 错误</H1>
 <FONT COLOR=#ff0000><B>安全警告</B>:
 <br>install 文件夹仍然在您的服务器上,请马上利用 FTP 来将其删除!!
 <br> 当你删除之后,刷新本页面重新进入管理中心。</FONT>
</body>
</html>
<%
return;
}
int number=0;
String action="",tempSTR="";
boolean postok=false;
tempSTR=request.getParameter("action");
if(tempSTR!=null && !tempSTR.equals(""))
  action=tempSTR;
%>
<!--//html from here-->
<%@ include file="boardprepare.jsp"%>
<%@ include file="head.jsp"%>
<style>
  .delbutton {BORDER-RIGHT: #ff9933 1px solid; BORDER-TOP: #ff9933 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #ff9933 1px solid; COLOR: #ff6633; BORDER-BOTTOM: #ff9933 1px solid; FONT-FAMILY: 宋体; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff; CURSOR:hand}
</style>
<body bgcolor="#555555" topmargin=5 leftmargin=5>
<table width=95% cellpadding=0 cellspacing=1 border=0 bgcolor=#000000 align=center>
 <tr>
  <td>
  <table width=100% cellpadding=0 cellspacing=1 border=0>
   <tr>
    <td width=28% valign=top bgcolor=#FFFFFF>
     <%@ include file="left.jsp"%>
    </td>
    <td width=70% valign=top bgcolor=#FFFFFF>
   <table width=100% cellpadding=6 cellspacing=0 border=0>
<%
if(!cookiemode.equals("4")) {
%>
    <form action="admincenter.jsp" method="post">
    <input type=hidden name="action" value="login">
    <tr>
     <td bgcolor="#333333" colspan=2><font face=宋体 color=#FFFFFF>
      <b>欢迎来到 LyBBS 论坛管理中心</b>
     </td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE valign=middle colspan=2 align=center>
      <font face=宋体 color=#333333><b>请输入您的用户名、密码登陆</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle width=40% align=right>
      <font face=宋体 color=#555555>请输入您的用户名</font>
     </td>
     <td bgcolor=#FFFFFF valign=middle>
      <input type=text name="supername" maxlength=15>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle width=40% align=right>
      <font face=宋体 color=#555555>请输入您的密码</font>
     </td>
     <td bgcolor=#FFFFFF valign=middle>
      <input type=password name="superpassword" maxlength=20>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle colspan=2 align=center>
      <input type=submit name="submit" value="登 陆">
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle colspan=2 align=left>
      <font face=宋体 color=#555555>
       <blockquote><b>请注意</b>
        <p><b>只有论坛的坛主才能登陆论坛管理中心。<br>未经过授权的尝试登陆行为将会被记录在案!</b>
        <p>在进入论坛管理中心前,请确定你的浏览器打开了 Cookie 选项。
        <br> Cookie 只会存在于当前的浏览器进程中。为了安全起见,当你关闭了浏览器后,Cookie 会失效并被自动删除。
       </blockquote>
      </font>
     </td>
    </tr>
    </form>
<%
}
else {
  String checkaction="",errorinfo="";
  tempSTR=request.getParameter("checkaction");
  if(tempSTR!=null && !tempSTR.equals(""))
    checkaction=tempSTR;
  if(checkaction.equals("")) {
%>
    <form action="setbadwords.jsp" method="post">
    <input type=hidden name="checkaction" value="yes">
    <tr>
     <td bgcolor=#333333" colspan=2><font face=宋体 color=#FFFFFF><b>欢迎来到论坛管理中心 / 不良词语过滤</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE valign=middle align=center colspan=2><font face=宋体 color=#333333><b>不良词语过滤</b></font></td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle colspan=2>
      <font face=宋体 color=#000000>
       不良词语过滤可以阻止一些不好的字眼出现在论坛中。<br>
       这样,不良词语在<b>发表文章</b>时,或在用户查看、引用时,仅会被显示为****。<br>
       这意味着不良词语过滤是永久性的。当你增加一个新的过滤时,所有的文章都会被过滤。<br><br>
       <b>使用方法:</b>使用方法:</b>一行输入一个要过滤的词语。<BR><br>
       <b>注意1,每行只能写一个!</b><br><br>
       <b>注意2,尽量避免使用 空格 和 * ( ) 等符号!</b><br><br>
       <b>例如:</b>fuck<br><br>
      </font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle align=center colspan=2>
      <textarea cols=60 rows=6 name="banwordcontent"><%
  rs=connect.executeQuery("select banword from banword");
  while(rs.next()) {
      out.print(rs.getString(1)+"\n");
  }
%></textarea>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF valign=middle align=center colspan=2><input type=submit name=submit value="提 交"></td>
    </tr>
    </form>
<%
  }
  else if(checkaction.equals("yes")) {
    String banwordcontent="",banword="",newword="";
    tempSTR=request.getParameter("banwordcontent");
    if(tempSTR!=null && !tempSTR.equals(""))
      banwordcontent=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
    if(!banwordcontent.equals("")) {
      banwordcontent=connect.Replace(banwordcontent," ","");//把" "转化为""
      banwordcontent=connect.Replace(banwordcontent,"\'","\\\'");//把"'"转化为"\'"
      banwordcontent=connect.Replace(banwordcontent,"\"","\\\"");//把"""转化为"\""
      banwordcontent=connect.Replace(banwordcontent,"\r\n\r\n","");//把"\n\n"转化为""
      if(!banwordcontent.endsWith("\n")) banwordcontent+="\n";
      int queryid=0;
      String querydelete="";
      querydelete="delete from banword where";
      while(banwordcontent.indexOf("\n")!=-1) {
        banword=connect.tokenItem(banwordcontent,"\n");
        number=connect.getRowNum("banword where banword=\""+banword.trim()+"\"");
        if(number==0) {
          connect.executeUpdate("insert into banword (banword) values (\""+banword.trim()+"\")");
          rs=connect.executeQuery("select id,title from posts where title like \"%"+banword.trim()+"%\"");
          while(rs.next()) {
            newword=connect.Replace(rs.getString(2),banword.trim(),"****");
            connect.executeUpdate("update posts set title=\""+newword+"\" where id="+rs.getInt(1));
          }
          rs=connect.executeQuery("select id,content from posts where content like \"%"+banword.trim()+"%\"");
          while(rs.next()) {
            newword=connect.Replace(rs.getString(2),banword.trim(),"****");
            connect.executeUpdate("update posts set content=\""+newword+"\" where id="+rs.getInt(1));
          }
        }
        if(queryid!=0)
          querydelete+=" and banword!=\""+banword.trim()+"\"";
        else
          querydelete+=" banword!=\""+banword.trim()+"\"";
        queryid++;
        banwordcontent=banwordcontent.substring(banword.length()+1);
      }
      connect.executeUpdate(querydelete);
    }
%>
    <tr>
     <td bgcolor="#333333">
      <font face=宋体 color=#FFFFFF><b>不良词语过滤</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF>
      <font color=#333333><center><b>所有的信息已经保存</b></center><br><br>
       <b>你已经过滤了下列不良词语,这些词语将全部被替换成****。</b><br><br>
<%
   rs=connect.executeQuery("select banword from banword");
    while(rs.next()) {
      out.print(rs.getString(1)+"<br>");
    }
%>
       <br><br><br><center><a href="setbadwords.jsp">添加更多的过滤词语</a></center>
      </font>
     </td>
    </tr>
<%
  }
}
%>
   </table>
  </td>
 </tr>
</table>
  </td>
 </tr>
</table>
<%
rs.close();
connect.close();
%>
</body>
</html>

⌨️ 快捷键说明

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