⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 create_sortingcls.asp

📁 多用户管理分权限发布、管理软件信息;  自由选择系统默认为静态HTML或动态ASP;  无限制添加下载服务器
💻 ASP
📖 第 1 页 / 共 4 页
字号:
				Rsc.movenext
				i = i + 1
			Loop
		End If
		Rsc.Close
		CreateSortingTop "", "", ""
		Set Rsc = Nothing
		Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"
		Response.Write "<meta http-equiv=""refresh"" content=""1;url='?num=" & totalnumber & "&D=" & d & "&type=ok'"">"
	End Sub

	Private Sub CreateClassJS()
		Dim totalnumber
		Dim Rsc
		Dim SQL
		Dim i
		Response.Write "<b><font color=""#FF0000"">  正在生成文章分类排行JS文件,请稍候......</font></b><BR>" & vbCrLf
		Response.Write "<table width=""400"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbCrLf
		Response.Write "<tr> " & vbCrLf
		Response.Write "<td bgcolor=000000>" & vbCrLf
		Response.Write " <table width=""400"" border=""0"" cellspacing=""0"" cellpadding=""1"">" & vbCrLf
		Response.Write "<tr> " & vbCrLf
		Response.Write "<td bgcolor=ffffff height=9><img src=""images/bar9.gif"" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>" & vbCrLf
		Response.Write "</td></tr></table></td></tr><tr> " & vbCrLf
		Response.Write "<td align=center bgcolor=000000> <span id=txt2 name=txt2 style=""font-size:9pt"">0</span><span style=""font-size:9pt"">%</span>  <span id=txt3 name=txt3 style=""font-size:9pt"">0</span></td></tr>" & vbCrLf
		Response.Write "</table>" & vbCrLf
		Response.Flush
		CreateArticleTop 0, "HotTop.JS"
		CreateArticleTop 1, "DayHot.JS"
		CreateArticleTop 2, "WeekHot.JS"
		CreateArticleTop 3, "MonthHot.JS"
		Set Rsc = CreateObject("adodb.recordset")
		SQL = "select classid,ClassName,rootid,depth from [NC_Class] order by classid desc"
		Rsc.Open SQL, Conn, 1, 1
		If Rsc.EOF And Rsc.bof Then
			Response.Write "Sorry!没有找到任何分类。或者分类没有更新!"
			i = 1
		Else
			totalnumber = Rsc.recordcount
			Do While Not Rsc.EOF
				CreateClassTop Rsc("classid"), Rsc("rootid"), Rsc("depth")
				Response.Write "<script>img2.width=" & Fix((i / totalnumber) * 400) & ";" & vbCrLf
				Response.Write "txt2.innerHTML=""生成进度:" & FormatNumber(i / totalnumber * 100, 4, -1) & """;" & vbCrLf
				Response.Write "txt3.innerHTML=""  共有 <B><font color=RED>" & totalnumber & "</font></B> 个  正在生成第 " & i & " 个"";" & vbCrLf
				Response.Write "img2.title=""(" & i & ")"";</script>" & vbCrLf
				Response.Flush
				Response.Write "<table cellpadding=0 cellspacing=0 border=0 width=95% align=center><tr><td colspan=2 class=forumrow>  生成 [" & Rsc(1) & "] 排行JS完成。</td></tr></table>"
				Response.Flush
				Rsc.movenext
				i = i + 1
			Loop
		End If
		Rsc.Close
		Set Rsc = Nothing
		CreateClassTop "", "", ""
		Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"
		Response.Write "<meta http-equiv=""refresh"" content=""1;url='?num=" & totalnumber & "&D=" & d & "&type=ok'"">"
	End Sub
	'*************************************************************
	'函数作用:下载排行 hitsID=0:下载总排行 hitsID=1:本日下载排行
	'*************************************************************
	Private Function CreateDownTop(HitsID, Jname)
		Dim Rs
		Dim SQL
		Dim HtmlString
		Dim OrderName
		Dim SoftName
		Dim JString
		Dim SoftTime
		Select Case CInt(HitsID)
			Case 1
				OrderName = "DayHits"
			Case 2
				OrderName = "WeekHits"
			Case 3
				OrderName = "MonthHits"
			Case Else
				OrderName = "Hits"
		End Select
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(Newasp.mainset(13)) & " softid,sortid,SoftName,SoftVer, " & OrderName & ", SoftTime from NC_SoftInfo where isLock = 0 order by " & OrderName & " desc, SoftTime desc, softid desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有排行软件!"
		Else
			Do While Not Rs.EOF
				If CInt(Newasp.Setting(5)) = 0 Then
					SoftName = "<A HREF='" & Newasp.SetupDir & "Software/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='软件名称: " & Rs(2) & Rs(3) & "<BR>更新时间: " & Rs(5) & "<BR>下载次数: " & Rs(4) & "'>" & Newasp.gotTopic(Rs(2) & Rs(3), CInt(Newasp.mainset(14))) & "</A>"
				Else
					SoftName = "<A HREF='" & Newasp.SetupDir & "Software.asp?id=" & Rs(0) & "' title='软件名称: " & Rs(2) & Rs(3) & "<BR>更新时间: " & Rs(5) & "<BR>下载次数: " & Rs(4) & "'>" & Newasp.gotTopic(Rs(2) & Rs(3), CInt(Newasp.mainset(14))) & "</A>"
				End If
				SoftTime = Month(Rs("SoftTime")) & "/" & Day(Rs("SoftTime"))
				HtmlString = HtmlString & Newasp.mainset(15)
				HtmlString = Replace(HtmlString, "{$SoftTopName}", SoftName)
				HtmlString = Replace(HtmlString, "{$SoftHits}", Rs(4))
				HtmlString = Replace(HtmlString, "{$SoftTime}", SoftTime)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		JString = "document.write (" & Chr(34) & " " & HtmlString & " " & Chr(34) & ");"
		CreateJsFile JString, Jname
	End Function
	'*************************************************************
	'函数作用:软件分类排行
	'*************************************************************
	Private Function CreateSortingTop(sortid, rootid, depth)
		Dim Rs
		Dim SQL
		Dim HtmlString
		Dim SortingTopName
		Dim JString
		Dim Jname
		Dim SoftTime
		Jname = "ThisTop" & sortid & ".JS"
		If sortid = "" Then
			SQL = "select Top " & CInt(Newasp.mainset(13)) & " * from NC_softinfo where isLock=0 order by Hits Desc, SoftTime Desc, softid Desc"
		Else
			If depth = 0 Then
				SQL = "select Top " & CInt(Newasp.mainset(13)) & " * from NC_softinfo where isLock=0 and rootid=" & rootid & " order by Hits Desc, SoftTime Desc, softid Desc"
			Else
				SQL = "select Top " & CInt(Newasp.mainset(13)) & " * from NC_softinfo where isLock=0 and sortid=" & sortid & " order by Hits Desc, SoftTime Desc, softid Desc"
			End If
		End If
		Set Rs = Server.CreateObject("adodb.recordset")
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有排行软件!"
		Else
			Do While Not Rs.EOF
				If CInt(Newasp.Setting(5)) = 0 Then
					SortingTopName = "<A HREF='" & Newasp.SetupDir & "Software/Catalog" & Rs("sortid") & "/" & Rs("softid") & ".html' title='软件名称: " & Rs("SoftName") & Rs("SoftVer") & "<BR>更新时间: " & Rs("SoftTime") & "<BR>下载次数: " & Rs("Hits") & "'>" & Newasp.gotTopic(Rs("SoftName") & Rs("SoftVer"), CInt(Newasp.mainset(14))) & "</A>"
				Else
					SortingTopName = "<A HREF='" & Newasp.SetupDir & "Software.asp?id=" & Rs("softid") & "' title='软件名称: " & Rs("SoftName") & Rs("SoftVer") & "<BR>更新时间: " & Rs("SoftTime") & "<BR>下载次数: " & Rs("Hits") & "'>" & Newasp.gotTopic(Rs("SoftName") & Rs("SoftVer"), CInt(Newasp.mainset(14))) & "</A>"
				End If
				SoftTime = Month(Rs("SoftTime")) & "/" & Day(Rs("SoftTime"))
				HtmlString = HtmlString & Newasp.mainset(15)
				HtmlString = Replace(HtmlString, "{$SoftTopName}", SortingTopName)
				HtmlString = Replace(HtmlString, "{$SoftHits}", Rs("Hits"))
				HtmlString = Replace(HtmlString, "{$SoftTime}", SoftTime)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		JString = "document.write (" & Chr(34) & " " & HtmlString & " " & Chr(34) & ");"
		CreateJsFile JString, Jname
	End Function
	'*************************************************************
	'函数作用:生成JS文件
	'*************************************************************
	Private Function CreateJsFile(JString, Jname)
		Dim CreateHtml
		Dim FSO
		Dim Fout
		Dim CreatePath
		Set FSO = Server.CreateObject(Newasp.Script_FSO)
		CreatePath = Newasp.SetupDir & "JS/SoftTop/" & Jname
		CreateHtml = Server.MapPath(CreatePath)
		Set Fout = FSO.CreateTextFile(CreateHtml)
		Fout.WriteLine JString
		Fout.Close
		Set Fout = Nothing
		Set FSO = Nothing
	End Function
	'*************************************************************
	'函数作用:生成JS文件
	'*************************************************************
	Private Function CreateJsFiles(JString, Jname)
		Dim CreateHtml
		Dim FSO
		Dim Fout
		Dim CreatePath
		Set FSO = Server.CreateObject(Newasp.Script_FSO)
		CreatePath = Newasp.SetupDir & "JS/ArticleTop/" & Jname
		CreateHtml = Server.MapPath(CreatePath)
		Set Fout = FSO.CreateTextFile(CreateHtml)
		Fout.WriteLine JString
		Fout.Close
		Set Fout = Nothing
		Set FSO = Nothing
	End Function
	'*************************************************************
	'函数作用:热门文章 hitsID=0:总浏览排行文章 hitsID=1:本日浏览排行
	'*************************************************************
	Private Function CreateArticleTop(HitsID, Jname)
		Dim Rs
		Dim SQL
		Dim HtmlString
		Dim OrderName
		Dim ArticleTitle
		Dim JString
		Dim InfoTime
		Select Case CInt(HitsID)
			Case 1
				OrderName = "DayHits"
			Case 2
				OrderName = "WeekHits"
			Case 3
				OrderName = "MonthHits"
			Case Else
				OrderName = "Hits"
		End Select
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(Newasp.mainset(16)) & " id,classid,Title, " & OrderName & ", InfoTime from NC_Article where isLock = 0 order by " & OrderName & " desc, InfoTime desc, id desc"
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有排行文章!"
		Else
			Do While Not Rs.EOF
				If CInt(Newasp.Setting(5)) = 0 Then
					ArticleTitle = "<A HREF='" & Newasp.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题: " & Rs(2) & "<BR>更新时间: " & Rs(4) & "<BR>浏览次数: " & Rs(3) & "'>" & Newasp.gotTopic(Rs(2), CInt(Newasp.mainset(17))) & "</A>"
				Else
					ArticleTitle = "<A HREF='" & Newasp.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题: " & Rs(2) & "<BR>更新时间: " & Rs(4) & "<BR>浏览次数: " & Rs(3) & "'>" & Newasp.gotTopic(Rs(2), CInt(Newasp.mainset(17))) & "</A>"
				End If
				InfoTime = Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime"))
				HtmlString = HtmlString & Newasp.mainset(18)
				HtmlString = Replace(HtmlString, "{$ArticleTitle}", ArticleTitle)
				HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs(3))
				HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		JString = "document.write (" & Chr(34) & " " & HtmlString & " " & Chr(34) & ");"
		CreateJsFiles JString, Jname
	End Function
	'*************************************************************
	'函数作用:文章分类排行
	'*************************************************************
	Private Function CreateClassTop(classid, rootid, depth)
		Dim Rs
		Dim SQL
		Dim HtmlString
		Dim SortingTopName
		Dim JString
		Dim Jname
		Dim InfoTime
		Jname = "ThisTop" & classid & ".JS"
		If classid = "" Then
			SQL = "select Top " & CInt(Newasp.mainset(16)) & " * from NC_Article where isLock=0 order by Hits Desc, InfoTime Desc, id Desc"
		Else
			If depth = 0 Then
				SQL = "select Top " & CInt(Newasp.mainset(16)) & " * from NC_Article where isLock=0 and rootid=" & rootid & " order by Hits Desc, InfoTime Desc, id Desc"
			Else
				SQL = "select Top " & CInt(Newasp.mainset(16)) & " * from NC_Article where isLock=0 and classid=" & classid & " order by Hits Desc, InfoTime Desc, id Desc"
			End If
		End If
		Set Rs = Server.CreateObject("adodb.recordset")
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			HtmlString = "还没有排行文章!"
		Else
			Do While Not Rs.EOF
				If CInt(Newasp.Setting(5)) = 0 Then
					SortingTopName = "<A HREF='" & Newasp.SetupDir & "Article/Catalog" & Rs("classid") & "/" & Rs("id") & ".html' title='软件名称: " & Rs("Title") & "<BR>更新时间: " & Rs("InfoTime") & "<BR>下载次数: " & Rs("Hits") & "'>" & Newasp.gotTopic(Rs("Title"), CInt(Newasp.mainset(17))) & "</A>"
				Else
					SortingTopName = "<A HREF='" & Newasp.SetupDir & "Article.asp?ID=" & Rs("classid") & "' title='软件名称: " & Rs("Title") & "<BR>更新时间: " & Rs("InfoTime") & "<BR>下载次数: " & Rs("Hits") & "'>" & Newasp.gotTopic(Rs("Title"), CInt(Newasp.mainset(17))) & "</A>"
				End If
				InfoTime = Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime"))
				HtmlString = HtmlString & Newasp.mainset(18)
				HtmlString = Replace(HtmlString, "{$ArticleTitle}", SortingTopName)
				HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
				HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
				Rs.movenext
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		JString = "document.write (" & Chr(34) & " " & HtmlString & " " & Chr(34) & ");"
		CreateJsFiles JString, Jname
	End Function

End Class
%>

⌨️ 快捷键说明

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