📄 syscode.asp
字号:
<% @language="vbscript" codepage=936 %>
<%
'option explicit
'response.buffer=true
'强制浏览器重新访问服务器下载页面,而不是从缓存读取页面
'Response.Buffer = True
'Response.Expires = -1
'Response.ExpiresAbsolute = Now() - 1
'Response.Expires = 0
'Response.CacheControl = "no-cache"
%>
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="ubbcode.asp"-->
<!--#include file="../../inc/function.asp"-->
<!--#include file="admin_code.asp"-->
<!--#include file="js.js"-->
<%
'on error resume next
dim strChannel,sqlChannel,rsChannel,ChannelUrl,ChannelName
dim ArticleID,ArticleTitle
dim FileName,strFileName,MaxPerPage,ShowSmallClassType
dim totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime
dim founderr,errmsg
dim ClassID,SpecialID,keyword,strField,SpecialName
dim rs,sql,sqlArticle,rsArticle,sqlSearch,rsSearch,rsPic,sqlSpecial,rsSpecial,sqlUser,rsUser
dim tClass,ClassName,RootID,ParentID,Depth,ParentPath,Child,SkinID,LayoutID,LayoutFileName,ChildID,tID,tChild
dim tSpecial
dim strPic,AnnounceCount
dim UserLevel
dim PageTitle,strPath,strPageTitle
dim strClassTree,noshowid,showwindow,style1
dim sqlNotes,rsNotes,notesNum,conn1
dim Style10,Default_arrClassID,News_ID
dim listT(20)
noshowid=76
noshowid2=135
showwindow=20
BeginTime=Timer
ArticleID=ReplaceBadChar(request("ArticleID"))
ClassID=ReplaceBadChar(request("ClassID"))
SpecialID=ReplaceBadChar(request("SpecialID"))
strField=ReplaceBadChar(request("Field"))
keyword=ReplaceBadChar(request("keyword"))
w3=ReplaceBadChar(request("w3"))
UserLevel=request.Cookies("asp163")("UserLevel")
if ArticleId="" then
ArticleID=0
else
ArticleID=Clng(ArticleID)
end if
if ClassID<>"" then
ClassID=CLng(ClassID)
else
ClassID=0
end if
if SpecialID="" then
SpecialID=0
else
SpecialID=CLng(SpecialID)
end if
if UserLevel="" then
UserLevel=5000
else
UserLevel=Cint(UserLevel)
end if
strPath= " 您现在的位置: <a href='" & SiteUrl & "'>" & SiteName & "</a>"
strPageTitle= SiteTitle
if ShowSiteChannel="Yes" then
strChannel= "| "
sqlChannel="select * from Channel order by OrderID"
set rsChannel=server.CreateObject("adodb.recordset")
rsChannel.open sqlChannel,conn,1,1
do while not rsChannel.eof
if rsChannel("ChannelID")=ChannelID then
ChannelUrl=rsChannel("LinkUrl")
ChannelName=rsChannel("ChannelName")
strChannel=strChannel & "<a href='" & ChannelUrl & "'><font color=red>" & ChannelName & "</font></a> | "
else
strChannel=strChannel & "<a href='" & rsChannel("LinkUrl") & "' target='_blank'>" & rsChannel("ChannelName") & "</a> | "
end if
rsChannel.movenext
loop
rsChannel.close
set rsChannel=nothing
strPath=strPath & " >> <a href='" & ChannelUrl & "'>" & ChannelName & "</a>"
strPageTitle=strPageTitle & " >> " & ChannelName
end if
if ArticleID>0 then
sql="select * from article where ArticleID=" & ArticleID & ""
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>你要找的文章不存在,或者已经被管理员删除!</li>"
else
ClassID=rs("ClassID")
SpecialID=rs("SpecialID")
SkinID=rs("SkinID")
LayoutID=rs("LayoutID")
ArticleTitle=rs("Title")
if w3<>"1" then
rs("Hits")=rs("Hits")+1
end if
rs.update
if rs("hits")>=HitsOfHot then
rs("Hot")=True
rs.update
end if
if rs("ReadLevel")<9999 and session("Admin")="" then
if CheckUserLogined()=False then
FoundErr=True
ErrMsg=ErrMsg & "<br> 你还没注册?或者没有登录?这篇文章要求至少是本站的注册用户才能阅读!<br><br>"
ErrMsg=ErrMsg & " 如果你还没注册,请赶紧<a href='UserReg.asp'><font color=red>点此注册</font></a>吧!<br><br>"
ErrMsg=ErrMsg & " 如果你已经注册但还没登录,请赶紧<a href='UserLogin.asp'><font color=red>点此登录</font></a>吧!<br><br>"
else
if Cint(Request.Cookies("asp163")("UserLevel"))>rs("ReadLevel") then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>对不起,你没有阅读此文章的权限!</li>"
end if
end if
end if
end if
end if
if ClassID>0 then
sql="select C.ClassName,C.RootID,C.ParentID,C.Depth,C.ParentPath,C.Child,C.SkinID,L.LayoutID,L.LayoutFileName,C.BrowsePurview From ArticleClass C"
sql=sql & " inner join Layout L on C.LayoutID=L.LayoutID where C.ClassID=" & ClassID
set tClass=conn.execute(sql)
if tClass.bof and tClass.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的栏目</li>"
Call WriteErrMsg()
response.end
else
if tClass(9)<UserLevel then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>对不起,你没有浏览本栏目的权限!</li>"
Call WriteErrMsg()
response.end
else
ClassName=tClass(0)
RootID=tClass(1)
ParentID=tClass(2)
Depth=tClass(3)
ParentPath=tClass(4)
Child=tClass(5)
SkinID=tClass(6)
LayoutID=tClass(7)
LayoutFileName=tClass(8)
strPath=strPath & " >> "
strPageTitle=strPageTitle & " >> "
if ParentID>0 then
dim sqlPath,rsPath,StyleNum
StyleNum=1
sqlPath="select ArticleClass.ClassID,ArticleClass.ClassName,Layout.LayoutFileName,Layout.LayoutID From ArticleClass"
sqlPath= sqlPath & " inner join Layout on ArticleClass.LayoutID=Layout.LayoutID where ArticleClass.ClassID in (" & ParentPath & ") order by ArticleClass.Depth"
set rsPath=server.createobject("adodb.recordset")
rsPath.open sqlPath,conn,1,1
do while not rsPath.eof
strPath=strPath & "<a href='" & rsPath(2) & "?ClassID=" & rsPath(0) & "&LayoutID=" & rsPath(3) & "'>" & rsPath(1) & "</a> >> "
strPageTitle=strPageTitle & rsPath(1) & " >> "
if StyleNum=1 then Style10=rsPath(1)
StyleNum=StyleNum+1
rsPath.movenext
loop
rsPath.close
set rsPath=nothing
end if
strPath=strPath & "<a href='" & LayoutFileName & "?ClassID=" & ClassID & "'>" & ClassName & "</a>"
strPageTitle=strPageTitle & ClassName
end if
end if
end if
if SpecialID>0 then
sql="select S.SpecialID,S.SpecialName,S.SkinID,S.LayoutID,L.LayoutFileName,S.BrowsePurview from Special S inner join Layout L on L.LayoutID=S.LayoutID where S.SpecialID=" & SpecialID
set tSpecial=conn.execute(sql)
if tSpecial.bof and tSpecial.eof then
FounErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的栏目</li>"
Call WriteErrMsg()
response.end
else
if tSpecial(5)<UserLevel then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>对不起,你没有浏览本专题的权限!</li>"
Call WriteErrMsg()
response.end
else
SpecialName=tSpecial(1)
SkinID=tSpecial(2)
LayoutID=tSpecial(3)
LayoutFilename=tSpecial(4)
strPath=strPath & " >> <font color=blue>[专题]</font><a href='" & tSpecial(4) & "?SpecialID=" & tSpecial(0) & "'>" & SpecialName & "</a>"
strPageTitle=strPageTitle & " >> [专题]" & SpecialName
end if
end if
end if
if keyword<>"" then
keyword=ReplaceBadChar(keyword)
end if
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
'=================================================
'过程名:ShowPath
'作 用:显示“你现在所有位置”导航信息
'参 数:无
'=================================================
sub ShowPath()
if PageTitle<>"" then
strPath=strPath & " >> " & PageTitle
end if
response.write strPath
end sub
'=================================================
'过程名:ShowRootClass
'作 用:显示一级栏目(无特殊效果)
'参 数:无
'=================================================
sub ShowRootClass()
dim sqlRoot,rsRoot,link1,li
li=0
sqlRoot="select C.ClassID,C.ClassName,C.RootID,L.LayoutFileName,C.LinkUrl From ArticleClass C"
sqlRoot= sqlRoot & " inner join Layout L on C.LayoutID=L.LayoutID where C.ClassID<>"&noshowid&" and C.ParentID=0 order by C.RootID"
Set rsRoot= Server.CreateObject("ADODB.Recordset")
rsRoot.open sqlRoot,conn,1,1
if rsRoot.bof and rsRoot.eof then
response.Write("还没有任何栏目,请首先添加栏目。")
else
if ClassID>0 then
response.write "" '<a href='" & ChannelUrl & "'>首页</a>|"
else
response.write "" '<a href='" & ChannelUrl & "'><font color=red>首页</font></a>|"
end if
do while not rsRoot.eof
if rsRoot(0)=showwindow then
link1="target=_blank"
else
link1=""
end if
if rsRoot(4)<>"" then
listT(li)=rsRoot(4)
if rsRoot(0)<noshowid2 then
response.write "<a class='Default_ClassWhite' href='" & listT(li) & "' "&link1&">" & rsRoot(1) & "</a> <font class=top_class>|</font> "
end if
else
listT(li)=rsRoot(3) & "?ClassID=" & rsRoot(0)
if rsRoot(0)<noshowid2 then
if rsRoot(2)=RootID then
response.Write "<a class='Default_ClassRed' href='" & listT(li) & "' "&link1&">" & rsRoot(1) & "</a> <font class=top_class>|</font> "
else
response.Write "<a class='Default_ClassWhite' href='" & listT(li) & "' "&link1&">" & rsRoot(1) & "</a> <font class=top_class>|</font> "
end if
end if
end if
rsRoot.movenext
li=li+1
loop
end if
rsRoot.close
set rsRoot=nothing
end sub
'=================================================
'过程名:ShowRootClass_Menu
'作 用:显示一级栏目(下拉菜单效果)
'参 数:无
'=================================================
sub ShowRootClass_Menu()
dim sqlRoot,rsRoot
sqlRoot="select C.ClassID,C.ClassName,C.RootID,L.LayoutFileName,C.LinkUrl,C.Child From ArticleClass C"
sqlRoot= sqlRoot & " inner join Layout L on C.LayoutID=L.LayoutID where C.ParentID=0 order by C.RootID"
Set rsRoot= Server.CreateObject("ADODB.Recordset")
rsRoot.open sqlRoot,conn,1,1
if rsRoot.bof and rsRoot.eof then
response.Write("还没有任何栏目,请首先添加栏目。")
else
if ClassID>0 then
response.write "<FONT color=#ffff00>|</FONT><a href='" & ChannelUrl & "'>首页</a><FONT color=#ffff00>|</FONT>"
else
response.write "<FONT color=#ffff00>|</FONT><a href='" & ChannelUrl & "'><font color=red>首页</font></a><FONT color=#ffff00>|</FONT>"
end if
do while not rsRoot.eof
if rsRoot(4)<>"" then
response.write "<a href='" & rsRoot(4) & "' target='_blank'>" & rsRoot(1) & "</a> <FONT color=#ffff00>|</FONT>"
else
if rsRoot(5)>0 then
if rsRoot(2)=RootID then
response.Write "<a href='" & rsRoot(3) & "?ClassID=" & rsRoot(0) & "' onMouseOver='ShowMenu(menu" & rsRoot(2) & ",100)'><font color=#ffffff>" & rsRoot(1) & "</font></a><FONT color=#ffff00>|</FONT>"
else
response.Write "<a href='" & rsRoot(3) & "?ClassID=" & rsRoot(0) & "' onMouseOver='ShowMenu(menu" & rsRoot(2) & ",100)'><font color=#ffffff>" & rsRoot(1) & "</font></a><FONT color=#ffff00>|</FONT>"
end if
else
if rsRoot(2)=RootID then
response.Write "<a href='" & rsRoot(3) & "?ClassID=" & rsRoot(0) & "'><font color=#ffffff>" & rsRoot(1) & "</font></a><FONT color=#ffff00>|</FONT>"
else
response.Write "<a href='" & rsRoot(3) & "?ClassID=" & rsRoot(0) & "'><font color=#ffffff>" & rsRoot(1) & "</font></a><FONT color=#ffff00>|</FONT>"
end if
end if
end if
rsRoot.movenext
loop
end if
rsRoot.close
set rsRoot=nothing
if ShowMyStyle="Yes" then
response.write "<a href='#' onMouseOver='ShowMenu(menu_skin,100)'> 自选风格 </a>|"
end if
end sub
'=================================================
'过程名:ShowJumpClass
'作 用:显示“跳转栏目到…”下拉列表框
'参 数:无
'=================================================
sub ShowJumpClass()
response.write "<div z-index:1><select name='ClassID' onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">"
response.write "<option value='' selected>跳转栏目至…</option>"
dim arrShowLine(20)
for i=0 to ubound(arrShowLine)
arrShowLine(i)=False
next
dim rsClass,sqlClass,strTemp,tmpDepth,i
sqlClass="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl From ArticleClass C"
sqlClass= sqlClass & " inner join Layout L on C.LayoutID=L.LayoutID order by C.RootID,C.OrderID"
set rsClass=server.CreateObject("adodb.recordset")
rsClass.open sqlClass,conn,1,1
if rsClass.bof and rsClass.bof then
response.write "<option value=''>请先添加栏目</option>"
else
do while not rsClass.eof
tmpDepth=rsClass(2)
if rsClass(4)>0 then
arrShowLine(tmpDepth)=True
else
arrShowLine(tmpDepth)=False
end if
if rsClass(5)="" then
strTemp="<option value='" & rsClass(3) & "?ClassID=" & rsClass(0) & "'>"
else
strTemp="<option value='" & rsClass(5) & "'>"
end if
if tmpDepth>0 then
for i=1 to tmpDepth
strTemp=strTemp & " "
if i=tmpDepth then
if rsClass(4)>0 then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -