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

📄 admin_forumstyle.jsp

📁 一个用jsp写的完整的论坛源代码
💻 JSP
字号:
<%@ page contentType="text/html;charset=GBK"%>
<%@ include file="INC/const.jsp"%>
<%@ page import = "java.util.Vector,
					com.bcxy.bbs.forum.admin.*"%>
<title><%=forumName%>--管理页面</title>
<link rel="stylesheet" type="text/css" href="forum.css">
<BODY topmargin="20">
<%
	try{
		if(session.getAttribute("adminFlag")==null){
			throw new Exception("本页面为管理员专用,请<a href=elogin.jsp>登陆管理</a>后进入。");
		}
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tableWidth%> bgcolor=<%=tableBackColor%> align=center>
  <tr>
    <td>
      <table cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr bgcolor='<%=tableTitleColor%>'>
        <td align=center colspan="2">欢迎<b>
					<%=session.getAttribute("adminName")%></b>进入管理页面
        </td>
        </tr>
        <tr bgcolor=<%=tableBodyColor%>>              
          <td width="20%" valign=top> 
            <%@include file="admin_left.jsp"%>
          </td>             
          <td width="80%" valign=top> 
            <table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr>
                <td>1.注意事项: 
                   <p><font color=<%=alertFontColor%>>2.特别注意</font>:
                </td>
              </tr>
              <tr>
              <td>
              <p align=cetner><b><a href=admin_forumstyle.jsp>论坛样式管理</a> | <a href="admin_forumstyle.jsp?action=add">新建论坛样式</a></p>
              </td>
              <tr>
            </table>
<%
		String action=ParamUtil.getString(request,"action");
		if(action==null||action.equals("")){
			  response.sendRedirect("admin_forumstyle.jsp?action=styleinfo");
		}
		else if(action.equals("add")){
%>
 <form action ="admin_forumstyle.jsp?action=savenew" method=post>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor=<%=tableTitleColor%>> 
<td width="52%" height=22><b>字段名称:</b> </td>
<td width="48%"><b>变量值:</b> </td>
</tr>
<tr> 
<td width="52%">论坛样式序号(注意不能和别的论坛样式序号相同)</td>
<td width="48%"> 
<input type="text" name="id" size="4">
</td>
</tr>
<tr> 
<td width="52%">论坛样式名</td>
<td width="48%"> 
<input type="text" name="stylename" size="24">
</td>
</tr>
<tr> 
<td width="52%">样式属性<BR>0表示不可用,1表示可用,2表示默认</td>
<td width="48%">
<select name="flag">
<option value="0">不可用 
<option value="1" selected>可用
<option value="0">默认
</select>
</td>
</tr>
<tr> 
<td width="52%">版面表格边框颜色</td>
<td width="48%"> 
<input type="text" name="Tableback" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面表格边框颜色2</td>
<td width="48%"> 
<input type="text" name="aTableback" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面标题表格颜色</td>
<td width="48%"> 
<input type="text" name="Tabletitle" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面标题表格颜色2</td>
<td width="48%"> 
<input type="text" name="aTabletitle" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面内容表格颜色1</td>
<td width="48%"> 
<input type="text" name="Tablebody" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面内容表格颜色2,颜色1和颜色2在bbs风格中互相穿插排列</td>
<td width="48%"> 
<input type="text" name="aTablebody" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面标题表格字体颜色</td>
<td width="48%"> 
<input type="text" name="TableFont" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">版面内容表格字体颜色</td>
<td width="48%"> 
<input type="text" name="TableContent" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">提醒语句颜色</td>
<td width="48%"> 
<input type="text" name="AlertFont" size="24" value="">
</td>
</tr>
<tr> 
<td width="52%">背景图片</td>
<td width="48%"> 
<input type="text" name="bodybgimage" size="35" value="image/forumstyle/">
</td>
</tr>
<tr bgcolor="<%=tableTitleColor%>"> 
<td width="52%">&nbsp;</td>
<td width="48%"> 
<input type="submit" name="Submit" value="添加论坛样式">
</td>
</tr>
</table>
</form>
<%
}else if(action.equals("edit")){
%>
 <form action ="admin_forumstyle.jsp?action=savedit" method=post>           
<%
	int editID;
	try{
		editID=ParamUtil.getInt(request,"editid");
	}
	catch(Exception e){
		throw new Exception("对不起,您没选择,编辑论坛样式的ID");
	}
	
	ForumStyle forumStyle = ForumStyleManager.getForumStyle(editID);
	if(forumStyle==null)
			throw new Exception("错误的论坛样式");
%>            
<input type='hidden' name=editid value='<%=editID%>'>
            
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr bgcolor=<%=tableTitleColor%>> 
<td width="52%" height=22><b>字段名称:</b> </td>
<td width="48%"> 
<div align="center"><b>变量值:</b></div>
</td>
</tr>
<tr>
<td width="52%" height=24><font color="<%=tableContentColor%>"><B>论坛样式ID</B></font></td>
<td width="48%"> 
<input type="text" name="id" size="3"  value = "<%=forumStyle.getId()%>">
</td>
</tr>
<tr> 
<td width="52%" height=24><font color="<%=tableContentColor%>"><B>论坛样式名称</B></font></td>
<td width="48%"> 
<input type="text" name="stylename" size="24"  value = "<%=forumStyle.getStyleName()%>">
</td>
</tr>
<tr> 
<td width="52%" height=24><font color="<%=tableContentColor%>"><B>样式属性</B><BR>0表示不可用,1表示可用,2表示默认</font></td>
<td width="48%"> 
<select name="flag">
<option value="0" <%if(forumStyle.getFlag()==0) out.print("selected");%>>不可用</option>
<option value="1" <%if(forumStyle.getFlag()==1) out.print("selected");%>>可用</option>
<option value="2" <%if(forumStyle.getFlag()==2) out.print("selected");%>>默认样式</option>
</select>
</td>
</tr>
<tr> 
<td width="52%">版面表格边框颜色</td>
<td width="48%"> 
<input type="text" name="Tableback" size="24" value="<%=forumStyle.getTableBack()%>">
</td>
</tr>
<tr> 
<td width="52%">版面表格边框颜色2</td>
<td width="48%"> 
<input type="text" name="aTableback" size="24" value="<%=forumStyle.getATableBack()%>">
</td>
</tr>
<tr> 
<td width="52%">版面标题表格颜色</td>
<td width="48%"> 
<input type="text" name="Tabletitle" size="24" value="<%=forumStyle.getTableTitle()%>">
</td>
</tr>
<tr> 
<td width="52%">版面标题表格颜色2</td>
<td width="48%"> 
<input type="text" name="aTabletitle" size="24" value="<%=forumStyle.getATableBack()%>">
</td>
</tr>
<tr> 
<td width="52%">版面内容表格颜色1</td>
<td width="48%"> 
<input type="text" name="Tablebody" size="24" value="<%=forumStyle.getTableBody()%>">
</td>
</tr>
<tr> 
<td width="52%">版面内容表格颜色2,颜色1和颜色2在bbs风格中互相穿插排列</td>
<td width="48%"> 
<input type="text" name="aTablebody" size="24" value="<%=forumStyle.getATableBody()%>">
</td>
</tr>
<tr> 
<td width="52%">版面标题表格字体颜色</td>
<td width="48%"> 
<input type="text" name="TableFont" size="24" value="<%=forumStyle.getTableFont()%>">
</td>
</tr>
<tr> 
<td width="52%">版面内容表格字体颜色</td>
<td width="48%"> 
<input type="text" name="TableContent" size="24" value="<%=forumStyle.getTableContent()%>">
</td>
</tr>
<tr> 
<td width="52%">提醒语句颜色</td>
<td width="48%"> 
<input type="text" name="AlertFont" size="24" value="<%=forumStyle.getAlertFont()%>">
</td>
</tr>
<tr> 
<td width="52%">背景图片</td>
<td width="48%"> 
<input type="text" name="bodybgimage" size="35" value="<%=forumStyle.getBodyBgImage()%>">
</td>
</tr>
<tr bgcolor="<%=tableTitleColor%>"> 
<td width="52%">&nbsp;</td>
<td width="48%"> 
<input type="submit" name="Submit" value="提交">
</td>
</tr>
</table>
</form>
<%
}else if(action.equals("styleinfo")){
%>
            <table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr bgcolor="<%=tableTitleColor%>">
                <td height="21"><font color="<%=tableContentColor%>"><a href="admin_forumstyle.jsp?action=add"><font color="<%=tableContentColor%>">新增论坛样式</font></a></td>
              </tr>
            </table>
<%
try{
	  Vector forumStyleVector = ForumStyleManager.getAllForumStyles();
		for( i=0; i<forumStyleVector.size(); i++){
			  ForumStyle forumStyle = (ForumStyle)forumStyleVector.get(i);
    		int forumStyleID = forumStyle.getId();
    		String forumStyleName = forumStyle.getStyleName();
    		int ifDef = forumStyle.getFlag();
            %>
            <table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr> 
                <td height="18"><%=forumStyleID%>,论坛样式名:<%=forumStyleName%>&nbsp;&nbsp;<%=ifDef==2?"[默认样式]":""%></td>
              </tr>
              <tr>
                <td height="18">论坛样式简介:</td>
              </tr>
              <tr>
                <td height="15"><a href="admin_forumstyle.jsp?action=edit&editid=<%=forumStyleID%>">编辑此论坛样式</a> | <a href="admin_forumstyle.jsp?action=del&id=<%=forumStyleID%>" onclick="return window.confirm('确定要删除吗?');">删除此论坛样式</a></td>
              </tr>
            </table>
<hr color=black height=1 width="70%" align=left>
<%
				}
			}
			catch(Exception e){}
%>
          </td>
            </tr>
        </table>      
        </td>
       </tr>
</table>
<%
}
else if(action.equals("savenew")){
	ForumStyleManager.saveNew(request);
	out.println("保存成功");
}
else if(action.equals("savedit")){
	ForumStyleManager.saveEdit(request);
	out.println("修改成功");
}
else if(action.equals("del")){
	ForumStyleManager.del(request);
	out.println("删除成功");
}
else
	throw new Exception("错误非法请求!");
}
catch(Exception e){
	String errMsg = e.getMessage();
	%>
	<%@include file="INC/error.jsp"%>
	<%
}%>
<%@ include file="foot.jsp"%>

⌨️ 快捷键说明

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