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

📄 create_listing.asp

📁 大型黄页系统,精美黄页flash演示,10m
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="setup.asp"-->
<%
Dim DownloadClass
Set DownloadClass = New Create_Listing_Cls
DownloadClass.ArticleList
Set DownloadClass = Nothing
CloseConn

Class Create_Listing_Cls
	Private id, classid, rootid, depth, ClassName, ParentID, strParent, Child, K
	Private CurrentPage, maxperpage, totalnumber, bookmark, Pcount
	Private order_name, strOrder, ShowPageHtml, HtmlTemplate
	Private DownloadClass_Ads
	Private action
	Private TotalPageNum, WhereSQL
	Private temphtml, NowStats, HtmlTitle, ArticleIndex
	Private TempTopStr, TempFootStr, Style_CSS
	Private SQL, Rs, Rs1, SQL1, CreateHtml, FSO, total, NewFolderPath, objFSO

	Private Sub Class_Initialize()
		Set DownloadClass_Ads = New Adcolumn_Cls
		DownsysClass.LoadTemplates ("listing")
		maxperpage = DownsysClass.TempSet(0)
	End Sub

	Private Sub Class_Terminate()
		If IsObject(Conn) Then
			Conn.Close
			Set Conn = Nothing
		End If
		If IsObject(DownloadClass_Ads) Then
			Set DownloadClass_Ads = Nothing
		End If
	End Sub

	Public Sub ArticleList()
		On Error Resume Next
		Server.ScriptTimeout = 99999
		Set NC_Admin = New Check
		NC_Admin.AdminChk = "34"
		NC_Admin.Check
		DownsysClass.admin_header
		If Not(DownsysClass.IsObjectFSO(DownsysClass.Script_FSO) And CInt(DownsysClass.Setting(5)) = 0 ) Then
			NC_Admin.Error_Msg ("<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)或你后台没有选择为html方式</font></b>")
			DownsysClass.admin_footer
			Response.End
		End If
		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
		Set Rs = Server.CreateObject("adodb.recordset")
		Set Rs1 = Server.CreateObject("adodb.recordset")
		SQL1 = "select * from [NC_Class]"
		Rs1.Open SQL1, Conn, 1, 1
		total = Rs1.recordcount
		Rs1.MoveFiRst
		ClassID = Rs1(0)
		K = 1
		Do While Not Rs1.EOF
		If ClassID <> "" Then
			SQL = "select classid,ClassName,rootid,depth,ParentID,strParent,Child,ArticleNum from [NC_Class] where classid = " & ClassID
			Rs.Open SQL, Conn, 1, 1
			If Rs.bof And Rs.EOF Then
				Response.Write "Sorry!没有找到任何文章信息。或者您选择了错误的系统参数!"
			Else
				ClassName = Rs("ClassName")
				ClassID = Rs("ClassID")
				rootid = Rs("rootid")
				depth = Rs("depth")
				ParentID = Rs("ParentID")
				strParent = Rs("strParent")
				Child = Rs("Child")
				TotalNumber = Rs("ArticleNum")
			End If
			Rs.Close
		End If
		'########################################
		TotalPageNum = CInt(TotalNumber / maxperpage) '得到总页数
		If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
		CurrentPage = 1
		'#########################################
		order_name = "InfoTime"
		strOrder = "Indate"
		Do
		ArticleIndex = "<A HREF='" & DownsysClass.SetupDir & "Article/index.html'>" & DownsysClass.TempSet(10) & "</A>→"
		If Len(classid) = 0 Then
			NowStats = ArticleIndex & ClassName
		Else
			NowStats = ArticleIndex & NowStation(classid, ClassName, ParentID, strParent)
		End If
		HtmlTitle = ClassName
		If Len(DownsysClass.temphtml(0)) < 50 Then
			TempTopStr = DownsysClass.mainhtml(0) & DownsysClass.mainhtml(1) & DownsysClass.mainhtml(2) & DownsysClass.mainhtml(3)
		Else
			TempTopStr = DownsysClass.temphtml(0)
		End If
		If Len(DownsysClass.temphtml(4)) = 0 Then
			TempFootStr = DownsysClass.mainhtml(4)
		Else
			TempFootStr = DownsysClass.temphtml(5)
		End If
		temphtml = TempTopStr & DownsysClass.temphtml(1) & DownsysClass.temphtml(2) & DownsysClass.temphtml(3) & TempFootStr
		temphtml = Replace(temphtml, "{$NavMenu}", DownsysClass.ClassMenu)
		temphtml = Replace(temphtml, "{$Width}", DownsysClass.mainset(0))
		temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(9))
		temphtml = Replace(temphtml, "{$FootMeun}", DownsysClass.mainset(44))
		temphtml = Replace(temphtml, "{$Style_CSS}", DownsysClass.Style_CSS)
		temphtml = Replace(temphtml, "{$NowStats}", NowStats)
		temphtml = Replace(temphtml, "{$Title}", HtmlTitle)
		temphtml = Replace(temphtml, "{$ClassID}", ClassId)
		temphtml = Replace(temphtml, "{$ArticleClass}", ArticleClass(ClassId, ParentID, Child))
		temphtml = Replace(temphtml, "{$NewArticle}", NewArticle)
		temphtml = Replace(temphtml, "{$BestArticle}", BestArticle)
		temphtml = Replace(temphtml, "{$PicNews}", PictureNews)
		temphtml = Replace(temphtml, "{$NewPic}", SingleImage("InfoTime"))
		temphtml = Replace(temphtml, "{$HotPic}", SingleImage("Hits"))
		temphtml = Replace(temphtml, "{$sousuo}", sousuo)
		temphtml = Replace(temphtml, "{$ArticleList}", ArticleClassList(classid, rootid, depth, ClassName, order_name, maxperpage, CurrentPage, strOrder))
		temphtml = Replace(temphtml, "{$Adcolumn(0)}", DownloadClass_Ads.RunScriptAds(5))
		temphtml = Replace(temphtml, "{$Adcolumn(1)}", DownloadClass_Ads.BannerAds(5))
		temphtml = Replace(temphtml, "{$Adcolumn(2)}", DownloadClass_Ads.AdsColumn(5, 2))
		temphtml = Replace(temphtml, "{$Adcolumn(3)}", DownloadClass_Ads.AdsColumn(5, 3))
		temphtml = Replace(temphtml, "{$Adcolumn(6)}", DownloadClass_Ads.AdsColumn(5, 7))
		temphtml = Replace(temphtml, "{$Adcolumn(7)}", DownloadClass_Ads.AdsColumn(5, 8))
		temphtml = Replace(temphtml, "{$Adcolumn(4)}", DownloadClass_Ads.ScriptFloatAds(5))
		temphtml = Replace(temphtml, "{$Adcolumn(5)}", DownloadClass_Ads.ScriptFixedAds(5))

		NewFolderPath = Server.MapPath(DownsysClass.SetupDir & "Listing/Catalog" & ClassID)
		Set objFSO = Server.CreateObject(DownsysClass.Script_FSO)
		If Not objFSO.FolderExists(NewFolderPath) Then
			objFSO.CreateFolder (NewFolderPath)
		End If
		objFSO.Close
		Set objFSO = Nothing
		If CurrentPage < 1 Then
			CreateHtml = Server.MapPath(DownsysClass.SetupDir & "Listing/Catalog" & ClassID & "/Listing_Indate_Desc_1.html")
		Else
			CreateHtml = Server.MapPath(DownsysClass.SetupDir & "Listing/Catalog" & ClassID & "/Listing_Indate_Desc_" & CurrentPage & ".html")
		End If
		Set FSO = Server.CreateObject("ADODB.STREAM")
		With FSO
			.Open
			.Charset = "GB2312"
			.WriteText temphtml
			.SaveToFile CreateHtml,2
			.Close
		End With
		Set FSO = Nothing
  		CurrentPage = CurrentPage + 1
		Loop while CurrentPage <= TotalPageNum

		Response.Write "<script>img2.width=" & Fix((K / total) * 400) & ";" & vbCrLf
		Response.Write "txt2.innerHTML=""生成进度:" & FormatNumber(K/ total * 100, 4, -1) & """;" & vbCrLf
		Response.Write "txt3.innerHTML=""共有 <B><font color=RED>" & total & "</font></B> 个 正在生成第 " & K & " 个"";" & vbCrLf
		Response.Write "img2.title=""(" & K & ")"";</script>" & vbCrLf
		Response.Flush
		Rs1.movenext
		ClassID  = Rs1(0)
		K = K + 1
		Loop
		Rs1.Close
		Set Rs1 = Nothing
		Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"
		NC_Admin.Succeed_Msg ("生成文章列表页完成!")
		DownsysClass.admin_footer
	End Sub
	'*************************************************************
	'函数作用:文章列表
	'*************************************************************
	Private Function ArticleClassList(classid, rootid, depth, ClassName, order_name, maxperpage, CurrentPage, strOrder)
		Dim Rs, SQL
		Dim HtmlString, i, Icon, isCommend
		Dim Title, InfoTime, j
		Set Rs = Server.CreateObject("adodb.recordset")
		If Len(classid) = 0 Then
			WhereSQL = "where isLock=0"
		Else
			If depth = 0 Then
				WhereSQL = "where isLock=0 and rootid = " & rootid & ""
			Else
				Dim Rs_c, AllClassID, ParentStr
				Set Rs_c = DownsysClass.Execute("select * from NC_Class where strParent like '%"& classid &"%'")
				If Rs_c.EOF And Rs_c.bof Then
					AllClassID = classid
				Else
					Do While Not Rs_c.EOF
						ParentStr = Split(Rs_c("strParent"), ",")
						For i = 0 To UBound(ParentStr)
							If CLng(ParentStr(i)) = classid Then
								AllClassID = AllClassID & Rs_c("classid") &","
							End If
						Next
						Rs_c.movenext
					Loop
					AllClassID = AllClassID & classid
				End If
				Rs_c.Close
				Set Rs_c = Nothing
				WhereSQL = "where isLock=0 and classid in (" & AllClassID & ")"
			End If
		End If
		TotalNumber = Conn.Execute("Select count(id) from [NC_Article] "& WhereSQL &"")(0)
		TotalPageNum = CInt(TotalNumber / maxperpage) '得到总页数
		If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
		If CurrentPage < 1 Then CurrentPage = 1
		If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
		SQL = "select * from NC_Article "& WhereSQL &" order by isTop Desc, " & order_name & " Desc, ID Desc"
		Rs.Open SQL, Conn, 1
		If CInt(DownsysClass.Setting(5)) = 0 Then
			HtmlString = DownsysClass.TempSet(12)
		Else
			HtmlString = DownsysClass.TempSet(13)
		End If
		HtmlString = Replace(HtmlString, "{$ClassID}", classid)
		If Rs.bof And Rs.EOF Then
			HtmlString = HtmlString & "<p align=center>还没有找到任何文章!</p>"
		Else
			If TotalPageNum > 1 Then Rs.Move (CurrentPage - 1) * maxperpage
			i = 0
			j = (CurrentPage - 1) * maxperpage + 1
			Do While Not Rs.EOF And i < CInt(maxperpage)
				HtmlString = HtmlString & DownsysClass.TempSet(14)
				If CInt(Rs("isTop")) = 1 Then
					Icon = "<img src='" & DownsysClass.SetupDir & "images/isTop.gif' align='absmiddle'>"
				Else
					Icon = "<img src='" & DownsysClass.SetupDir & DownsysClass.TempDir & "icon2.gif' align='absmiddle'>"
				End If
				If CInt(Rs("isCommend")) = 0 Then
					isCommend = ""
				Else
					isCommend = DownsysClass.TempSet(16)
				End If
				If CInt(DownsysClass.Setting(5)) = 0 Then
					Title = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs("classid") & "/" & Rs("ID") & ".html'>" & DownsysClass.gotTopic(Rs("Title"), CInt(DownsysClass.TempSet(23))) & "</a> "
				Else
					Title = "<A HREF='" & DownsysClass.SetupDir & "Article.Asp?id=" & Rs("ID") & "'>" & DownsysClass.gotTopic(Rs("Title"), CInt(DownsysClass.TempSet(23))) & "</a> "
				End If
				If Rs("InfoTime") >= Date Then
					InfoTime = "<FONT color=red>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				Else
					InfoTime = FormatDateTime(Rs("InfoTime"), 2)
				End If
				HtmlString = Replace(HtmlString, "{$Title}", Title)
				HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
				HtmlString = Replace(HtmlString, "{$Hits}", Rs("Hits"))
				HtmlString = Replace(HtmlString, "{$Commend}", isCommend)
				HtmlString = Replace(HtmlString, "{$Icon}", Icon)
				HtmlString = Replace(HtmlString, "{$Sequence}", j)
				Rs.movenext
				i = i + 1
				j = j + 1
			Loop
		End If
		Rs.Close
		Set Rs = Nothing
		HtmlString = HtmlString & DownsysClass.TempSet(15)
		HtmlString = Replace(HtmlString, "{$ShowPage}", ShowPage(ClassName, maxperpage, CurrentPage, totalnumber))
		ArticleClassList = HtmlString
	End Function
	'*************************************************************
	'函数作用:最新加入文章
	'*************************************************************
	Private Function NewArticle()
		Dim Rs, SQL, HtmlString, ArticleTitle, ClassName, InfoTime, InfoDate
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select Top " & CInt(DownsysClass.TempSet(20)) & " id,classid,Title, ClassName,InfoTime,Hits from NC_Article where isLock = 0 order by 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 Rs("InfoTime") >= Date Then
					InfoTime = "<FONT color=red>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
					InfoDate = "<FONT color=red>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
				Else

⌨️ 快捷键说明

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