header.asp

来自「很好的一个论坛原代码」· ASP 代码 · 共 73 行

ASP
73
字号
<%
function loadtemplate(templatename)
	loadtemplate = application("sf_t_" & templatename)
end function

dim i
dim Conn, boardtitle, styleid, msgmax, uploadfilesizemax, defreplyshowpost, forumrow, postrow, hothit, hotreply, postmaxlength, onlinetime

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn

Set rs = Conn.Execute("select top 1 * from sf_setup")
if rs.bof or rs.eof then
	response.write "sf cannot be initialized. (001)"
	response.end
end if

boardtitle = rs("boardtitle")
boardurl = rs("boardurl")
badwordlist = rs("badwordlist")
reghint = rs("reghint")
defshowdays = rs("defshowdays")
regtime = rs("regtime")
posttime = rs("posttime")
msgmax = rs("msgmax")
uploadfilesizemax = rs("uploadfilesizemax")
defreplyshowpost = rs("defreplyshowpost")
forumrow = rs("forumrow")
postrow = rs("postrow")
hothit = rs("hothit")
hotreply = rs("hotreply")
postmaxlength = rs("postmaxlength")
onlinetime = rs("onlinetime")
allowtrashbox = rs("allowtrashbox")
styleid = rs("styleid")
ratingthread = rs("ratingthread")
ratingreply = rs("ratingreply")
ratingbest = rs("ratingbest")
ratingdel = rs("ratingdel")

i = 0
newmsgnum = 0
if IsNumeric(ChkSql(request.cookies("sf")("userid"))) then
	i = cint(request.cookies("sf")("userid"))
	Set rs = Conn.Execute("select count(privatemessageid) as newmsgnum from sf_privatemessage where folderid = 0 and messageread = 0 and userid = " & i)
	if not (rs.bof or rs.eof) then
		newmsgnum = rs("newmsgnum")
		if newmsgnum > 0 then newmsg = "<bgsound src=""image/sound/newmsg.wav"" loop=""-1"">" & chr(10)
	end if
end if

if application("sf_t_styleid") = "" then
	Set rs = Conn.Execute("select * from sf_style where styleid=" & styleid)
	if rs.bof or rs.eof then
		response.write "sf cannot be initialized. (002)"
		response.end
	else
		for each fldName In rs.Fields
			application("sf_t_" & fldName.name) = rs(fldName.name)
		next
		sfcopyright = application("sf_t_copyright")
		sfcopyright = Replace(sfcopyright, "{board_title}", "<a href=""" & boardurl & """>" & boardtitle & "</a>")
		sfcopyright = Replace(sfcopyright, "{processed_time}", "Processed time: 0" & FormatNumber((timer() - t1) , 3) & " s")
		application("sf_t_copyright") = sfcopyright
	end if
end if

rs.close
sfcopyright = application("sf_t_copyright")

set rs = nothing
set i = nothing
%>

⌨️ 快捷键说明

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