📄 cl_clswap.asp
字号:
<%
Dim Wap
Set Wap = New WapSetting
Class WapSetting
'进入判断
Public Sub Main()
If InfoID<>0 Then
Call ShowContent(InfoID,ChannelID)
Elseif ClassID<>0 Then
Set rs=Cl.Execute("Select ClassID,ClassName From Cl_Class Where ParentID="&ClassID&" and ChannelID="&ChannelID&"")
If rs.eof and rs.bof Then
Call ShowItemList(ClassID,ChannelID)
Else
Call ShowClassList(ClassID,ChannelID)
Call ShowItemList(ClassID,ChannelID)
End If
Elseif ChannelID>0 Then
Call ShowClassList(0,ChannelID)
Else
Call ShowChannelList()
End If
End Sub
'频道列表
Public Sub ShowChannellist()
Dim n,Node
n=0
Response.write ("<p align=""center"">=<strong>"&FormatStr("频道列表")&"</strong>="& vbCrLf)
For Each Node In Application(Cl.CacheName & "_channellist").DocumentElement.SelectNodes("channel[@channelid>0][@channeltype<2][@moduleid!=6][@iswap=1]")
Response.write ("<br/><a href="""& Cl.WebDir & FileNameStr &"?ChannelID="&Node.SelectSingleNode("@channelid").text&""">"&FormatStr(Node.SelectSingleNode("@channelname").text)&"</a>"& vbCrLf)
n=n+1
Next
If n=0 Then Response.write Wap.FormatStr("<br/>当前没有开放频道")
Response.write ("</p>")
End Sub
'栏目列表
Public Sub ShowClasslist(ClassID,ChannelID)
Cl.Load_ChannelSetting(ChannelID)
If Cl.Channel.selectSingleNode("@iswap").text=0 Then Response.write("<p align=""center"">本频道已关闭</p>"):exit Sub
Set rs=Cl.Execute("Select ClassID,ClassName From Cl_Class Where ParentID="&ClassID&" and ChannelID="&ChannelID&"")
Response.write ("<p align=""center"">=<strong>"&FormatStr(Cl.Channel.selectSingleNode("@channelitemname").text&"栏目列表")&"</strong>="& vbCrLf)
if rs.eof and rs.bof then
response.write Wap.FormatStr("<br/>当前没有"&Cl.Channel.selectSingleNode("@channelitemname").text&"栏目")
else
do while not rs.EOF
Response.write ("<br/><a href='"&Cl.WebDir & FileNameStr &"?ClassID="&rs(0)&"&ChannelID="&ChannelID&"'>"&FormatStr(rs(1))&"</a>"& vbCrLf)
rs.MoveNext
Loop
End if
rs.close
Set rs=nothing
Response.write ("</p>")
End Sub
'项目列表
Public Sub ShowItemlist(Byval sClassID,Byval sChannelID)
Cl.Load_ChannelSetting(sChannelID)
If Cl.Channel.selectSingleNode("@iswap").text=0 Then Response.write("<p align=""center"">本频道已关闭</p>") : Exit Sub
Dim Rs2,SQL2,i
Select Case Cl.Channel.selectSingleNode("@moduleid").text
Case 1
Sql="Select InfoID,Title from Cl_Article Where ClassID="&sClassID&" and Status=1 and Deleted=False order by InfoID Desc"
SQL2="Select Count(InfoID) from Cl_Article Where ClassID="&sClassID&" and Status=1 and Deleted=False"
Case 2
Sql="Select InfoID,SoftName from Cl_Soft Where ClassID="&sClassID&" and Status=1 and Deleted=False order by InfoID Desc"
SQL2="Select Count(InfoID) from Cl_Soft Where ClassID="&sClassID&" and Status=1 and Deleted=False"
Case 3
Sql="Select InfoID,PhotoName from Cl_Photo Where ClassID="&sClassID&" and Status=1 and Deleted=False order by InfoID Desc"
SQL2="Select Count(InfoID) from Cl_Photo Where ClassID="&sClassID&" and Status=1 and Deleted=False"
Case 4
Sql="Select InfoID,MovieName from Cl_Movie Where ClassID="&sClassID&" and Status=1 and Deleted=False order by InfoID Desc"
SQL2="Select Count(InfoID) from Cl_Movie Where ClassID="&sClassID&" and Status=1 and Deleted=False"
Case 5
Sql="Select InfoID,ProductName from Cl_Product Where ClassID="&sClassID&" and Status=1 and Deleted=False order by InfoID Desc"
SQL2="Select Count(InfoID) from Cl_Product Where ClassID="&sClassID&" and Status=1 and Deleted=False"
' Case 6
' Sql="Select GuestID,UserName from Cl_Guest Where ClassID="&sClassID&" and Status=1 and Deleted=False"
Case else : Exit sub
End select
Set rs = Cl.Execute(SQL2)
TotalPut = Rs(0)
Rs.Close : Set Rs=Nothing
PageSize=5'Cl.ChannelOtherSetting(3)
Response.write ("<p align=""center"">=<strong>"&FormatStr(Cl.Channel.selectSingleNode("@channelitemname").text&"列表")&"</strong>=</p>"& vbCrLf)
if TotalPut < 1 then
response.write Wap.FormatStr("<p align=""center""><br/>当前没有"&Cl.Channel.selectSingleNode("@channelitemname").text&"</p>")
else
Set rs = Cl.Execute(SQL)
if (TotalPut mod PageSize)=0 then
TotalPages = TotalPut \ PageSize
else
TotalPages = TotalPut \ PageSize + 1
end if
if CurrentPage > TotalPages then CurrentPage=TotalPages
if CurrentPage <= 1 then
CurrentPage=1
else
Rs.move (CurrentPage-1)*PageSize
end if
Response.write ("<p align=""left"">")
i=0
do while not rs.EOF
Response.write ("<br/><a href='"&Cl.WebDir & FileNameStr &"?InfoID="&rs(0)&"&ChannelID="&sChannelID&"'>"&FormatStr(rs(1))&"</a>"& vbCrLf)
rs.MoveNext
i=i+1
if i>= PageSize then Exit do
Loop
Response.write ("</p>")
Response.write (ShowPage(FileNameStr &"?ClassID="&sClassID&"&ChannelID="&sChannelID,TotalPut,PageSize,Cl.Channel.selectSingleNode("@channelitemunit").text,Cl.Channel.selectSingleNode("@channelitemname").text))
rs.close : Set rs=nothing
End if
End Sub
'判断内容显示方式
Public Sub ShowContent(sInfoID,sChannelID)
Cl.Load_ChannelSetting(sChannelID)
Select Case Clng(Cl.Channel.selectSingleNode("@moduleid").text)
Case 1 : Call ShowArticle(sInfoID,Cl.Channel.selectSingleNode("@channelitemname").text)
Case 2 : Call ShowSoft(sInfoID,Cl.Channel.selectSingleNode("@channelitemname").text)
Case 3 : Call ShowPhoto(sInfoID,Cl.Channel.selectSingleNode("@channelitemname").text)
Case 4 : Call ShowMovie(sInfoID,Cl.Channel.selectSingleNode("@channelitemname").text)
Case 5 : Call ShowProduct(sInfoID,Cl.Channel.selectSingleNode("@channelitemname").text)
Case 6 : Call ShowGuest(sInfoID,Cl.Channel.selectSingleNode("@channelitemname").text)
Case Else : Exit Sub
End Select
End Sub
'文章显示
Public Sub ShowArticle(sInfoID,ItemName)
Dim Author,CopyFrom
sInfoID = Clng(sInfoID)
Sql="Select InfoID,ChannelID,ClassID,Title,Author,CopyFrom,Content,Status,Deleted from Cl_Article Where InfoID=" & sInfoID
Set rs=Cl.Execute(Sql)
if rs.eof and rs.bof then
response.write FormatStr("<p align=""center"">"&ItemName&"参数错误!</p>")
else
if Rs("Status")=0 Or Rs("Deleted")=True then
response.write FormatStr("<p align=""center"">错误,此内容已经删除或者未审核通过!</p>")
End if
Cl.Execute("Update Cl_Article Set Hits=Hits+1 Where InfoID=" & sInfoID)
if instr(rs("Author"),"|")>0 then
Author="<a href=""mailto:" & right(Rs("Author"),len(Rs("Author"))-instr(Rs("Author"),"|")) & """>" & left(Rs("Author"),instr(Rs("Author"),"|")-1) & "</a>"
Else
Author=rs("Author")
End IF
if instr(Rs("CopyFrom"),"|")>0 then
CopyFrom="<a href=""" & right(Rs("CopyFrom"),len(Rs("CopyFrom"))-instr(Rs("CopyFrom"),"|")) & """>" & left(Rs("CopyFrom"),instr(Rs("CopyFrom"),"|")-1) & "</a>"
Else
CopyFrom=rs("CopyFrom")
End If
response.write "<p align=""center""><strong>"&FormatStr(rs("Title"))&"</strong></p>"
response.write "<p align=""left"">"&FormatStr("作者:"&Author&"")&"<br />"&FormatStr("出处:"&CopyFrom&"")&"</p>"
response.write "<p align=""center"">--------------------</p>"
response.write "<p align=""left"">"&ContentPage(FileNameStr &"?InfoID="&sInfoID&"&ChannelID="&Rs("ChannelID"),rs("Content"),200)&"</p>"
End if
rs.close : Set rs=nothing
End Sub
'软件显示
Public Sub ShowSoft(sInfoID,ItemName)
Sql="Select InfoID,ChannelID,ClassID,SoftName,Author,Hits,Intro from Cl_Soft Where InfoID="&sInfoID&" and Status=1 and Deleted=False"
Set rs=Cl.Execute(sql)
if rs.eof and rs.bof then
response.write FormatStr("<p align=""center"">"&ItemName&"参数错误!</p>")
Else
response.write "<p align=""center""><strong>"&FormatStr(rs(3))&"</strong></p>"
response.write "<p align=""left"">"&FormatStr("作者:"&rs(4)&"")
response.write "<br />"&FormatStr("点击:"&rs(5)&" 次")
response.write "<br />"&FormatStr("下载:点击下载")&"</p>"
response.write "<p align=""center"">-----"&FormatStr("简介")&"-----</p>"
response.write "<p align=""left""> "&FormatStr(FormatContent(rs(6)))&"</p>"
End if
rs.close : Set rs=nothing
End Sub
'图片显示
Public Sub ShowPhoto(sInfoID,ItemName)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -