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

📄 const.asp

📁 这是ASP的OA
💻 ASP
字号:
<%@ LANGUAGE=VBSCRIPT %>
<%
Option Explicit
response.Buffer=true
dim connstr,conn,sitename,starttime,isdbclose,visitid,gradeString,matrix3_name
'论坛名称
sitename="M3 论坛"
'数据库链接
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+server.mappath("database/#m3_bbs_db.asp")
'用户等级(头衔)设置
gradeString="新手上路;论坛游民;论坛游侠;业余侠客;职业侠客;侠之大者;黑侠;蝙蝠侠;蜘蛛侠;青蜂侠;小飞侠;火箭侠;蒙面侠;城市猎人;精灵;精灵使;天使;大天使;侠尊;侠圣;侠仙"
'设置经验每增加多少用户等级才会提升一级
const gradejg=100
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
starttime=timer()
isdbclose=1
sub opendb()
	if isdbclose=1 then
		set conn=server.CreateObject("adodb.connection")
		conn.open connstr
		isdbclose=0
	end if
end sub
sub closedb()
	if isdbclose=0 then
		conn.close
		set conn=nothing
		isdbclose=1
	end if
end sub
function trim1(strr)
	if isnull(strr) then exit function
	strr=trim(strr)
	strr=replace(replace(replace(replace(replace(strr,"'","’")," ","&nbsp;"),"""","”"),"<","&lt;"),">","&gt;")
	trim1=strr
end function
Function nrequest(ParaName)
	Dim ParaValue
	ParaValue=Request.QueryString(ParaName)
	If not isNumeric(ParaValue) then
		response.Write("参数" & ParaName & "必须为数字型!")
		Response.end
	End if
	nrequest=ParaValue
End function
Function nrequest2(ParaName)
	Dim ParaValue
	ParaValue=Request.Form(ParaName)
	If not isNumeric(ParaValue) then
		response.Write("参数" & ParaName & "必须为数字型!")
		Response.end
	End if
	nrequest2=ParaValue
End function
sub msg(str)
	call closedb()
	response.write"<br><br><center>"&str&"<br><br><br><a href="""&request.servervariables("HTTP_REFERER")&""">返 回</a></center>"
	response.End()
end sub
function checkuser()
	if cint(userlevel())<1 then
		response.Redirect("error.asp")
		response.End()
	end if
end function
function checkadmin()
	if cint(userlevel())<2 then
		call closedb()
		response.Redirect("error.asp?id=1")
		response.End()
	end if
end function
function isadmin()
	if cint(userlevel())>1 then isadmin=1
end function
dim check_rs,check_sql
function userlevel()
	if request.Cookies("matrix3")("matrix3_name")="游客" or request.Cookies("matrix3")("matrix3_pw")="" then
		userlevel=0
		exit function
	end if
	userlevel=0
	check_sql="select power from m3_users where name='"&trim1(request.Cookies("matrix3")("matrix3_name"))&"' and password='"&trim1(request.Cookies("matrix3")("matrix3_pw"))&"'"
	set check_rs=server.CreateObject("adodb.recordset")
	check_rs.open check_sql,conn,1,1
	if not (check_rs.eof and check_rs.bof) then
		userlevel=cint(check_rs("power"))
	end if
	check_rs.close
	set check_rs=nothing
end function
function inlist(str)
	dim tmp_i
	inlist=0
	if isnull(str) or str="" then exit function
	str=trim(str)
	str=split(str,",")
	for tmp_i=0 to ubound(str)
		if str(tmp_i)=request.Cookies("matrix3")("matrix3_name") then
			inlist=1
			exit function
		end if
	next
end function
%>
<!-- #include file="online_func.asp" -->

⌨️ 快捷键说明

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