create_softindexcls.asp
来自「多用户管理分权限发布、管理软件信息; 自由选择系统默认为静态HTML或动态A」· ASP 代码 · 共 594 行 · 第 1/2 页
ASP
594 行
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('" & Newasp.SetupDir & "message.asp?id=" & Rs("id") & "',500,400)"" title='" & Rs("title") & "'>" & Newasp.gotTopic(Rs("title"), CInt(Newasp.mainset(26))) & "</A>"
HtmlString = HtmlString & Newasp.mainset(27)
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
Dim AllSoft, DayUpdateSoft, AllDownNum, AllSoftSize
Dim AllArticle, DayUpdateArt, AllArticleHits, AllUserNum
Set Rs = Server.CreateObject("adodb.recordset")
SQL = "Select count(SoftID) from NC_SoftInfo"
Rs.Open SQL, Conn, 1, 1
AllSoft = Rs(0)
If IsNull(AllSoft) Then AllSoft = 0
Rs.Close
If isSqlDataBase = 1 Then
SQL = "Select count(SoftID) from NC_SoftInfo Where datediff(d,SoftTime,GetDate())=0"
Else
SQL = "Select count(SoftID) from NC_SoftInfo Where softTime>=Date()"
End If
Rs.Open SQL, Conn, 1, 1
DayUpdateSoft = Rs(0)
If IsNull(DayUpdateSoft) Then DayUpdateSoft = 0
Rs.Close
SQL = "Select sum(Hits) from NC_SoftInfo"
Rs.Open SQL, Conn, 1, 1
AllDownNum = Rs(0)
If IsNull(AllDownNum) Then AllDownNum = 0
Rs.Close
SQL = "Select sum(SoftSize) from NC_SoftInfo"
Rs.Open SQL, Conn, 1, 1
If Rs.bof And Rs.EOF Then
AllSoftSize = 0
Else
If IsNull(Rs(0)) Then
AllSoftSize = 0
Else
AllSoftSize = Round(Rs(0) / 1024 / 1024, 3)
End If
End If
Rs.Close
SQL = "Select count(ID) from NC_Article"
Rs.Open SQL, Conn, 1, 1
AllArticle = Rs(0)
If IsNull(AllArticle) Then AllArticle = 0
Rs.Close
If isSqlDataBase = 1 Then
SQL = "Select count(ID) from NC_Article Where datediff(d,infoTime,GetDate())=0"
Else
SQL = "Select count(ID) from NC_Article Where infoTime >= Date()"
End If
Rs.Open SQL, Conn, 1, 1
DayUpdateArt = Rs(0)
If IsNull(DayUpdateArt) Then DayUpdateArt = 0
Rs.Close
SQL = "Select sum(Hits) from NC_Article"
Rs.Open SQL, Conn, 1, 1
AllArticleHits = Rs(0)
If IsNull(AllArticleHits) Then AllArticleHits = 0
Rs.Close
SQL = "Select count(userid) from NC_User"
Rs.Open SQL, Conn, 1, 1
AllUserNum = Rs(0)
If IsNull(AllUserNum) Then AllUserNum = 0
Rs.Close
HtmlString = Newasp.mainset(12)
HtmlString = Replace(HtmlString, "{$AllSoft}", AllSoft)
HtmlString = Replace(HtmlString, "{$DayUpdateSoft}", DayUpdateSoft)
HtmlString = Replace(HtmlString, "{$AllDownNum}", AllDownNum)
HtmlString = Replace(HtmlString, "{$AllSoftSize}", AllSoftSize)
HtmlString = Replace(HtmlString, "{$AllArticle}", AllArticle)
HtmlString = Replace(HtmlString, "{$DayUpdateArt}", DayUpdateArt)
HtmlString = Replace(HtmlString, "{$AllArticleHits}", AllArticleHits)
HtmlString = Replace(HtmlString, "{$AllUserNum}", AllUserNum)
Set Rs = Nothing
Statistics = HtmlString
End Function
'*************************************************************
'函数作用:友情连接
'*************************************************************
Public Function FriendLink()
If CInt(Newasp.Setting(17)) = 1 Then
Dim Rs, SQL, i
Set Rs = Server.CreateObject("adodb.recordset")
FriendLink = FriendLink & "<table align=center width=98% >"
i = CInt(Newasp.TempSet(10))
SQL = "select Linkname,readme,lurl from NC_Link where islogo=0 and isLock=0 order by linkid"
Set Rs = Conn.Execute(SQL)
If Not Rs.EOF And Not Rs.bof Then
Do While Not Rs.EOF
If i > CInt(Newasp.TempSet(11)) Then
FriendLink = FriendLink & "<tr><td width=""13%"">"
i = 1
Else
FriendLink = FriendLink & "<td width=""13%"">"
End If
FriendLink = FriendLink & "<a href=" & Rs(2) & " target=_blank title=""" & Rs(1) & """>" & Rs(0) & "</a>"
Rs.movenext
FriendLink = FriendLink & "</td>"
If i = CInt(Newasp.TempSet(11)) Then FriendLink = FriendLink & "</tr>"
i = i + 1
Loop
End If
Rs.Close
i = CInt(Newasp.TempSet(10))
SQL = "select Linkname,readme,lurl,logo from NC_Link where islogo=1 and isLock=0 order by linkid"
Set Rs = Conn.Execute(SQL)
If Not Rs.EOF And Not Rs.bof Then
FriendLink = FriendLink & "<tr><td align=center colspan=8><hr align=center size=1 color=#CECECE></td></tr>"
Do While Not Rs.EOF
If i > CInt(Newasp.TempSet(11)) Then
FriendLink = FriendLink & "<tr><td width=""13%"">"
i = 1
Else
FriendLink = FriendLink & "<td width=""13%"">"
End If
FriendLink = FriendLink & "<a href=" & Rs(2) & " target=_blank><img src=""" & Rs(3) & """ border=0 alt=""" & Rs(0) & ":" & Rs(1) & """ height=31 width=88></a>"
Rs.movenext
FriendLink = FriendLink & "</td>"
If i = CInt(Newasp.TempSet(11)) Then FriendLink = FriendLink & "</tr>"
i = i + 1
Loop
End If
Rs.Close
Set Rs = Nothing
If IsNull(FriendLink) Or FriendLink = "" Then FriendLink = " "
FriendLink = FriendLink & "</table>"
End If
End Function
'*************************************************************
'函数作用:软件类型
'*************************************************************
Private Function CreateSoftType()
Dim Rs, SQL, SoftTime, Title, HtmlString, SoftName, SortName, i, TypeUrl, SoftDate
Set Rs = Server.CreateObject("adodb.recordset")
HtmlString = HtmlString & "<TABLE width=""100%"" cellSpacing=5 cellPadding=1 border=0>" & vbCrLf
HtmlString = HtmlString & " <TR vAlign=top>" & vbCrLf
Dim SoftType
SoftType = Split(Newasp.Setting(35), ",")
For i = 0 To UBound(SoftType)
HtmlString = HtmlString & " <TD vAlign=top width=""50%"">" & vbCrLf
SQL = "SELECT top " & CInt(Newasp.TempSet(5)) & " SoftID,sortid,SoftName,SoftVer,SortName,SoftType,SoftTime,Hits FROM NC_SoftInfo where SoftType='" & Trim(SoftType(i)) & "' order by SoftTime desc,SoftID desc"
Rs.Open SQL, Conn, 1, 1
HtmlString = HtmlString & Newasp.TempSet(7)
If CInt(Newasp.Setting(5)) = 0 Then
TypeUrl = Newasp.SetupDir & "Software/Latenew" & i & ".html"
Else
TypeUrl = Newasp.SetupDir & "Latenew.Asp?type=" & Trim(SoftType(i)) & ""
End If
HtmlString = Replace(HtmlString, "{$SoftTypeUrl}", TypeUrl)
HtmlString = Replace(HtmlString, "{$TypeName}", Trim(SoftType(i)))
If Rs.EOF And Rs.bof Then
HtmlString = HtmlString & "<p align=center>还没有任何软件!</p>"
Else
Do While Not Rs.EOF
HtmlString = HtmlString & Newasp.TempSet(8)
If Rs("SoftTime") >= Date Then
SoftTime = "<FONT color=red>" & Month(Rs("SoftTime")) & "/" & Day(Rs("SoftTime")) & "</FONT >"
SoftDate = "<FONT color=red>" & FormatDateTime(Rs("SoftTime"), 2) & "</FONT >"
Else
SoftTime = "<FONT color=#999999>" & Month(Rs("SoftTime")) & "/" & Day(Rs("SoftTime")) & "</FONT >"
SoftDate = "<FONT color=#999999>" & FormatDateTime(Rs("SoftTime"), 2) & "</FONT >"
End If
If CInt(Newasp.Setting(5)) = 0 Then
SoftName = "<A HREF='" & Newasp.SetupDir & "Software/Catalog" & Rs("sortid") & "/" & Rs("softid") & ".html' title='软件名称: " & Rs("SoftName") & Rs("SoftVer") & "<BR>更新时间: " & Rs("SoftTime") & "<BR>下载次数: " & Rs("Hits") & "' class='TableLink'>" & Newasp.gotTopic(Rs("SoftName") & Rs("SoftVer"), CInt(Newasp.TempSet(6))) & "</A>"
SortName = "<A HREF='" & Newasp.SetupDir & "Sorting/Catalog" & Rs("sortid") & "/Sorting_Indate_Desc_1.html' title='" & Rs("SortName") & "'>" & Rs("SortName") & "</A>"
Else
SoftName = "<A HREF='" & Newasp.SetupDir & "Software.asp?id=" & Rs("softid") & "' title='软件名称:" & Rs("SoftName") & Rs("SoftVer") & "<BR>更新时间: " & Rs("SoftTime") & "<BR>下载次数: " & Rs("Hits") & "' class='TableLink'>" & Newasp.gotTopic(Rs("SoftName") & Rs("SoftVer"), CInt(Newasp.TempSet(6))) & "</A>"
SortName = "<A HREF='" & Newasp.SetupDir & "Sorting.asp?sortid=" & Rs("sortid") & "' title='" & Rs("SoftName") & Rs("SoftVer") & "'>" & Rs("SortName") & "</A>"
End If
HtmlString = Replace(HtmlString, "{$SoftName}", SoftName)
HtmlString = Replace(HtmlString, "{$SortName}", SortName)
HtmlString = Replace(HtmlString, "{$SoftTime}", SoftTime)
HtmlString = Replace(HtmlString, "{$SoftDate}", SoftDate)
Rs.movenext
Loop
End If
HtmlString = HtmlString & Newasp.TempSet(9)
Rs.Close
HtmlString = HtmlString & "</TD>" & vbCrLf
If Newasp.TempSet(12) = "" Then
If (i Mod 2) = 1 Then HtmlString = HtmlString & "</tr><tr>"
Else
If (i Mod CInt(Newasp.TempSet(12))) = (CInt(Newasp.TempSet(12)) - 1) Then HtmlString = HtmlString & "</tr><tr>"
End If
Next
HtmlString = HtmlString & " </TR>" & vbCrLf
HtmlString = HtmlString & "</TABLE>" & vbCrLf
Set Rs = Nothing
CreateSoftType = HtmlString
End Function
'*************************************************************
'函数作用:图片推荐
'*************************************************************
Private Function SoftImage()
Dim Rs, SQL, HtmlString, SoftName, SoftImg, i
Set Rs = Server.CreateObject("adodb.recordset")
SQL = "select Top " & CInt(Newasp.TempSet(0)) & " softid,sortid,SoftName,SoftVer,SoftImg from NC_SoftInfo where isLock = 0 And SoftImg <>'' order by SoftTime desc, softid desc"
Rs.Open SQL, Conn, 1, 1
If Rs.bof And Rs.EOF Then
HtmlString = "<img src='" & Newasp.SetupDir & "images/NoPic.jpg' width='" & Newasp.TempSet(13) & "' height='" & Newasp.TempSet(14) & "' border='0'>"
Else
HtmlString = Newasp.TempSet(2)
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) & "'>" & Newasp.gotTopic(Rs(2) & Rs(3), CInt(Newasp.TempSet(1))) & "</A>"
SoftImg = "<A HREF='" & Newasp.SetupDir & "Software/Catalog" & Rs(1) & "/" & Rs(0) & ".html' title='" & Rs(2) & Rs(3) & "'><img src='http://imageso.xunlei.com/movie_pic/" &Rs(4) & "' width='" & Newasp.TempSet(13) & "' height='" & Newasp.TempSet(14) & "' border='0'></A>"
Else
SoftName = "<A HREF='" & Newasp.SetupDir & "Software.asp?id=" & Rs(0) & "' title='" & Rs(2) & Rs(3) & "'>" & Newasp.gotTopic(Rs(2) & Rs(3), CInt(Newasp.TempSet(1))) & "</A>"
SoftImg = "<A HREF='" & Newasp.SetupDir & "Software.asp?id=" & Rs(0) & "' title='" & Rs(2) & Rs(3) & "'><img src='http://imageso.xunlei.com/movie_pic/"& Rs(4) & "' width='" & Newasp.TempSet(13) & "' height='" & Newasp.TempSet(14) & "' border='0'></A>"
End If
HtmlString = HtmlString & Newasp.TempSet(3)
HtmlString = Replace(HtmlString, "{$SoftImage}", SoftImg)
HtmlString = Replace(HtmlString, "{$SoftName}", SoftName)
Rs.movenext
Loop
HtmlString = HtmlString & Newasp.TempSet(4)
End If
Rs.Close
Set Rs = Nothing
SoftImage = HtmlString
End Function
Private Function CreateHtmlFile()
Newasp.LoadTemplates ("index")
Dim NewCloud_Ads
Set NewCloud_Ads = New Adcolumn_Cls
Dim temphtml, NowStats, HtmlTitle
Dim TempTopStr, TempFootStr
NowStats = "首页"
HtmlTitle = "首页"
If Len(Newasp.temphtml(0)) < 50 Then
TempTopStr = Newasp.mainhtml(0) & Newasp.mainhtml(1) & Newasp.mainhtml(2) & Newasp.mainhtml(3)
Else
TempTopStr = Newasp.temphtml(0)
End If
If Len(Newasp.temphtml(5)) = 0 Then
TempFootStr = Newasp.mainhtml(4)
Else
TempFootStr = Newasp.temphtml(5)
End If
temphtml = TempTopStr & Newasp.temphtml(1) & Newasp.temphtml(2) & Newasp.temphtml(3) & Newasp.temphtml(4) & TempFootStr
temphtml = Replace(temphtml, "{$NavMenu}", Newasp.SortingMenu)
temphtml = Replace(temphtml, "{$Width}", Newasp.mainset(0))
If CInt(Newasp.Setting(5)) = 0 Then
temphtml = Replace(temphtml, "{$TopMeun}", Newasp.mainset(9))
Else
temphtml = Replace(temphtml, "{$TopMeun}", Newasp.mainset(10))
End If
temphtml = Replace(temphtml, "{$FootMeun}", Newasp.mainset(11))
temphtml = Replace(temphtml, "{$Style_CSS}", Newasp.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, "{$DayNewSoft}", DayNewSoft)
temphtml = Replace(temphtml, "{$CommendSoft}", CommendSoft)
temphtml = Replace(temphtml, "{$Message}", WebMessage(1))
temphtml = Replace(temphtml, "{$Statistic}", Statistics)
temphtml = Replace(temphtml, "{$SoftImage}", SoftImage)
temphtml = Replace(temphtml, "{$SoftType}", CreateSoftType)
temphtml = Replace(temphtml, "{$FriendLink}", FriendLink)
temphtml = Replace(temphtml, "{$Adcolumn(0)}", NewCloud_Ads.RunScriptAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(1)}", NewCloud_Ads.BannerAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(2)}", NewCloud_Ads.AdsColumn(1, 2))
temphtml = Replace(temphtml, "{$Adcolumn(3)}", NewCloud_Ads.AdsColumn(1, 3))
temphtml = Replace(temphtml, "{$Adcolumn(6)}", NewCloud_Ads.AdsColumn(1, 7))
temphtml = Replace(temphtml, "{$Adcolumn(4)}", NewCloud_Ads.ScriptFloatAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(5)}", NewCloud_Ads.ScriptFixedAds(1))
Set NewCloud_Ads = Nothing
CreateHtmlFile = temphtml
End Function
End Class
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?