📄 category
字号:
Private blnError
Private strError
Private strCate
Private rs, strSQL
Private MyCore
Private Sub Class_Initialize()
Set MyCore = vbsre.mocom.WAPmo.WAP.Core
Set MyXML = MyKernel.XMLParser
strCate = GetCategory(MyCore.CateId)
blnError = True
End Sub
Private Sub Class_Terminate()
Set MyCore = Nothing
End Sub
Public Sub main()
If Not MyCore.CheckStaple() Then
MyXML.Println "找不到您要访问的栏目"
ElseIf MyCore.Staple("Category") = wmStapleLinking Then
MyXML.Println "错误的栏目类型"
ElseIf MyCore.Staple("Cate") = 0 Then
MyXML.Println "该栏目未设置分类"
ElseIf strCate = "" Then
MyXML.Println "找不到分类"
ElseIf MyIO.Env("REQUEST_METHOD") = "POST" Then
Call doPost
Else
Call doGet
End If
MyXML.Println MyXML.CreateA("index.asp", "返回首页", GetImagePrefix("images/home.gif"), "")
Call setLog("category", 0)
Call MyKernel.OutputXML(Empty)
End Sub
Private Sub doGet()
MyXML.Align = "center"
MyXML.Printf MyCore.Staple("Title") & "-" & strCate
MyXML.Align = "left"
If MyCore.Staple("Publish") = 1 Then
MyXML.Println MyXML.CreateA("upload.asp?StapleId=" & MyCore.Staple("SeqId") & "&CateId=" & MyCore.CateId & "&PageNo=" & MyCore.PageNo, "[发布信息]", GetImagePrefix("images/publish.gif"), "")
End If
MyXML.Println ""
Call ExportContents("0", "", "", "", "", "", "")
MyXML.Println ""
End Sub
Private Sub doPost()
End Sub
Private Sub ExportContents _
( _
ByVal strPrefixType, _
ByVal strPrefix, _
ByVal strSuffix, _
ByVal strAttach, _
ByVal strAttachCount, _
ByVal strSpace, _
ByVal strBytes _
)
Dim objPage
Dim i, k
Dim intBytes
Dim intAttachCount
Dim xmlNode, xmlDoc2, xmlNode2, strFrontImage
intBytes = atoi(strBytes)
If intBytes < 0 Then intBytes = 0
intAttachCount = atoi(strAttachCount)
Set objPage = vbsre.mocom.WAPmo.Page.newInstance()
objPage.ID = MyCore.PageNo
objPage.Size = IIf(MyCore.Staple("ContentPage") < 1, 20, MyCore.Staple("ContentPage"))
If MyCore.Staple("ContentSort") = 2 And WM_DataType = adSqlServer Then
objPage.DataType = adAccess
Else
objPage.DataType = WM_DataType
End If
objPage.Index = "SEQID"
objPage.Column = "SEQID,STAPLEID,STAPLETITLE,TITLE,MATTER,HIT,MARK,INTIME"
objPage.Table = T_CONTENT
objPage.Where = "STAPLEID=" & MyCore.Mapping("SeqId") & " AND HIDDEN=0 AND CATE=" & MyCore.CateId & " AND EXAMINE=1"
objPage.Count = GetPageCount(objPage)
Select Case MyCore.Staple("ContentSort")
Case 1
objPage.Sort = "SEQID DESC"
objPage.SortType = 1
Case 2
objPage.Sort = "HIT DESC"
objPage.SortType = 1
Case Else
objPage.Sort = "SEQID ASC"
objPage.SortType = 0
End Select
objPage.Build "contents", "content"
If objPage.Rows.hasChildNodes Then
MyCore.PageNo = objPage.ID
Dim strURL
Dim strTitle
Dim strImage
i = 0
k = 0
If strAttach = "1" Then
Set xmlDoc2 = GetMatterDoc(objPage.Rows)
Else
Set xmlDoc2 = Nothing
End If
For Each xmlNode In objPage.Rows.childNodes
strTitle = XMLAttr(xmlNode, "title")
If intBytes > 0 And LenC(strTitle) > intBytes Then
strTitle = MidC(strTitle, 1, intBytes) & "..."
End If
If strSuffix <> "" Then
strTitle = strTitle & getContentSuffix(XMLAttr(xmlNode, "hit"), XMLAttr(xmlNode, "intime"), strSuffix)
End If
If strAttach = "1" And Not xmlDoc2 Is Nothing Then
If atol(XMLAttr(xmlNode, "matter")) > 0 And (intAttachCount = 0 Or (intAttachCount > 0 And intAttachCount <> k)) Then
Set xmlNode2 = XMLQuery(xmlDoc2, "matters/matter[@mark=" & XMLAttr(xmlNode, "matter") & "]")
If Not xmlNode2 Is Nothing Then
strFrontImage = GetMatterFront(xmlNode2)
If strFrontImage <> "" Then
MyXML.Println MyXML.CreateImg(strFrontImage, "加载中……", -1, -1)
k = k + 1
End If
End If
End If
End If
strURL = "content.asp?StapleId=$(StapleId)&PageNo=$(PageNo)&CateId=$(CateId)&ContentId=$(ContentId)&Intime=$(Intime)"
strURL = Replace(strURL, "$(StapleId)", MyCore.Mapping("SeqId"))
strURL = Replace(strURL, "$(PageNo)", objPage.ID)
strURL = Replace(strURL, "$(CateId)", MyCore.CateId)
strURL = Replace(strURL, "$(ContentId)", XMLAttr(xmlNode, "seqid"))
strURL = Replace(strURL, "$(Intime)", XMLAttr(xmlNode, "intime"))
strImage = ""
Select Case atoi(strPrefixType)
Case 1
strTitle = ((objPage.ID - 1) * objPage.Size + i + 1) & "." & strTitle
Case 2
strTitle = strPrefix & strTitle
Case 3
strImage = "front" & strPrefix & ".gif"
Case Else
End Select
MyXML.Println MyXML.CreateA(strURL, strTitle, strImage, "")
i = i + 1
Next
Set xmlDoc2 = Nothing
strURL = "category.asp?StapleId=$(StapleId)&CateId=$(CateId)&PageNo=$(PageNo)"
strURL = Replace(strURL, "$(StapleId)", MyCore.Staple("SeqId"))
strURL = Replace(strURL, "$(CateId)", MyCore.CateId)
If objPage.ID < objPage.Total Then
MyXML.Printf MyXML.CreateA(Replace(strURL, "$(PageNo)", objPage.ID + 1), "下一页", "", "")
MyXML.Printf "|"
MyXML.Println MyXML.CreateA(Replace(strURL, "$(PageNo)", objPage.Total), "最末页", "", "")
End If
If objPage.ID > 1 Then
MyXML.Printf MyXML.CreateA(Replace(strURL, "$(PageNo)", objPage.ID - 1), "上一页", "", "")
MyXML.Printf "|"
MyXML.Println MyXML.CreateA(Replace(strURL, "$(PageNo)", 1), "第一页", "", "")
End If
If objPage.Total > 2 Then
MyXML.SetF "category.asp", "get", "", True
Call SetQuery
MyXML.SetN "StapleId", "hidden", MyCore.Staple("SeqId"), "", "", False
MyXML.SetN "CateId", "hidden", MyCore.CateId, "", "", False
MyXML.SetN "PageNo", "text", "", objPage.ID & "/" & objPage.Total & "页>>跳到", "页", False, 5, 5, "*N"
MyXML.SetN "", "submit", "GO", "", "", False
End If
End If
Set objPage = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -