www.gusucode.com > ASP+ACCESS学生论坛设计与实现(源代码+论文+开题报告) > ASP+ACCESS学生论坛设计与实现(源代码+论文+开题报告)\13学生论坛ASPAC\BBS\admin_index.asp
<!--#include file="Conn.asp"--> <!-- #include file="inc/const.asp" --> <!-- #include file="inc/md5.asp" --> <!-- #include file="inc/myadmin.asp" --> <!-- #include file="inc/dvadchar.asp" --> <% dim username dim password dim ip Mybbs.stats="论坛管理控制面板" select case request("action") case "admin_left" call admin_left() case "admin_login" call admin_login() case "admin_main" call admin_main() case "admin_head" call admin_head() case Else call main() end Select sub main() if not Mybbs.master or session("flag")="" then call admin_login() else %> <html> <head> <title><%=Mybbs.Forum_info(0)%>--控制面板</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <frameset id="frame" cols="180,*" frameborder="NO" border="0" framespacing="0" rows="*"> <frame name="leftFrame" scrolling="AUTO" noresize src="admin_index.asp?action=admin_left" marginwidth="0" marginheight="0"> <%if not Mybbs.master or session("flag")="" then%> <frame name="main" src="admin_index.asp?action=admin_login" scrolling="AUTO" NORESIZE frameborder="0" marginwidth="10" marginheight="10" border="no"> <%else%> <frame name="main" src="admin_index.asp?action=admin_main" scrolling="AUTO" NORESIZE frameborder="0" marginwidth="10" marginheight="10" border="no"> <%end if%> </frameset> </frameset> <noframes> </body></noframes> </html> <% end if end sub sub admin_left() %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <title><%=Mybbs.Forum_info(0)%>--管理页面</title> <style type=text/css> body { background:#799AE1; margin:0px; font:normal 12px 宋体; SCROLLBAR-FACE-COLOR: #799AE1; SCROLLBAR-HIGHLIGHT-COLOR: #799AE1; SCROLLBAR-SHADOW-COLOR: #799AE1; SCROLLBAR-DARKSHADOW-COLOR: #799AE1; SCROLLBAR-3DLIGHT-COLOR: #799AE1; SCROLLBAR-ARROW-COLOR: #FFFFFF; SCROLLBAR-TRACK-COLOR: #AABFEC; } table { border:0px; } td { font:normal 12px 宋体; } img { vertical-align:bottom; border:0px; } a { font:normal 12px 宋体; color:#000000; text-decoration:none; } a:hover { color:#428EFF;text-decoration:underline; } .sec_menu { border-left:1px solid white; border-right:1px solid white; border-bottom:1px solid white; overflow:hidden; background:#D6DFF7; } .menu_title { } .menu_title span { position:relative; top:2px; left:8px; color:#215DC6; font-weight:bold; } .menu_title2 { } .menu_title2 span { position:relative; top:2px; left:8px; color:#428EFF; font-weight:bold; } </style> <SCRIPT language=javascript1.2> function showsubmenu(sid) { whichEl = eval("submenu" + sid); if (whichEl.style.display == "none") { eval("submenu" + sid + ".style.display=\"\";"); } else { eval("submenu" + sid + ".style.display=\"none\";"); } } </SCRIPT> <% REM 管理栏目设置 dim menu(8,10),trs,k i=0 k=0 set rs=Mybbs.Execute("select * from dv_help where h_type=1 and h_parentid=0 and not h_stype=1 order by h_id") do while not rs.eof menu(i,k)=rs("h_title") 'response.write "menu("&i&","&k&")="""&rs("h_title")&"""" 'response.write chr(10) k=k+1 set trs=Mybbs.Execute("select * from dv_help where h_type=1 and h_parentid="&rs(0)&" and not h_stype=1 order by h_id") do while not trs.eof menu(i,k)="<a href=admin_help.asp?action=view&id="&trs(0)&" target=main><img src=images/manage/bullet.gif border=0 alt=点击查看该项目的帮助></a>" & trs("h_title") 'response.write "menu("&i&","&k&")="""&trs("h_title")&"""" 'response.write chr(10) k=k+1 trs.movenext loop trs.close set trs=nothing i=i+1 k=0 rs.movenext loop rs.close set rs=nothing 'response.end %> <BODY leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"> <table width=100% cellpadding=0 cellspacing=0 border=0 align=left> <tr><td valign=top> <table cellpadding=0 cellspacing=0 width=158 align=center> <tr> <td height=42 valign=bottom> <img src="images/manage/title.gif" width=158 height=38> </td> </tr> </table> <table cellpadding=0 cellspacing=0 width=158 align=center> <tr> <td height=25 class=menu_title onmouseover=this.className='menu_title2'; onmouseout=this.className='menu_title'; background=images/manage/title_bg_quit.gif > <span><a href="admin_index.asp" target=_top><b>管理首页</b></a> | <a href=admin_logout.asp target=_top><b>退出</b></a></span> </td> </tr> </table> <% dim j,i dim tmpmenu dim menuname dim menurl Dim TempStr,Menu_1,Menu_2 TempStr = template.html(0) Menu_1 = Split(TempStr,"||") for i=0 to ubound(Menu_1) %> <table cellpadding=0 cellspacing=0 width=158 align=center> <% Menu_2 = Split(Menu_1(i),"@@") For j = 0 To Ubound(Menu_2) If j=0 Then %> <tr> <td height=25 class=menu_title onmouseover=this.className='menu_title2'; onmouseout=this.className='menu_title'; background="images/manage/admin_left_<%=i+1%>.gif" id=menuTitle1 onclick="showsubmenu(<%=i%>)"> <span><%=Menu_2(0)%></span> </td> </tr> <tr> <td style="display" id='submenu<%=i%>'><div class=sec_menu style="width:158"><table cellpadding=0 cellspacing=0 align=center width=150><TBODY> <% Else if j=1 then response.write "<tr><td height=5></td></tr>" %> <tr><td height=20><img alt src="images/manage/bullet.gif" border="0" width="15" height="20"><%=Menu_2(j)%></td></tr> <% End If next %><TBODY></table></div> <div style="width:158"> <table cellpadding=0 cellspacing=0 align=center width=135> <tr><td height=20></td></tr> </table> </div> </td> </tr> </table> <%next%> <% end sub Sub admin_login() Mybbs.head() Mybbs.stats="论坛管理登录" if Mybbs.userid=0 then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您不是系统管理员!" end if If request("reaction")="chklogin" then Call chklogin() Else Call admin_login_main() End If End Sub sub admin_login_main() Dim version If IsSqlDataBase = 1 Then version="SQL 版" Else version="ACCESS 版" On Error Resume Next Dim Ados,GetCode Set Ados=Server.CreateObject("Adodb.Stream") If Err Then GetCode=9999 End If %> <html> <head> <meta NAME=GENERATOR Content="Microsoft FrontPage 4.0" CHARSET=GB2312> <meta name=keywords content='模拟天空,模拟天空,emu618'> <title><%=Mybbs.Forum_info(0)%>--<%=Mybbs.stats%></title> <%=template.html(1)%> </head> <body leftmargin=0 bottommargin=0 rightmargin=0 topmargin=0 marginheight=0 marginwidth=0> <p> </p> <p> </p> <form action="admin_index.asp?action=admin_login&reaction=chklogin" method=post> <table cellpadding="1" cellspacing="0" border="0" align=center style="border: outset 3px;width:0;"> <tr><td> <table style="width:500" border=0 cellspacing=0 cellpadding=3 align=center class=tablefoot> <tr><th valign=middle colspan=2 height=25><%=Mybbs.Forum_info(0)%>管理登录</th></tr> </table> <table style="width:500" border=0 cellspacing=0 cellpadding=3 align=center class=tablefoot> <tr> <td valign=middle colspan=2 align=center class=forumRowHighlight style="background-image: url(images/manage/loginbg.jpg);" height="75"> <table border="0" width="100%" height="100%"> <tr><td width="61%" height="100%" rowspan="3"></td> <td width="39%" height="0"></td></tr> <tr><td height="" valign=top class=tdfoot style=""><BR><a href="index.asp"><b><%=Mybbs.Forum_info(0)%></b></a><br>版本:Mybbs v7.0.0 <%=version%></td></tr> <tr><td height=""></td></tr> </table> </td></tr> </table> <table style="width:500" border=0 cellspacing=0 cellpadding=3 align=center> <tr> <td valign=middle colspan=2 align=center class=forumRowHighlight height=4></td> </tr> <tr> <td valign=middle class=forumRow width="30%" align=right><b>用户名:</b></td> <td valign=middle class=forumRow><INPUT name=username type=text></td></tr> <tr> <td valign=middle class=forumRow align=right><b>密 码:</b></font></td> <td valign=middle class=forumRow><INPUT name=password type=password></td></tr> <tr> <td valign=middle class=forumRow align=right><b>附加码:</b></td> <td valign=middle class=forumRow><INPUT name=verifycode type=text value="<%If GetCode=9999 Then Response.Write "9999"%>"> 请在附加码框输入 <%=getcode1()%></td></tr> <tr> <td valign=middle colspan=2 align=center class=forumRowHighlight><input class=button type=submit name=submit value="登 录"></td> </tr> </table> </td></tr></table> </form> </body> </html> <% end sub sub chklogin() username=trim(replace(request("username"),"'","")) password=md5(trim(replace(request("password"),"'","")),16) 'Response.Write session("getcode") 'Response.Write "<br>" 'Response.Write request("verifycode") 'response.end if request("verifycode")="" then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>请返回输入确认码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>" Exit Sub elseif session("getcode")="9999" then session("getcode")="" elseif session("getcode")="" then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>请不要重复提交,如需重新登录请返回登录页面。<b>返回后请刷新登录页面后重新输入正确的信息。</b>" Exit Sub elseif cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的确认码和系统产生的不一致,请重新输入。<b>返回后请刷新登录页面后重新输入正确的信息。</b>" Exit Sub end if session("getcode")="" if username="" or password="" then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>请输入您的用户名或密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>" Exit Sub end if ip=Mybbs.UserTrueIP set rs=Mybbs.Execute("select * from "&admintable&" where username='"&username&"' and adduser='"&Mybbs.membername&"'") if rs.eof and rs.bof then rs.close set rs=nothing Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的用户名和密码不正确或者您不是系统管理员。请<a href=admin_login.asp>重新输入</a>您的密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>" exit sub else if trim(rs("password"))<>password then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>您输入的用户名和密码不正确或者您不是系统管理员。请<a href=admin_login.asp>重新输入</a>您的密码。<b>返回后请刷新登录页面后重新输入正确的信息。</b>" exit sub else session("flag")=rs("flag") session.timeout=45 Mybbs.Execute("update "&admintable&" set LastLogin="&SqlNowString&",LastLoginIP='"&ip&"' where username='"&username&"'") rs.close set rs=nothing response.redirect "admin_index.asp" end if end if end sub sub admin_main() %> <title><%=Mybbs.Forum_info(0)%>--管理页面</title> <BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" > <% if not Mybbs.master or session("flag")="" then Response.Redirect "showerr.asp?action=OtherErr&ErrCodes=<li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登录</a>后进入。" Else Dim theInstalledObjects(20) theInstalledObjects(0) = "MSWC.AdRotator" theInstalledObjects(1) = "MSWC.BrowserType" theInstalledObjects(2) = "MSWC.NextLink" theInstalledObjects(3) = "MSWC.Tools" theInstalledObjects(4) = "MSWC.Status" theInstalledObjects(5) = "MSWC.Counters" theInstalledObjects(6) = "IISSample.ContentRotator" theInstalledObjects(7) = "IISSample.PageCounter" theInstalledObjects(8) = "MSWC.PermissionChecker" theInstalledObjects(9) = "Scripting.FileSystemObject" theInstalledObjects(10) = "adodb.connection" theInstalledObjects(11) = "SoftArtisans.FileUp" theInstalledObjects(12) = "SoftArtisans.FileManager" theInstalledObjects(13) = "JMail.SMTPMail" 'Jamil 4.2 theInstalledObjects(14) = "CDONTS.NewMail" theInstalledObjects(15) = "Persits.MailSender" theInstalledObjects(16) = "LyfUpload.UploadFile" theInstalledObjects(17) = "Persits.Upload.1" theInstalledObjects(18) = "JMail.Message" 'Jamil 4.3 theInstalledObjects(19) = "Persits.Upload" theInstalledObjects(20) = "SoftArtisans.FileUp" Head() %> <table cellpadding="3" cellspacing="1" border="0" class="tableBorder" align=center> <tr><th class="tableHeaderText" colspan=2 height=25>论坛信息统计</th><tr> <tr><td class="bodytitle" height=23 colspan=2> <% dim isaudituser set rs=Mybbs.Execute("select count(*) from [dv_user] where usergroupid=5") isaudituser=rs(0) if isnull(isaudituser) then isaudituser=0 Dim BoardListNum set rs=Mybbs.execute("select count(*) from dv_board") BoardListNum=rs(0) If isnull(BoardListNum) then BoardListNum=0 set rs=Mybbs.Execute("select * from dv_setup") if not rs.eof then %> 系统信息:论坛帖子数 <B><%=rs("Forum_PostNum")%></B> 主题数 <B><%=rs("Forum_topicnum")%></B> 用户数 <B><%=rs("Forum_usernum")%></B> 待审核用户数 <B><%=isaudituser%></B> 版面总数 <B><%=BoardListNum%></B> <% end if rs.close set rs=nothing %> <tr> <td width="50%" class="forumRow" height=23>服务器类型:<%=Request.ServerVariables("OS")%>(IP:<%=Request.ServerVariables("LOCAL_ADDR")%>)</td> <td width="50%" class="forumRow">脚本解释引擎:<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %></td> </tr> <tr> <td width="50%" class="forumRow" height=23>站点物理路径:<%=request.ServerVariables("APPL_PHYSICAL_PATH")%></td> <td width="50%" class="forumRow">数据库地址:</td> </tr> <tr> <td width="50%" class="forumRow" height=23>FSO文本读写:<%If Not IsObjInstalled(theInstalledObjects(9)) Then%><font color="<%=Mybbs.mainsetting(1)%>"><b>×</b></font><%else%><b>√</b><%end if%></td> <td width="50%" class="forumRow">数据库使用:<%If Not IsObjInstalled(theInstalledObjects(10)) Then%><font color="<%=Mybbs.mainsetting(1)%>"><b>×</b></font><%else%><b>√</b><%end if%></td> </tr> <tr> <td width="50%" class="forumRow" height=23> <%If IsObjInstalled(theInstalledObjects(18)) Then%>Jmail4.3邮箱组件支持:<%else%>Jmail4.2组件支持:<%end if%> <%If IsObjInstalled(theInstalledObjects(18)) or IsObjInstalled(theInstalledObjects(13)) Then%> <b>√</b> <%else%> <font color="<%=Mybbs.mainsetting(1)%>"><b>×</b></font> <%end if%> </td> <td width="50%" class="forumRow">CDONTS邮箱组件支持:<%If Not IsObjInstalled(theInstalledObjects(14)) Then%><font color="<%=Mybbs.mainsetting(1)%>"><b>×</b></font><%else%><b>√</b><%end if%></td> </tr> <tr><td class="forumRow" height=23 colspan=2> <% dim trs set trs=Mybbs.Execute("select * from Dv_ChallengeInfo") set rs=Mybbs.Execute("select * from dv_setup") %> <% rs.close set rs=nothing trs.close set trs=nothing %> </td></tr> </table> <table cellpadding="3" cellspacing="1" border="0" class="tableBorder" align=center> <tr><th class="tableHeaderText" colspan=2 height=25>论坛管理快捷方式</th><tr> <FORM METHOD=POST ACTION="admin_user.asp?action=userSearch&userSearch=9&usernamechk=yes"><tr> <td width="20%" class="forumRow" height=23>快速查找用户</td> <td width="80%" class="forumRow"> <input type="text" name="username" size="30"> <input type="submit" value="立刻查找"> <input type="hidden" name="userclass" value="0"> <input type="hidden" name="searchMax" value=100> </td></FORM> </tr> <tr> <td width="20%" class="forumRow" height=23>快捷功能链接</td> <td width="80%" class="forumRow"><a href=admin_board.asp?action=add>添加论坛类别</a> | <a href=admin_board.asp>管理论坛版面</a> | <a href="ReloadForumCache.asp">更新服务器缓存</a></td> </tr> <tr><form action="admin_update.asp?action=updat" method=post> <td width="20%" class="forumRow" height=23>快速更新数据</td> <td width="80%" class="forumRow"> <input type="submit" name="Submit" value="更新论坛数据"> <input type="submit" name="Submit" value="更新论坛总数据"> </td></form> </tr> </table> <%if Mybbs.Forum_ChanSetting(0)=1 then%> <p></p> <table cellpadding="3" cellspacing="1" border="0" class="tableBorder" align=center> <tr><th class="tableHeaderText" colspan=2 height=25>关于论坛互动功能</th><tr> </table> <%end if%> <script language='javascript'> function jumpto(url) { if (url != '') { window.open(url); } } </script> <p></p> <% footer end if end sub Function IsObjInstalled(strClassString) On Error Resume Next IsObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If 0 = Err Then IsObjInstalled = True Set xTestObj = Nothing Err = 0 End Function sub admin_head() %> <title><%=Mybbs.Forum_info(0)%>--管理页面</title> <style type="text/css"> a:link { color:#000000;text-decoration:none} a:hover {color:#666666;} a:visited {color:#000000;text-decoration:none} td {FONT-SIZE: 9pt; FILTER: dropshadow(color=#FFFFFF,offx=1,offy=1); COLOR: #000000; FONT-FAMILY: "宋体"} img {filter:Alpha(opacity:100); chroma(color=#FFFFFF)} </style> <script> function preloadImg(src) { var img=new Image(); img.src=src } preloadImg("images/manage/pic/admin_top_open.gif"); var displayBar=true; function switchBar(obj) { if (displayBar) { parent.frame.cols="0,*"; displayBar=false; obj.src="images/manage/admin_top_open.gif"; obj.title="打开左边管理菜单"; }else{ parent.frame.cols="180,*"; displayBar=true; obj.src="images/manage/admin_top_close.gif"; obj.title="关闭左边管理菜单"; } } </script> <body background="images/manage/admin_top_bg.gif" leftmargin="0" topmargin="0"> <table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0> <tr valign=middle> <td width=50> <img onclick="switchBar(this)" src="images/manage/admin_top_close.gif" title="关闭左边管理菜单" style="cursor:hand"> </td> <td width=150> 我的论坛系统设置面板 </td> <td width=40> <img src="images/manage/admin_top_icon_1.gif"> </td> <td width=100> <a href="admin_admin.asp" target=main>修改管理员资料</a> </td> <td width=*> <a href="index.asp" target=_top>返回论坛首页</a> </td> <td> </td> </tr> </table> <% end Sub Function getcode1() Dim test On Error Resume Next Set test=Server.CreateObject("Adodb.Stream") Set test=Nothing If Err Then Dim zNum Randomize timer zNum = cint(8999*Rnd+1000) Session("GetCode") = zNum getcode1= Session("GetCode") Else getcode1= "<img src=""getcode.asp"">" End If End Function %>