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

📄 create_articlecls.asp

📁 大型黄页系统,精美黄页flash演示,10m
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><%
Class Create_Article_Cls
	Private Rs, SQL, Rss, SQLS, total, CreateHtml, FSO, objFSO, NewFolderPath
	Private ArticleID, classid, rootid, depth, ClassName, ParentID, strParent, Child
	Private DownloadClass_Ads, Source, Writer, AllHits, Topic, Content
	Private action
	Private Rs1, i, j, k
	Private ArticleTypeSrt
	Private NowStats
	Private HtmlTitle
	Private Style_CSS
	Private HtmlTempStr
	Private Title, InfoTime
	Private stype, ArtType, ii
	Private TempString
	Private HtmlTemplate

	Private Sub Class_Initialize()
		Set Rs = Server.CreateObject("ADODB.Recordset")
		Set DownloadClass_Ads = New Adcolumn_Cls
		DownsysClass.LoadTemplates ("article")
	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 GetArticles()
		DownsysClass.admin_header
		Server.ScriptTimeout = 99999
		Set NC_Admin = New Check
		NC_Admin.AdminChk = "35"
		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 align=center> <span id=txt2 name=txt2 style=""font-size:9pt"">正在生成文件请耐心等待……</span>   <span id=txt3 name=txt3 style=""font-size:9pt""></span></td></tr>" & vbCrLf
		Response.Write "</table>" & vbCrLf
		Response.Flush
		Set Rss = Server.CreateObject("adodb.recordset")
		SQLs = "select id from [NC_Article] where isLock=0"
		Rss.Open SQLs, Conn, 1, 1
		total = Rss.recordcount
		If total = 0 Then
			NC_Admin.Error_Msg ("<script>txt2.innerHTML="""";txt3.innerHTML="""";</script> 没有你选择范围内文章信息页可生成!")
			DownsysClass.admin_footer
			Response.End
		End If
			Rss.MoveFiRst
			k = 1
			Do While Not Rss.EOF
				ArticleID = Rss("id")
				GetArticle(ArticleID) '生成文章信息html页
				Response.Write "<script>txt2.innerHTML=""生成进度:" & FormatNumber(k / total * 100, 2, -1) & "%"";" & vbCrLf
				Response.Write "txt3.innerHTML=""共有 <B><font color=RED>" & total & "</font></B> 个  正在生成第 " & k & " 个"";</script>" & vbCrLf
				Response.Flush
				Rss.movenext
				DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
				k = k + 1
			Loop
		Rss.Close
		Set Rss = Nothing
		Response.Write "<script>txt2.innerHTML="""";txt3.innerHTML="""";</script>"
		NC_Admin.Succeed_Msg ("共有 <B><font color=RED>" & total & "</font></B> 个文章信息页面生成完毕!")
		DownsysClass.admin_footer
	End Sub
	'*************************************************************
	'函数作用:生成文章
	'*************************************************************
	Public Sub GetArticle(ArticleID)
		On Error Resume Next
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select * from NC_Article where id = " & ArticleID
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			Response.Write "<p align=center>还没有找到相关文章!</p>"
			Exit Sub
		Else
			Topic = Rs("Title")
			Content = Rs("Content")
			InfoTime = Rs("InfoTime")
			Writer = Rs("Writer")
			Source = Rs("Source")
			AllHits = Rs("Hits")
			classid = Rs("classid")
		End If
		Rs.Close
		Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select classid,rootid,ClassName,depth,ParentID,strParent from [NC_Class] where classid = " & classid
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			Response.Write "Sorry!没有找到任何文章信息。或者您选择了错误的系统参数!"
			Exit Sub
		Else
			ClassName = Rs("ClassName")
			classid = Rs("classid")
			depth = Rs("depth")
			ParentID = Rs("ParentID")
			strParent = Rs("strParent")
		End If
		Rs.Close
		Dim temphtml, NowStats, HtmlTitle, ArticleIndex
		Dim TempTopStr, TempFootStr, Style_CSS
		If CInt(DownsysClass.Setting(5)) = 1 Then
		ArticleIndex = "<A HREF='" & DownsysClass.SetupDir & "Article_Index.Asp'>" & DownsysClass.TempSet(7) & "</A>→"
		Else
		ArticleIndex = "<A HREF='" & DownsysClass.SetupDir & "Article/Index.html'>" & DownsysClass.TempSet(7) & "</A>→"
		End If
		NowStats = ArticleIndex & NowStation(classid, ClassName, ParentID, strParent) & "→" & Topic
		HtmlTitle = Topic
		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(3)) = 0 Then
			TempFootStr = DownsysClass.mainhtml(4)
		Else
			TempFootStr = DownsysClass.temphtml(3)
		End If
		temphtml = TempTopStr & DownsysClass.temphtml(1) & DownsysClass.temphtml(3) & TempFootStr
		temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(9))
		temphtml = Replace(temphtml, "{$Width}", DownsysClass.mainset(0))
		temphtml = Replace(temphtml, "{$FootMeun}", DownsysClass.mainset(44))
		temphtml = Replace(temphtml, "{$NavMenu}", DownsysClass.ClassMenu)
		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, "{$ArticleID}", articleid)
		temphtml = Replace(temphtml, "{$Topic}", Topic)
		temphtml = Replace(temphtml, "{$Content}", Content)
		temphtml = Replace(temphtml, "{$InfoTime}", InfoTime)
		temphtml = Replace(temphtml, "{$AllHits}", AllHits)
		temphtml = Replace(temphtml, "{$Writer}", Writer)
		temphtml = Replace(temphtml, "{$Source}", Source)
		'temphtml = Replace(temphtml, "{$HotArticle}", GetHotArticle)
		temphtml = Replace(temphtml, "{$sousuo}", sousuo)
		temphtml = Replace(temphtml, "{$NewArticle}", NewArticle)
		temphtml = Replace(temphtml, "{$BestArticle}", BestArticle)
		temphtml = Replace(temphtml, "{$KeyArticle}", GetKeyArticle(Topic, articleid))
		temphtml = Replace(temphtml, "{$KeySoft}", GetKeySoftware(Topic))
		temphtml = Replace(temphtml, "{$FormerArticle}", FormerArticle(articleid))
		temphtml = Replace(temphtml, "{$NextArticle}", NextArticle(articleid))
		temphtml = Replace(temphtml, "{$Adcolumn(0)}", DownloadClass_Ads.RunScriptAds(6))
		temphtml = Replace(temphtml, "{$Adcolumn(1)}", DownloadClass_Ads.BannerAds(6))
		temphtml = Replace(temphtml, "{$Adcolumn(2)}", DownloadClass_Ads.AdsColumn(6, 2))
		temphtml = Replace(temphtml, "{$Adcolumn(3)}", DownloadClass_Ads.AdsColumn1(6, 3))
		temphtml = Replace(temphtml, "{$Adcolumn(6)}", DownloadClass_Ads.AdsColumn(6, 7))
		temphtml = Replace(temphtml, "{$Adcolumn(7)}", DownloadClass_Ads.AdsColumn(6, 8))
		temphtml = Replace(temphtml, "{$Adcolumn(4)}", DownloadClass_Ads.ScriptFloatAds(6))
		temphtml = Replace(temphtml, "{$Adcolumn(5)}", DownloadClass_Ads.ScriptFixedAds(6))
		HtmlTemplate = temphtml
		Set Rs = Nothing
		NewFolderPath = Server.MapPath(DownsysClass.SetupDir & "Article/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
		Set FSO = Server.CreateObject("ADODB.STREAM")
		CreateHtml = Server.MapPath(DownsysClass.SetupDir & "Article/Catalog" & ClassID & "/" & ArticleID & ".html")
		With FSO
			.Open
			.Charset = "GB2312"
			.WriteText HtmlTemplate
			.SaveToFile CreateHtml,2
			.Close
		End With
		Set FSO = Nothing
	End Sub
	'*************************************************************
	'函数作用:删除文章
	'*************************************************************
	Public Sub DelArticle(ArticleID)
		Dim FilePath
                Set Rs = Server.CreateObject("adodb.recordset")
		SQL = "select * from NC_Article where id = " & ArticleID
		Rs.Open SQL, Conn, 1, 1
		If Rs.bof And Rs.EOF Then
			Response.Write "<p align=center>还没有找到相关文章!</p>"
			Exit Sub
		Else
			ClassID = Rs("classid")
		End If
		Rs.Close
		Set Rs = Nothing
		If CInt(DownsysClass.Setting(5)) = 0 Then
			FilePath = Server.MapPath(DownsysClass.SetupDir & "Article/Catalog" & ClassID & "/" & ArticleID & ".html")
			Set FSO = Server.CreateObject(DownsysClass.Script_FSO)
			If FSO.FileExists(FilePath) Then
				FSO.DeleteFile FilePath
			End If
			Set FSO = Nothing
		End If
        End Sub
	'*************************************************************
	'函数作用:当前位置
	'*************************************************************
	Private Function NowStation(classid, ClassName, ParentID, strParent)
		Dim Rs, SQL, HtmlString
		Set Rs = Server.CreateObject("adodb.recordset")
		If ParentID <> 0 And Len(strParent) <> 0 Then
			SQL = "select classid,ClassName from [NC_Class] where classid in(" & strParent & ")"
			Rs.Open SQL, Conn, 1, 1
			If Not (Rs.EOF And Rs.bof) Then
				Do While Not Rs.EOF
					If CInt(DownsysClass.Setting(5)) = 0 Then
						HtmlString = HtmlString & "<a href='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(0) & "/Listing_indate_Desc_1.html'>" & Rs(1) & "</a>→"
					Else
						HtmlString = HtmlString & "<a href='" & DownsysClass.SetupDir & "Listing.Asp?classid=" & Rs(0) & "'>" & Rs(1) & "</a>→"
					End If
					Rs.movenext
				Loop
			End If
			Rs.Close
			Set Rs = Nothing
		End If

⌨️ 快捷键说明

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