📄 create_articleindexcls.asp
字号:
<%
Class Create_ArticleIndex_Cls
Private ErrMsg
Private SucMsg
Private Founderr
Private NC_Admin, Rs, SQL
Private Sub Class_Initialize()
Founderr = False
Set Rs = Server.CreateObject("ADODB.Recordset")
DownsysClass.LoadTemplates ("infoindex")
End Sub
Private Sub Class_Terminate()
If IsObject(Conn) Then
Conn.Close
Set Conn = Nothing
End If
If IsObject(NC_Admin) Then
Set NC_Admin = Nothing
End If
End Sub
Public Sub Init_ArticleIndexHtml()
Response.Buffer = True
Dim CreateHtml, FSO, Fout
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
Set FSO = Server.CreateObject("ADODB.STREAM")
CreateHtml = Server.MapPath(DownsysClass.SetupDir & "Article/index.html")
With FSO
.Open
.Charset = "GB2312"
.WriteText GetArticleIndex
.SaveToFile CreateHtml,2
.Close
End With
Set FSO = Nothing
NC_Admin.Succeed_Msg ("生成文章首页成功!")
DownsysClass.admin_footer
End Sub
Public Sub ArticleIndexHtml()
If CInt(DownsysClass.Setting(5)) = 0 Then
Response.redirect (DownsysClass.SetupDir & "Article/index.html")
Else
Response.Write GetArticleIndex
End If
End Sub
Public Function GetArticleIndex()
Dim DownloadClass_Ads
Set DownloadClass_Ads = New Adcolumn_Cls
Dim temphtml, NowStats, HtmlTitle
Dim TempTopStr, TempFootStr
NowStats = "文章首页"
HtmlTitle = "文章首页"
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(4)
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))
If CInt(DownsysClass.Setting(5)) = 0 Then
temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(9))
Else
temphtml = Replace(temphtml, "{$TopMeun}", DownsysClass.mainset(10))
End If
If CInt(DownsysClass.Setting(5)) = 1 Then
temphtml = Replace(temphtml, "{$FootMeun}", DownsysClass.mainset(11))
Else
temphtml = Replace(temphtml, "{$FootMeun}", DownsysClass.mainset(44))
End If
temphtml = Replace(temphtml, "{$Style_CSS}", DownsysClass.Style_CSS)
temphtml = Replace(temphtml, "{$NowStats}", NowStats)
temphtml = Replace(temphtml, "{$Title}", HtmlTitle)
temphtml = Replace(temphtml, "{$NewArticle}", NewArticle)
temphtml = Replace(temphtml, "{$BestArticle}", BestArticle)
temphtml = Replace(temphtml, "{$Message}", WebMessage(2))
temphtml = Replace(temphtml, "{$Statistic}", Statistics)
temphtml = Replace(temphtml, "{$ArticleType}", CreateArticleType)
temphtml = Replace(temphtml, "{$NewPic}", SingleImage("InfoTime"))
temphtml = Replace(temphtml, "{$HotPic}", SingleImage("Hits"))
temphtml = Replace(temphtml, "{$ArticleImage}", ArticleImage)
temphtml = Replace(temphtml, "{$PicNews}", PictureNews)
temphtml = Replace(temphtml, "{$sousuo}", sousuo)
temphtml = Replace(temphtml, "{$Adcolumn(0)}", DownloadClass_Ads.RunScriptAds(4))
temphtml = Replace(temphtml, "{$Adcolumn(1)}", DownloadClass_Ads.BannerAds(4))
temphtml = Replace(temphtml, "{$Adcolumn(2)}", DownloadClass_Ads.AdsColumn(4, 2))
temphtml = Replace(temphtml, "{$Adcolumn(3)}", DownloadClass_Ads.AdsColumn(4, 3))
temphtml = Replace(temphtml, "{$Adcolumn(6)}", DownloadClass_Ads.AdsColumn(4, 7))
temphtml = Replace(temphtml, "{$Adcolumn(7)}", DownloadClass_Ads.AdsColumn(4, 8))
temphtml = Replace(temphtml, "{$Adcolumn(4)}", DownloadClass_Ads.ScriptFloatAds(4))
temphtml = Replace(temphtml, "{$Adcolumn(5)}", DownloadClass_Ads.ScriptFixedAds(4))
Set DownloadClass_Ads = Nothing
GetArticleIndex = temphtml
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(14)) & " 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
InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
End If
If CInt(DownsysClass.Setting(5)) = 0 Then
ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题:" & Rs(2) & "<BR>更新时间:" & Rs(4) & "<BR>浏览次数:" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.mainset(20))) & "</A>"
ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(1) & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
Else
ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题:" & Rs(2) & "<BR>更新时间:" & Rs(4) & "<BR>浏览次数:" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.mainset(20))) & "</A>"
ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.asp?classid=" & Rs(1) & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
End If
HtmlString = HtmlString & DownsysClass.mainset(21)
HtmlString = Replace(HtmlString, "{$ArticleTitle}", ArticleTitle)
HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
Rs.movenext
Loop
End If
Rs.Close
Set Rs = Nothing
NewArticle = HtmlString
End Function
'*************************************************************
'函数作用:推荐文章
'*************************************************************
Private Function BestArticle()
Dim Rs, SQL, HtmlString, ArticleTitle, ClassName, InfoTime, InfoDate
Set Rs = Server.CreateObject("adodb.recordset")
SQL = "select Top " & CInt(DownsysClass.TempSet(14)) & " id,classid,Title, ClassName,InfoTime,Hits,isTop from NC_Article where isLock = 0 And isCommend = 1 order by isTop 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 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
InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
End If
If CInt(DownsysClass.Setting(5)) = 1 Then
ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题:" & Rs(2) & "<BR>更新时间:" & Rs(4) & "<BR>浏览次数:" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(15))) & "</A>"
ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.asp?classid=" & Rs(1) & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
Else
ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题:" & Rs(2) & "<BR>更新时间:" & Rs(4) & "<BR>浏览次数:" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(15))) & "</A>"
ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(1) & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
End If
HtmlString = HtmlString & DownsysClass.TempSet(16)
HtmlString = Replace(HtmlString, "{$BestTopic}", ArticleTitle)
HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
Rs.movenext
Loop
End If
Rs.Close
Set Rs = Nothing
BestArticle = HtmlString
End Function
'*************************************************************
'函数作用:图文
'*************************************************************
Private Function PictureNews()
Dim Rs, SQL, HtmlString, ArticleTitle, ClassName, InfoTime, InfoDate
Set Rs = Server.CreateObject("adodb.recordset")
SQL = "select Top " & CInt(DownsysClass.TempSet(17)) & " id,classid,Title, ClassName,InfoTime,Hits from NC_Article where isLock = 0 And isImg = 1 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
InfoTime = "<FONT color=#999999>" & Month(Rs("InfoTime")) & "/" & Day(Rs("InfoTime")) & "</FONT >"
InfoDate = "<FONT color=#999999>" & FormatDateTime(Rs("InfoTime"), 2) & "</FONT >"
End If
If CInt(DownsysClass.Setting(5)) = 1 Then
ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article.asp?id=" & Rs(0) & "' title='文章标题:" & Rs(2) & "<BR>更新时间:" & Rs(4) & "<BR>浏览次数:" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(18))) & "</A>"
ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing.asp?classid=" & Rs(1) & "' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
Else
ArticleTitle = "<A HREF='" & DownsysClass.SetupDir & "Article/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='文章标题:" & Rs(2) & "<BR>更新时间:" & Rs(4) & "<BR>浏览次数:" & Rs(5) & "' class='TableLink'>" & DownsysClass.gotTopic(Rs(2), CInt(DownsysClass.TempSet(18))) & "</A>"
ClassName = "<A HREF='" & DownsysClass.SetupDir & "Listing/Catalog" & Rs(1) & "/Listing_Indate_Desc_1.html' title='" & Rs("ClassName") & "'>" & Rs("ClassName") & "</A>"
End If
HtmlString = HtmlString & DownsysClass.TempSet(19)
HtmlString = Replace(HtmlString, "{$Topic}", ArticleTitle)
HtmlString = Replace(HtmlString, "{$ClassName}", ClassName)
HtmlString = Replace(HtmlString, "{$InfoTime}", InfoTime)
HtmlString = Replace(HtmlString, "{$ArticleHits}", Rs("Hits"))
HtmlString = Replace(HtmlString, "{$InfoDate}", InfoDate)
Rs.movenext
Loop
End If
Rs.Close
Set Rs = Nothing
PictureNews = HtmlString
End Function
'*************************************************************
'函数作用:站内公告
'*************************************************************
Private Function WebMessage(statid)
Dim Rs, SQL, HtmlString, MsgTitle, PostTime
Set Rs = Server.CreateObject("adodb.recordset")
SQL = "select Top " & CInt(DownsysClass.TempSet(0)) & " * from NC_Message where statid in (0, " & statid & ") order by isTop desc, Postime 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("Postime") >= Date Then
PostTime = "<FONT color=red>" & FormatDateTime(Rs("Postime"), 2) & "</FONT >"
Else
PostTime = "<FONT color=#999999>" & FormatDateTime(Rs("Postime"), 2) & "</FONT >"
End If
MsgTitle = "<A HREF=""javascript:openScript('" & DownsysClass.SetupDir & "message.asp?id=" & Rs("id") & "',500,400)"" title='" & Rs("title") & "'>" & DownsysClass.gotTopic(Rs("title"), CInt(DownsysClass.TempSet(1))) & "</A>"
HtmlString = HtmlString & DownsysClass.TempSet(2)
HtmlString = Replace(HtmlString, "{$MsgTitle}", MsgTitle)
HtmlString = Replace(HtmlString, "{$PostTime}", PostTime)
Rs.movenext
Loop
End If
Rs.Close
Set Rs = Nothing
WebMessage = HtmlString
End Function
'*************************************************************
'函数作用:统计信息
'*************************************************************
Private Function Statistics()
Dim Rs, SQL, HtmlString
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -