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

📄 header.asp

📁 BBS论坛的开发和设计
💻 ASP
字号:
<%
Dim styleid,userID,username,userpass,userip,useronline,lastonline,usergroup,IPstay
styleid = Request.Cookies(JBBMasterCookies)("styleid")
userID = request.Cookies(JBBMasterCookies)("userID")
username = request.Cookies(JBBMasterCookies)("username")
userpass = request.Cookies(JBBMasterCookies)("userpass")
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
'------------------------------------------------------
if IsNumeric(userID) and username <> "" and userpass <> "" then
	set rsu = Conn.ExeCute("select userid,lastonline,usergroup,Cent from JBB_user where userid="&Cstr(userid) &" and username='"& username &"' and userpass='"& userpass &"'")
	if Not(rsu.Eof and rsu.bof) then
		useronline = true		
		lastonline = trim(rsu(1))
		usergroup = rsu("usergroup")
		Cent = rsu("Cent")
		if IsDate(lastonline) then
			lastonline = formatdatetime(lastonline,2)&" "& formatdatetime(lastonline,4)
		End if
	End if
	set rsu = nothing
End if
if usergroup="" then usergroup = 6
'------------------------------------------------------
if Not(IsArray(Application(JBBMasterCookies&"BBS_Config"))) then
	set rs = Conn.ExeCute("select top 1 Board_name,Board_Url,Home_name,Home_Url,master_Email,Board_close,Board_closecause,userreg,usernameshort,usernamelong,useremailonly,usernamestay,userregagree,IPstay,useronlinetiem,homeshowuseronline,useronlinecount,useronlinecounttime from JBB_config")
	if not rs.eof then
		dim ConfigArray()
		Redim ConfigArray(18)
		ConfigArray(0) = rtrim(rs(0))
		ConfigArray(1) = rtrim(rs(1))
		ConfigArray(2) = rtrim(rs(2))
		ConfigArray(3) = rtrim(rs(3))
		ConfigArray(4) = rtrim(rs(4))
		ConfigArray(5) = rs(5)
		ConfigArray(6) = rtrim(rs(6))
		ConfigArray(7) = rs(7)
		ConfigArray(8) = rtrim(rs(8))
		ConfigArray(9) = rtrim(rs(9))
		ConfigArray(10) = rs(10)
		ConfigArray(11) = rtrim(rs(11))
		ConfigArray(12) = rtrim(rs(12))
		ConfigArray(13) = rtrim(rs(13))
		ConfigArray(14) = rtrim(rs(14))
		ConfigArray(15) = rs(15)
		ConfigArray(16) = rtrim(rs(16))
		ConfigArray(17) = rtrim(rs(17))
		Application.Lock
			Application(JBBMasterCookies&"BBS_Config")=ConfigArray
		Application.UnLock		
	end if
	set rs = nothing
	'response.write "论坛配置信息获取完毕!~"
end if
BBS_Config=Application(JBBMasterCookies&"BBS_Config")
'response.write BBS_Config(15)
'--------------------------------------------------------------
if Application(JBBMasterCookies&"user_Group")<>1 then
	sql="select groupID,groupName,viewBoard,viewothers,viewuserinfo,SearchBoard,editproinfo,postnew,replyown,replyothers,upcount,editpost,delpost,movepost,closepost,delthread,pollnew,vote,usepm,pmcount,viewonline,viewonlineip from JBB_usergroup order By groupID asc"
	set rs = server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,1
	if not rs.eof then
		dim user_Group_Array()
		Redim user_Group_Array(22)
		for g = 1 to rs.recordcount
			user_Group_Array(0)=rs(0)
			user_Group_Array(1)=rs(1)
			user_Group_Array(2)=rs(2)
			user_Group_Array(3)=rs(3)
			user_Group_Array(4)=rs(4)
			user_Group_Array(5)=rs(5)
			user_Group_Array(6)=rs(6)
			user_Group_Array(7)=rs(7)
			user_Group_Array(8)=rs(8)
			user_Group_Array(9)=rs(9)
			user_Group_Array(10)=rs(10)
			user_Group_Array(11)=rs(11)
			user_Group_Array(12)=rs(12)
			user_Group_Array(13)=rs(13)
			user_Group_Array(14)=rs(14)
			user_Group_Array(15)=rs(15)
			user_Group_Array(16)=rs(16)
			user_Group_Array(17)=rs(17)
			user_Group_Array(18)=rs(18)
			user_Group_Array(19)=rs(19)
			user_Group_Array(20)=rs(20)
			user_Group_Array(21)=rs(21)
			Application.Lock
				Application(JBBMasterCookies&"user_group"&rs(0))=user_Group_Array
			Application.UnLock
		rs.movenext
		next'g
		Application.Lock
			Application(JBBMasterCookies&"user_group")=1
		Application.UnLock
		'response.write "成功获取所有用户组数据,共"&rs.recordCount
	else
		response.write "论坛用户组不存在,请检查数据库或者联系作者"
		rs.close
		set rs = nothing
		response.End()		
	end if
	rs.close
	set rs = nothing
end if
user_Group=Application(JBBMasterCookies&"user_Group"&usergroup)
'response.write user_Group(1)&"_"&user_Group(0)&"_"&user_Group(21)
'--------------------页面头部开始----------------------------
function top()
	if BBS_Skin(4) <> True then response.write BBS_Skin(0)
	response.write "<script language=""JavaScript"">"
	response.write "<!--"&chr(10)
	response.write "function openstyle() {"
	response.write "var Win = window.open('My_style.asp', 'newwindow', 'height=100, width=280, top=200,left=260, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no,status=no');"
	response.write "}"
	response.write "// -->"
	response.write "</script>"
	response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""Menu-table"">"
  	response.Write "<tr><td>"
	if useronline <> true then
		response.Write("<b>&raquo; 游客</b> | <a href=""login.asp?action=login"">登录</a> | <a href=""register.asp"">注册</a> |")
	else
		response.Write("<b>&raquo; "&username &"</b> | <a href=""login.asp?action=logout"">退出</a> | <a href=""pm.asp"">悄悄话</a> | <a href=""usercp.asp"">控制面板</a> | ")
	End if
	response.write " <a href=""search.asp"">搜索</a> | <a href=""userlist.asp?action=new"">会员</a> "
    response.write " | <a href=""#"" onClick=""openstyle()"">风格</a> | <a href=""faq.asp"">帮助</a> "
	if usergroup <= 4 then
		response.Write(" | <a href=""logs.asp"">日志</a>")
	End if
	if  usergroup = 1 then 
		response.Write(" | <a href=""admin/""><font color=red>管理</font></a>")
	End if
	response.write "</td></tr></table>"
	if BBS_Skin(4) <> True then response.write "<br><br>"
	if BBS_Skin(4) = True then response.write BBS_Skin(0)
End function
'----------------------页面头部结束--------------------------
function Bottom()
	if BBS_Skin(6) = true then response.write Trim(BBS_Skin(5))
	endtime=timer()*1000
	response.write"<div align=""center"">&lt; <a href=""mailto:"& BBS_Config(4) &""">联系我们</a> - <a href="""& BBS_Config(3) &""">"& BBS_Config(2) &"</a> &gt;"&_ 
        		"<br><br><br>Powered by: <a href=""http://www.joinboard.net"" target=""_blank"">JoinBoard</a> V2.3<br>"&_
			"Copyright &copy; <a href=""http://Youmeng.com"" target=""_blank"">YouMeng Studio.</a> 2003, 2004.<br>"&_
			"页面加载时间:"&formatnumber(endtime-startime,1,-1)&"毫秒<br>"&chr(10)
	if BBS_Skin(6) <> true then response.write Trim(BBS_Skin(5))
	response.write "</div></body>"&chr(10)&_
		"</html>"
	'-----------检测是否有新的悄悄话---------------
	if useronline = true then
		set rspm = Conn.execute("select pm_id from JBB_pm where userid="&userid &" and receipt=0 and inform=0")
		if Not rspm.eof then
			Conn.ExeCute("update JBB_pm set inform=1 where userid="&userid)
			if right(request.ServerVariables("SCRIPT_NAME"),6) <> "pm.asp" then
				response.Write("<script language=javascript>if (confirm('您有新的悄悄话,点击确定立即阅读,点击取消以后阅读。')) {location.href='pm.asp'}</script>")
			End if
		End if
		set rspm = nothing
	End if
End function	
'-----------------------------------------------
IPstay = BBS_Config(13)
if BBS_Config(5)=True then
%>
<!--#include file="STYLE.ASP"-->
<%
	response.Write"<html>"&chr(10)&_	
	"<head>"&chr(10)&_
	"<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"&chr(10)&_
	"<meta name=""keywords"" content=""joinboard,forum,bbs,youmeng,友盟论坛"">"&chr(10)&_
	"<title>"& BBS_Config(0) &" - 系统信息 - 论坛关闭</title>"&chr(10)&_
	"<link href="& Css_path &" rel=""stylesheet"" type=""text/css"">"&chr(10)&"</head>"&chr(10)&_
	"<body leftmargin=""0"" topmargin=""0"">"&chr(10)
	Call top()
	ShowMsg BBS_Config(6)
	Call Bottom
	Application.Lock
		Application(JBBMasterCookies & "conn") = ""
	Application.UnLock
	response.end
End if
'-----------------------------------------------
if userip <> "" and IPstay <> "" then
	IpStr=Split(IPstay,",",-1,1)
	For ip = 0 To UBound(IpStr,1)
		if Instr(userip,IpStr(ip)) => 1 then
		%>
		<!--#include file="STYLE.ASP"-->
		<%
			response.Write"<html>"&chr(10)&_	
			"<head>"&chr(10)&_
			"<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"&chr(10)&_
			"<meta name=""keywords"" content=""joinboard,forum,bbs,youmeng,友盟论坛"">"&chr(10)&_
			"<title>"& BBS_Config(0) &" - 系统信息 - IP禁止 </title>"&chr(10)&_
			"<link href="& Css_path &" rel=""stylesheet"" type=""text/css"">"&chr(10)&"</head>"&chr(10)&_
			"<body leftmargin=""0"" topmargin=""0"">"&chr(10)
			Call top()
			ShowMsg  "对不起!~ 您的IP被本站管理员禁止!"
			Call Bottom
			response.End
		End if
	Next
End if
'---------------------------	
Function checkUrl()
	Dim server_v1,server_v2
	server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
	server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
	if  mid(server_v1,8,len(server_v2))<>server_v2  then
		response.Write("您提交的路径有误,请不要从本站以外的URL向本站提交数据")
		response.End()
	end if
End Function
%>

⌨️ 快捷键说明

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