syscode.asp

来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 887 行 · 第 1/3 页

ASP
887
字号
<%
Dim G_P_Show
G_P_Show=G_P_Show& "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">"& vbcrlf
G_P_Show=G_P_Show& "<html xmlns=""http://www.w3.org/1999/xhtml"">" & vbcrlf
G_P_Show=G_P_Show& "<head>" & vbcrlf
G_P_Show=G_P_Show& "<meta http-equiv=""content-type"" content=""text/html; charset=gb2312"">"& vbcrlf
G_P_Show=G_P_Show& "<meta name=""generator"" content=""oblog"">"& vbcrlf
G_P_Show=G_P_Show& "<meta name=""keywords"" content="""&oblog.cacheConfig(9)&""">"& vbcrlf
G_P_Show=G_P_Show& "<link rel=""alternate"" href=""rss2.asp"" type=""application/rss+xml"" title=""rss"" >"& vbcrlf
G_P_Show=G_P_Show& "<title>"&oblog.cacheConfig(2)&"</title>"& vbcrlf
G_P_Show=G_P_Show& "<link href=""OblogStyle/OblogsysDefault4.css"" rel=""stylesheet"" type=""text/css"" /> "& vbcrlf
G_P_Show=G_P_Show& "<script src=""inc/main.js""></script>"& vbcrlf
G_P_Show=G_P_Show& "<script>function chkdiv(divid){var chkid=document.getElementById(divid);if(chkid != null){return true; }else {return false; }}</script>"& vbcrlf
G_P_Show=G_P_Show& "{OB_STYLE}"& vbcrlf
G_P_Show=G_P_Show& "</head>"& vbcrlf
G_P_Show=G_P_Show& "<body>"& vbcrlf

Function show_userlogin(n)
	if n=0 then
		show_userlogin = "<div id=""ob_login""></div>"&"<script src='login.asp?action=showindexlogin'></script>"
	else
		show_userlogin = "<div id=""ob_login""></div>"&"<script src='login.asp?action=showindexlogin&n=1'></script><script src=""inc/main.js""></script>"
	end if
End Function

Sub indexshow()

	If InStr(G_P_Show, "$show_sitename$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_sitename$", oblog.cacheconfig(1))
	End If

	If InStr(G_P_Show, "$show_placard$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_placard$", show_placard())
	End If

	If InStr(G_P_Show, "$show_friends$") > 0 Then
	G_P_Show = Replace(G_P_Show, "$show_friends$", show_friends())
	End If

	If InStr(G_P_Show, "$show_count$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_count$", show_count())
	End If

	If InStr(G_P_Show, "$show_userlogin$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_userlogin$", show_userlogin(0))
	End If

	If InStr(G_P_Show, "$show_userlogin_l$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_userlogin_l$", show_userlogin(1))
	End If

	If InStr(G_P_Show, "$show_xml$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_xml$", show_sysxml())
	End If

	If InStr(G_P_Show, "$show_blogstar$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_blogstar$", show_blogstar())
	End If

	If InStr(G_P_Show, "$show_cloudtags$") > 0 Then
		G_P_Show = Replace(G_P_Show, "$show_cloudtags$", Tags_SystemTags("1"))
	End If

	Call runsub("$show_newblogger")
	Call runsub("$show_comment")
	Call runsub("$show_subject")
	Call runsub("$show_blogupdate")
	Call runsub("$show_bestblog")
	Call runsub("$show_bloger")
	Call runsub("$show_class")
	Call runsub("$show_log")
	Call runsub("$show_userlog")
	Call runsub("$show_search")
	Call runsub("$show_cityblogger")
	Call runsub("$show_newphoto")
	Call runsub("$show_blogstar2")
	Call runsub("$show_teams")
	Call runsub("$show_posts")
	Call runsub("$show_hotblog")
	Call runsub("$show_hottag")
	Call runsub("$show_treeclass")
	Call runsub("$show_bl")
End Sub

Sub sysshow()
	if Application(oblog.cache_name&"list_update")=false and application(oblog.cache_name&"list")<>"" then
		G_P_Show=application(oblog.cache_name&"list")
	Else
		Dim rstmp,sContent,sStyle
		Set rstmp = oblog.execute("select skinshowlog from oblog_sysskin where isdefault=1")
		sContent=rstmp(0)
		sStyle=OB_PickUpCss(sContent)
		G_P_Show=Replace(G_P_Show,"{OB_STYLE}",sStyle)
		'Response.Write sStyle
		'Response.Write sContent
		G_P_Show=G_P_Show&sContent
		Set rstmp = Nothing
		'副模板取消城市选项
		G_P_Show=Replace(G_P_Show,"show_cityblogger(0)$","")
		G_P_Show=Replace(G_P_Show,"show_cityblogger(1)$","")
		Call indexshow
		Application.Lock
		application(oblog.cache_name&"list_update")=false
		application(oblog.cache_name&"list")=G_P_Show
		Application.unLock
	End If
End Sub

Sub runsub(label)
	'On Error Resume Next
	Dim tmp1, tmp2, i
	Dim tmpstr, para
	tmp2 = 1
	While InStr(tmp2, G_P_Show, label) > 0
		tmp1 = InStr(tmp2, G_P_Show, label)
		tmp2 = InStr(tmp1 + 1, G_P_Show, "$")
		tmpstr = Mid(G_P_Show, tmp1, tmp2 - tmp1)
		tmpstr = Replace(tmpstr, "(", "")
		tmpstr = Replace(tmpstr, ")", "")
		tmpstr = Trim(Replace(tmpstr, label, ""))
		para = Split(tmpstr, ",")
		Select Case label
		Case "$show_log"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_log(para(0),para(1),para(2),para(3),para(4),para(5),para(6),para(7),para(8)))
			If Err Then
				Response.Write "<br/>$show_log$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_userlog"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_userlog(para(0),para(1),para(2),para(3),para(4),para(5)))
			If Err Then
				Response.Write Err.Description
				Response.Write "<br/>$show_userlog$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_comment"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_comment(para(0),para(1)))
			If Err Then
				Response.Write "<br/>$show_comment$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_subject"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_subject(para(0)))
			If Err Then
				Response.Write "<br/>$show_subject$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_blogupdate"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_blogupdate(para(0)))
			If Err Then
				Response.Write "<br/>$show_blogupdate$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_newblogger"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_newblogger(para(0)))
			If Err Then
				Response.Write "<br/>$show_newblogger$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_bestblog"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_bestblog(para(0)))
			If Err Then
				Response.Write "<br/>$show_bestblog$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_bloger"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_bloger(para(0)))
			If Err Then
				Response.Write "<br/>$show_bloger$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_class"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_class(para(0)))
			If Err Then
				Response.Write "<br/>$show_class$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_search"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_search(para(0)))
			If Err Then
				Response.Write "<br/>$show_search$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_cityblogger"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_cityblogger(para(0)))
			If Err Then
				Response.Write "<br/>$show_cityblogger$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_newphoto"
			G_P_Show=replace(G_P_Show,label&"("&tmpstr&")$",show_newphoto(para(0),para(1),para(2),para(3)))
			If Err Then
				Response.Write "<br/>$show_newphoto$标签有错误,请检查参数"
				Response.End()
			End If
		Case "$show_blogstar2"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",show_blogstar2(para(0),para(1),para(2),para(3)))
			If Err Then
				Response.Write "<br/>$show_blogstar2$标签有错误,请检查参数"
				Response.End()
			End If
		 Case "$show_hottag"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",GetHotTags(para(0),para(1),para(2),para(3)))
		Case "$show_treeclass"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",TreeClass(para(0)))
			If Err Then
				Response.Write "<br/>$show_treeclass$标签有错误,请检查参数"
				Response.Write Err.Description
				Response.End()
			End If
		Case "$show_teams"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",GetTeams(para(0),para(1),para(2),para(3),para(4),para(5)))
			If Err Then
				Response.Write "<br/>$show_teams$标签有错误,请检查参数"
				Response.Write Err.Description
				Response.End()
			End If
		Case "$show_posts"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",GetPosts(para(0),para(1),para(2),para(3),para(4)))
			If Err Then
				Response.Write "<br/>$show_posts$标签有错误,请检查参数"
				Response.Write Err.Description
				Response.End()
			End If
		Case "$show_hotblog"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",GetHotUsers(para(0),para(1)))
			If Err Then
				Response.Write "<br/>$show_hotblog$标签有错误,请检查参数"
				Response.Write Err.Description
				Response.End()
			End If
		Case "$show_bl"
			G_P_Show=Replace(G_P_Show,label&"("&tmpstr&")$",GetArgueList(para(0),para(1),para(2)))
			If Err Then
				Response.Write "<br/>$show_bl$标签有错误,请检查参数"
				Response.Write Err.Description
				Response.End()
			End If
		End Select
	Wend
End Sub

Function show_log(n, l, order, action, sdate, classid, classname, subjectname, info)
	show_log = ""
	Dim rs, msql, ordersql, actionsql, classsql, rstmp, i, postname, posttime, userurl, ustr
	i = 0
	Select Case order
	Case 1
	   ordersql = " order by logid desc"
	   'ordersql = " order by addtime desc"
	Case 2
		ordersql = " order by iis desc"
	Case 3
		ordersql = " order by commentnum desc"
	End Select

	Select Case action
	Case 1
		actionsql = ""
	Case 2
		actionsql = " and isbest=1"
	End Select
	If classid = 0 Then
		classsql = ""
	Else
		set rs=oblog.execute("select id from oblog_logclass where parentpath like '"&classid&",%' OR parentpath like '%,"&classid&"' OR parentpath like '%,"&classid&",%'")
		While Not rs.EOF
			ustr=ustr&","&rs(0)
			rs.MoveNext
		Wend
		ustr=classid&ustr
		classsql=" and classid in ("&ustr&")"
		'classsql=" and classid="&clng(classid)
	End If
	msql="select top "&n&" topic,logfile,addtime,commentnum,iis,logid,classid,subjectid,author,blogname,nickname,user_dir,user_domain,user_domainroot,user_dir,oblog_user.userid,user_folder from oblog_log,oblog_user where oblog_user.userid=oblog_log.userid and ishide<>1 and isdraft=0 and passcheck=1 And oblog_log.isdel=0 And oblog_user.isdel=0 "
	If is_sqldata Then
		msql=msql&" and datediff(d,oblog_log.truetime,getdate())<"&cint(sdate)&" and oblog_log.blog_password=0 And (ispassword='' Or ispassword is null)"
	Else
		msql=msql&" and datediff('d',oblog_log.truetime,now())<"&cint(sdate)&" and oblog_log.blog_password=0 And (ispassword='' Or ispassword is null)"
	End If
	msql=msql&actionsql&classsql
	msql=msql&ordersql
	Set rs = oblog.execute(msql)
	show_log=show_log&"<ul>"
	Do While Not rs.EOF
		show_log=show_log&"<li>"
		If rs("nickname") <> "" Then
			postname = oblog.filt_html(rs("nickname"))
		Else
			postname = oblog.filt_html(rs(8))
		End If
		posttime = rs(2)
		If classname = 1 Then
			Set rstmp = oblog.execute("select id,classname from oblog_logclass where id=" & rs(6))
			If Not rstmp.EOF Then
				show_log=show_log&"<a href=list.asp?classid="&rstmp(0)&" target=_blank>〖"&rstmp(1)&"〗</a>"

⌨️ 快捷键说明

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