📄 setforums.jsp
字号:
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%>
<font color=#333333><b>论坛性质</b><br>1. 正规论坛-只允许注册会员发言<br>2. 开放论坛-允许所有人发言<br>3. 评论论坛-坛主和版主允许发言,其他注册用户只能回复<br>4. 精华区-只允许版主和坛主发言和操作<br>5. 认证论坛-除坛主和版主外,其他注册用户发言需要认证</font>
</td>
<td bgcolor=#FFFFFF>
<select name="startnewthreads">
<option value="yes" selected>正规论坛
<option value="all">开放论坛
<option value="follow">评论论坛
<option value="no">精华区
</select>
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>允许对贴子投票评分?</b></font></td>
<td bgcolor=#FFFFFF>
<select name="ratings">
<option value="1">允许
<option value="0" selected>不允许
</select>
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%>
<font color=#333333><b>论坛图片</b><br>请输入图片名称,此图片被用来放置在页面左边菜单下。<BR><b>不要包含 URL 地址或绝对路径!</font>
</td>
<td bgcolor=#FFFFFF><input type=text size=40 name="dbgraphic" value="logo.gif"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%>
<font face=宋体 color=#333333><b>队伍图片</b>(如果没有,请保持原样)<br>请输入图片名称,此图片被用来放置在主页面下。<BR><b>不要包含 URL 地址或绝对路径!</b></font>
</td>
<td bgcolor=#FFFFFF><input type=text size=40 name="teamlogo" value=""></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font face=宋体 color=#333333><b>队伍网址</b>(如果没有,请保持原样)</td>
<td bgcolor=#FFFFFF><input type=text size=40 name="teamurl" value="http://"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF align=center colspan=2><input type=submit value="提 交"></td>
</tr>
</form>
<%
}
else if(checkaction.equals("yes")) {
tempSTR=request.getParameter("dbname");
if(tempSTR!=null && !tempSTR.equals(""))
dbname=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("dbdescription");
if(tempSTR!=null && !tempSTR.equals(""))
dbdescription=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("dbadmin");
if(tempSTR!=null && !tempSTR.equals(""))
dbadmin=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("dbviceadmin");
if(tempSTR!=null && !tempSTR.equals(""))
dbviceadmin=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("htmlstat");
if(tempSTR!=null && !tempSTR.equals(""))
htmlstat=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("lycodestat");
if(tempSTR!=null && !tempSTR.equals(""))
lycodestat=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("privateforum");
if(tempSTR!=null && !tempSTR.equals(""))
privateforum=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("dbpassword");
if(tempSTR!=null && !tempSTR.equals(""))
dbpassword=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("indexforum");
if(tempSTR!=null && !tempSTR.equals(""))
indexforum=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("startnewthreads");
if(tempSTR!=null && !tempSTR.equals(""))
startnewthreads=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("ratings");
if(tempSTR!=null && !tempSTR.equals(""))
ratings=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("dbgraphic");
if(tempSTR!=null && !tempSTR.equals(""))
dbgraphic=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("teamlogo");
if(tempSTR!=null && !tempSTR.equals(""))
teamlogo=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
tempSTR=request.getParameter("teamurl");
if(tempSTR!=null && !tempSTR.equals(""))
teamurl=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
errorinfo="";
if(!dbname.equals("")) {
number=connect.getRowNum("db where dbname=\""+dbname+"\" and forum="+forum);
if(number!=0)
errorinfo="此论坛名已经存在!请重新输入论坛名!";
else {
postok=connect.executeUpdate("insert into db (forum,dbname,dbdescription,htmlstat,lycodestat,privateforum,dbpassword,indexforum,startnewthreads,ratings,dbgraphic,teamlogo,teamurl) values ("+forum+",\""+dbname+"\",\""+dbdescription+"\",\""+htmlstat+"\",\""+lycodestat+"\",\""+privateforum+"\",\""+dbpassword+"\",\""+indexforum+"\",\""+startnewthreads+"\",\""+ratings+"\",\""+dbgraphic+"\",\""+teamlogo+"\",\""+teamurl+"\")");
rs=connect.executeQuery("select max(id) from db");
if(rs.next())
dbid=rs.getInt(1);
if(!dbadmin.equals("")) {
rs=connect.executeQuery("select id,usermode from author where username='"+dbadmin+"' and usermode!=1");
if(rs.next()) {
dbadminid=rs.getInt(1);
dbadminmode=rs.getInt(2);
if(dbadminmode<3) {
dbadminmode=3;
connect.executeUpdate("update author set usermode="+dbadminmode+" where username=\""+dbadmin+"\"");
}
number=connect.getRowNum("admin where authorname=\""+dbadmin+"\" and usermode=1 and db="+dbid);
if(number==0) {
connect.executeUpdate("insert into admin (db,authorid,authorname,usermode) values ("+dbid+","+dbadminid+",'"+dbadmin+"',1)");
msgtitle=",您好,您已经被升级为版主。";
msgmessage=",您好:<br> 您已经被升级为 "+dbname+" 版块的版主,请尽心尽责维护我们的论坛,介绍相关的技术,热心帮助网友解决问题,让我们一起把论坛做的更好!<BR><BR>----------------------------<BR>LyBBS 由凌云创作室『星语凌(teddy)』荣誉出品<BR>主页:http://www.unix-now.com/lybbs";
connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values (\""+cookiename+"\",\""+dbadmin+"\",\""+dbadmin+msgtitle+"\",\""+dbadmin+msgmessage+"\",now(),'get')");
}
}
else {
errorinfo="管理员不正确,请先确认此用户名是否已经注册!";
}
}
if(!dbviceadmin.equals("")) {
dbviceadmin=connect.Replace(dbviceadmin,"\'","\\\'");//把"'"转化为"\'"
dbviceadmin=connect.Replace(dbviceadmin,"\"","\\\"");//把"""转化为"\""
dbviceadmin=connect.Replace(dbviceadmin,",,",",");//把"""转化为"\""
if(!dbviceadmin.endsWith(",")) dbviceadmin+=",";
while(dbviceadmin.indexOf(",")!=-1) {
dbviceadminname=connect.tokenItem(dbviceadmin,",");
number=connect.getRowNum("admin where authorname=\""+dbviceadminname.trim()+"\" and usermode=0 and db="+dbid);
if(number==0) {
rs=connect.executeQuery("select id,usermode from author where username=\""+dbviceadminname+"\" and usermode!=1");
if(rs.next()) {
dbviceadminid=rs.getInt(1);
dbviceadminmode=rs.getInt(2);
if(dbviceadminmode<2) {
dbviceadminmode=2;
connect.executeUpdate("update author set usermode="+dbviceadminmode+" where username=\""+dbviceadminname+"\"");
}
connect.executeUpdate("insert into admin (db,authorid,authorname,usermode) values ("+dbid+","+rs.getInt(1)+",'"+dbviceadminname+"',0)");
msgtitle=",您好,您已经被设为论坛副版主。";
msgmessage=",您好:<br> 您已经被设为 "+dbname+" 版块的副版主,请尽心尽责维护我们的论坛,介绍相关的技术,热心帮助网友解决问题,让我们一起把论坛做的更好!<BR><BR>----------------------------<BR>LyBBS 由凌云创作室『星语凌(teddy)』荣誉出品<BR>主页:http://www.unix-now.com/lybbs";
connect.executeUpdate("insert into webqq (fromname,toname,title,message,sendat,operation) values (\""+cookiename+"\",\""+dbviceadminname+"\",\""+dbadmin+msgtitle+"\",\""+dbadmin+msgmessage+"\",now(),'get')");
}
else
errorinfo="副版主定义错误,没有此用户名!";
}
dbviceadmin=dbviceadmin.substring(dbviceadminname.length()+1);
}
}
}
}
else {
errorinfo="论坛名不能空!";
}
%>
<tr>
<td bgcolor=#333333"><font color=#FFFFFF><b>增加论坛</b></font></td>
</tr>
<tr>
<td bgcolor=#EEEEEE align=center><font color=#990000><b>增加论坛</b></font></td>
</tr>
<tr>
<td bgcolor=#FFFFFF><font color=#333333><b><%if(postok) {out.print("论坛添加完成! <a href='setforums.jsp'>查看</a><br>");if(!errorinfo.equals("")) out.print("版主或副版主添加错误!详细信息:<br>"+errorinfo);} else out.print(errorinfo);%></b></font></td>
</tr>
<%
}
}
else if(action.equals("edit")) {
int dbadminmode=0,dbadminid=0,dbviceadminid=0,dbviceadminmode=0,previousadminid=0,usermode=0;
String dbdescription="",dbadmin="",dbviceadmin="",htmlstat="",lycodestat="",privateforum="",dbpassword="",indexforum="",startnewthreads="",ratings="",dbgraphic="",teamlogo="",teamurl="";
String dbviceadminname="",query="";
if(checkaction.equals("")) {
tempSTR=request.getParameter("db");
if(tempSTR!=null && !tempSTR.equals(""))
dbid=Integer.parseInt(tempSTR);
if(dbid!=0) {
rs=connect.executeQuery("select forum,dbname,dbdescription,htmlstat,lycodestat,privateforum,dbpassword,indexforum,startnewthreads,ratings,dbgraphic,teamlogo,teamurl from db where id="+dbid);
if(rs.next()) {
forumid=rs.getInt(1);
dbname=rs.getString(2);
dbdescription=rs.getString(3);
htmlstat=rs.getString(4);
lycodestat=rs.getString(5);
privateforum=rs.getString(6);
dbpassword=rs.getString(7);
indexforum=rs.getString(8);
startnewthreads=rs.getString(9);
ratings=rs.getString(10);
dbgraphic=rs.getString(11);
teamlogo=rs.getString(12);
teamurl=rs.getString(13);
}
rs=connect.executeQuery("select authorname from admin where usermode=1 and db="+dbid);
if(rs.next())
dbadmin=rs.getString(1);
rs=connect.executeQuery("select authorname from admin where usermode=0 and db="+dbid);
while(rs.next())
dbviceadmin+=rs.getString(1)+",";
rs=connect.executeQuery("select forumname from forum where id="+forumid);
if(rs.next())
forumname=rs.getString(1);
}
%>
<form action="setforums.jsp" method="post">
<input type=hidden name="action" value="<%=action%>">
<input type=hidden name="checkaction" value="yes">
<input type=hidden name="dbid" value="<%=dbid%>">
<tr>
<td bgcolor=#333333" colspan=2><font color=#FFFFFF><b>欢迎来到论坛管理中心 / 编辑论坛</b></font></td>
</tr>
<tr>
<td bgcolor=#EEEEEE align=center colspan=2><font color=#990000><b>编辑 '<%=forumname%>' 分类中的 '<%=dbname%>' 论坛</b></font></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>论坛名称</b><br>请输入论坛名称</font></td>
<td bgcolor=#FFFFFF><input type=text size=40 name="dbname" value="<%=dbname%>"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>论坛描述</b><br>请输入论坛描述</font></td>
<td bgcolor=#FFFFFF><input type=text size=40 name="dbdescription" value="<%=dbdescription%>"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%>
<font color=#333333><b>论坛版主</b><br>请输入论坛版主(只能输一个)</font>
</td>
<td bgcolor=#FFFFFF><input type=text size=40 name="dbadmin" value="<%=dbadmin%>"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%>
<font color=#333333><b>论坛副版主</b><br>请输入论坛副版主(可以有多个,之间以英文逗号“,”分隔!请不要有空格或其它符号字符!)</font>
</td>
<td bgcolor=#FFFFFF><input type=text size=40 name="dbviceadmin" value="<%=dbviceadmin%>"></td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否使用 HTML 标签?</b></font></td>
<td bgcolor=#FFFFFF>
<select name="htmlstat">
<option value="1" <%if(htmlstat.equals("1")) out.print("selected");%>>使用
<option value="0" <%if(htmlstat.equals("0")) out.print("selected");%>>不使用
</select>
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否使用 LyBBS 标签?</b></font></td>
<td bgcolor=#FFFFFF>
<select name="lycodestat">
<option value="1" <%if(lycodestat.equals("1")) out.print("selected");%>>使用
<option value="0" <%if(lycodestat.equals("0")) out.print("selected");%>>不使用
</select>
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否作为私有论坛?</b></font></td>
<td bgcolor=#FFFFFF>
<select name="privateforum">
<option value="1" <%if(privateforum.equals("1")) out.print("selected");%>>是
<option value="0" <%if(privateforum.equals("0")) out.print("selected");%>否
</select>
对坛主和总斑竹无效
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>私有论坛密码</b>(必须配合上面参数使用)</font></td>
<td bgcolor=#FFFFFF>
<input type=text size=12 name="dbpassword" value="<%=dbpassword%>" maxlength=20> 对坛主和总斑竹无效
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%><font color=#333333><b>是否显示导航栏?</b></font></td>
<td bgcolor=#FFFFFF>
<select name="indexforum">
<option value="1" <%if(indexforum.equals("1")) out.print("selected");%>>是
<option value="0" <%if(indexforum.equals("0")) out.print("selected");%>>否
</select>
</td>
</tr>
<tr>
<td bgcolor=#FFFFFF width=40%>
<font color=#333333><b>论坛性质</b><br>1. 正规论坛-只允许注册会员发言<br>2. 开放论坛-允许所有人发言<br>3. 评论论坛-坛主和版主允许发言,其他注册用户只能回复<br>4. 精华区-只允许版主和坛主发言和操作<br>5. 认证论坛-除坛主和版主外,其他注册用户发言需要认证</font>
</td>
<td bgcolor=#FFFFFF>
<select name="startnewthreads">
<option value="yes" <%if(startnewthreads.equals("yes")) out.print("selected");%>>正规论坛
<option value="all" <%if(startnewthreads.equals("all")) out.print("selected");%>>开放论坛
<option value="follow" <%if(startnewthreads.equals("follow")) out.print("selected");%>>评论论坛
<option value="no" <%if(startnewthreads.equals("no")) out.print("selected");%>>精华区
</select>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -