📄 softchannel.asp
字号:
If InStr(HtmlContent, "{$FrontSoft}") > 0 Then
HtmlContent = Replace(HtmlContent, "{$FrontSoft}", FrontSoft(softid))
End If
If InStr(HtmlContent, "{$NextSoft}") > 0 Then
HtmlContent = Replace(HtmlContent, "{$NextSoft}", NextSoft(softid))
End If
If InStr(HtmlContent, "{$RelatedSoft}") > 0 Then
HtmlContent = Replace(HtmlContent, "{$RelatedSoft}", RelatedSoft(Rs("Related"), Rs("SoftName"), Rs("SoftID")))
End If
If InStr(HtmlContent, "{$ShowHotSoft}") > 0 Then
HtmlContent = Replace(HtmlContent, "{$ShowHotSoft}", ShowHotSoft(Rs("ClassID")))
End If
If InStr(HtmlContent, "{$SoftComment}") > 0 Then
HtmlContent = Replace(HtmlContent, "{$SoftComment}", SoftComment(Rs("SoftID")))
End If
HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", ChannelRootDir)
HtmlContent = Replace(HtmlContent, "{$InstallDir}", strInstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", ChannelID)
HtmlContent = Replace(HtmlContent, "{$SoftIndex}", strIndexName)
HtmlContent = Replace(HtmlContent, "{$ModuleName}", Newasp.ModuleName)
HtmlContent = Replace(HtmlContent, "{$PageTitle}", Trim(Rs("SoftName") & " " & Rs("SoftVer")))
HtmlContent = Replace(HtmlContent, "{$ClassID}", Rs("ClassID"))
HtmlContent = Replace(HtmlContent, "{$SoftID}", softid)
HtmlContent = HTML.ReadCurrentStation(HtmlContent, ChannelID, Rs("ClassID"), Rs("ClassName"), Rs("ParentID"), Rs("ParentStr"), Rs("HtmlFileDir"))
HtmlContent = HTML.ReadAnnounceContent(HtmlContent, ChannelID)
HtmlContent = ReadClassMenubar(HtmlContent)
HtmlContent = ReadClassMenu(HtmlContent)
HtmlContent = Replace(HtmlContent, "{$Classify}", Trim(HTML.CurrentClass))
HtmlContent = Replace(HtmlContent, "{$CurrentClass}", HTML.CurrentClass)
HtmlContent = HTML.ReadSoftPic(HtmlContent)
HtmlContent = HTML.ReadSoftList(HtmlContent)
HtmlContent = HTML.ReadPopularSoft(HtmlContent)
HtmlContent = Replace(HtmlContent, "{$SkinPath}", Newasp.SkinPath)
HtmlContent = Replace(HtmlContent, "{$InstallDir}", strInstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", ChannelID)
If CreateHtml <> 0 Then
Call CreateSoftIntro
Else
ReadSoftIntro = HtmlContent
End If
Rs.Close: Set Rs = Nothing
End Function
'=================================================
'函数名:CreateSoftIntro
'作 用:生成软件内容
'参 数:SoftID ----软件ID
'=================================================
Private Sub CreateSoftIntro()
Dim HtmlFileName
HtmlFilePath = ShowChannelPath(Newasp.InstallDir & Newasp.ChannelDir,Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.HtmlPath)
Newasp.CreatPathEx (HtmlFilePath)
HtmlFileName = HtmlFilePath & Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("SoftID"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, CurrentPage)
Newasp.CreatedTextFile HtmlFileName, HtmlContent
If IsShowFlush = 1 Then Response.Write "<li style=""font-size: 12px;"">生成" & Newasp.ModuleName & "信息HTML完成... <a href=" & HtmlFileName & " target=_blank>" & Server.MapPath(HtmlFileName) & "</a></li>" & vbNewLine
Response.Flush
End Sub
'================================================
'函数名:ShowDownAddress
'作 用:显示软件下载地址
'参 数:SoftID ----软件ID
'================================================
Private Function ShowDownAddress(softid)
Dim rsAddress, sqlAddress, rsDown
Dim SoftNameStr,DownloadName, DownloadPath
Dim DownAddress,strDownAddress,showdown,DownText
showdown = Newasp.ChkNumeric(Newasp.HtmlSetting(28))
'On Error Resume Next
If Newasp.ChkNumeric(Newasp.HtmlSetting(26)) = 0 Then
Set rsDown = Newasp.Execute("SELECT id,downid,DownFileName,DownText FROM [NC_DownAddress] WHERE softid=" & CLng(softid))
If Not (rsDown.BOF And rsDown.EOF) Then
Do While Not rsDown.EOF
DownText = rsDown("DownText") & ""
If Len(DownText) = 0 Then DownText = "立即下载"
'---- 如果使用了下载服务器,就打开下载服务器数据表
If rsDown("downid") > 0 Then
sqlAddress = "SELECT downid,DownloadName,DownloadPath,IsDisp,UserGroup,DownPoint FROM NC_DownServer WHERE ChannelID=" & ChannelID & " And depth=1 And rootid =" & rsDown("downid") & " And isLock=0 ORDER BY orders ASC"
Set rsAddress = Newasp.Execute(sqlAddress)
If Not(rsAddress.EOF And rsAddress.BOF) Then
Do While Not rsAddress.EOF
DownAddress = DownAddress & Newasp.HtmlSetting(21)
'---- 是否直接显示软件直接的下载地址
If rsAddress("IsDisp") = 0 Then
DownloadPath = ChannelRootDir & "download.asp?softid=" & softid & "&downid=" & rsAddress("downid") & "&id=" & rsDown(0)
Else
DownloadPath = rsAddress("DownloadPath") & rsDown(2)
End If
If rsAddress("UserGroup") > 0 Then
DownloadName = Replace(rsAddress("DownLoadName"), "{$DownPoint}", rsAddress("DownPoint"))
Else
DownloadName = Replace(rsAddress("DownLoadName"), "{$DownPoint}", 0)
End If
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", DownloadPath)
DownAddress = Replace(DownAddress, "{$DownLoadName}", DownloadName)
rsAddress.MoveNext
Loop
End If
Set rsAddress = Nothing
Else
DownAddress = DownAddress & Newasp.HtmlSetting(21)
If showdown > 0 Then
DownloadPath = Trim(rsDown("DownFileName") & "")
Else
DownloadPath = ChannelRootDir & "download.asp?softid=" & softid & "&downid=0&id=" & rsDown(0)
End If
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", DownloadPath)
DownAddress = Replace(DownAddress, "{$DownLoadName}", DownText)
End If
rsDown.MoveNext
Loop
End If
Set rsDown = Nothing
Else
SoftNameStr = Rs("SoftName") & " " & Rs("SoftVer")
strDownAddress = ChannelRootDir & "softdown.asp?softid=" & softid
DownAddress = Newasp.HtmlSetting(27)
DownAddress = Replace(DownAddress, "{$ChannelRootDir}", ChannelRootDir)
DownAddress = Replace(DownAddress, "{$InstallDir}", Newasp.InstallDir)
DownAddress = Replace(DownAddress, "{$SoftName}", SoftNameStr)
DownAddress = Replace(DownAddress, "{$SoftID}", softid)
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", strDownAddress)
End If
If Newasp.CheckNull(DownAddress) Then
ShowDownAddress = DownAddress
Else
ShowDownAddress = Newasp.HtmlSetting(22)
End If
End Function
'=================================================
'函数名:FrontSoft
'作 用:显示上一软件
'参 数:SoftID ----软件ID
'=================================================
Private Function FrontSoft(softid)
Dim rsContext, SQL, HtmlFileUrl, HtmlFileName
SQL = "SELECT TOP 1 A.SoftID,A.ClassID,A.SoftName,A.SoftVer,A.HtmlFileDate,C.HtmlFileDir,C.UseHtml FROM [NC_SoftList] A INNER JOIN [NC_Classify] C ON A.ClassID=C.ClassID WHERE A.ChannelID=" & ChannelID & " And A.isAccept > 0 And A.SoftID < " & softid & " ORDER BY A.SoftID DESC"
Set rsContext = Newasp.Execute(SQL)
If rsContext.EOF And rsContext.BOF Then
FrontSoft = "已经没有了"
Else
If CreateHtml <> 0 Then
HtmlFileUrl = ShowChannelPath(ChannelRootDir,rsContext("HtmlFileDir")) & Newasp.ShowDatePath(rsContext("HtmlFileDate"), Newasp.HtmlPath)
HtmlFileName = Newasp.ReadFileName(rsContext("HtmlFileDate"), rsContext("SoftID"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, "")
FrontSoft = "<a href=" & HtmlFileUrl & HtmlFileName & ">" & rsContext("SoftName") & " " & rsContext("SoftVer") & "</a>"
Else
FrontSoft = "<a href=?id=" & rsContext("SoftID") & ">" & rsContext("SoftName") & " " & rsContext("SoftVer") & "</a>"
End If
End If
rsContext.Close
Set rsContext = Nothing
End Function
'=================================================
'函数名:NextSoft
'作 用:显示下一软件
'参 数:SoftID ----软件ID
'=================================================
Private Function NextSoft(softid)
Dim rsContext, SQL, HtmlFileUrl, HtmlFileName
SQL = "SELECT TOP 1 A.SoftID,A.ClassID,A.SoftName,A.SoftVer,A.HtmlFileDate,C.HtmlFileDir,C.UseHtml from [NC_SoftList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID WHERE A.ChannelID=" & ChannelID & " And A.isAccept > 0 And A.SoftID > " & softid & " ORDER BY A.SoftID ASC"
Set rsContext = Newasp.Execute(SQL)
If rsContext.EOF And rsContext.BOF Then
NextSoft = "已经没有了"
Else
If CreateHtml <> 0 Then
HtmlFileUrl = ShowChannelPath(ChannelRootDir,rsContext("HtmlFileDir")) & Newasp.ShowDatePath(rsContext("HtmlFileDate"), Newasp.HtmlPath)
HtmlFileName = Newasp.ReadFileName(rsContext("HtmlFileDate"), rsContext("SoftID"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, "")
NextSoft = "<a href=" & HtmlFileUrl & HtmlFileName & ">" & rsContext("SoftName") & " " & rsContext("SoftVer") & "</a>"
Else
NextSoft = "<a href=?id=" & rsContext("SoftID") & ">" & rsContext("SoftName") & " " & rsContext("SoftVer") & "</a>"
End If
End If
rsContext.Close
Set rsContext = Nothing
End Function
Private Function ReadPagination(n)
Dim HtmlFileName, CurrentPage
CurrentPage = n
HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("SoftID"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, CurrentPage)
ReadPagination = HtmlFileName
End Function
'=================================================
'函数名:RelatedSoft
'作 用:显示相关软件
'参 数:sRelated ----相关软件
'=================================================
Private Function RelatedSoft(sRelated, topic, softid)
Dim rsRdlated, SQL, HtmlFileUrl, HtmlFileName
Dim strSoftName, softname, strContent
Dim strRelated, arrRelated, i, Resize, strRearrange
Dim strKey
Dim ArrayTemp()
On Error Resume Next
strRelated = Replace(Replace(Replace(Replace(Replace(Replace(sRelated, "[", ""), "]", ""), "'", ""), "%", ""), "《", ""), "》", "")
strKey = Left(Newasp.ChkQueryStr(topic), 2)
If Not IsNull(sRelated) And sRelated <> Empty Then
If InStr(strRelated, "|") > 1 Then
arrRelated = Split(strRelated, "|")
strRelated = "((A.SoftName like '%" & arrRelated(0) & "%')"
For i = 1 To UBound(arrRelated)
strRelated = strRelated & " Or (A.SoftName like '%" & arrRelated(i) & "%')"
Next
'strRelated = strRelated & ")"
Else
strRelated = "((A.SoftName like '%" & strRelated & "%')"
End If
strRelated = strRelated & " Or (A.SoftName like '%" & strKey & "%'))"
Else
strRelated = "(A.SoftName like '%" & strKey & "%')"
End If
SQL = "SELECT Top " & CInt(Newasp.HtmlSetting(1)) & " A.SoftID,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,C.HtmlFileDir,C.UseHtml FROM [NC_SoftList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID where A.ChannelID=" & ChannelID & " And A.isAccept > 0 And A.SoftID <> " & softid & " And " & strRelated & " ORDER BY A.SoftID DESC"
Set rsRdlated = Newasp.Execute(SQL)
If rsRdlated.EOF And rsRdlated.BOF Then
RelatedSoft = ""
Set rsRdlated = Nothing
Exit Function
Else
i = 0
Resize = 0
Do While Not rsRdlated.EOF
ReDim Preserve ArrayTemp(i + Resize)
strContent = ArrayTemp(i) & Newasp.HtmlSetting(4)
strSoftName = rsRdlated("SoftName") & " " & rsRdlated("SoftVer")
strSoftName = Newasp.GotTopic(strSoftName, CInt(Newasp.HtmlSetting(2)))
strSoftName = Newasp.ReadFontMode(strSoftName, rsRdlated("ColorMode"), rsRdlated("FontMode"))
If CreateHtml <> 0 Then
HtmlFileUrl = ShowChannelPath(ChannelRootDir,rsRdlated("HtmlFileDir")) & Newasp.ShowDatePath(rsRdlated("HtmlFileDate"), Newasp.HtmlPath)
HtmlFileName = Newasp.ReadFileName(rsRdlated("HtmlFileDate"), rsRdlated("SoftID"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, "")
softname = "<a href=" & HtmlFileUrl & HtmlFileName & " title='" & rsRdlated("SoftName") & rsRdlated("SoftVer") & "'>" & strSoftName & "</a>"
Else
softname = "<a href=show.asp?id=" & rsRdlated("SoftID") & " title='" & rsRdlated("SoftName") & rsRdlated("SoftVer") & "'>" & strSoftName & "</a>"
End If
strContent = Replace(strContent, "{$SoftName}", softname)
strContent = Replace(strContent, "{$AllHits}", rsRdlated("AllHits"))
strContent = Replace(strContent, "{$WriteTime}", Newasp.ShowDateTime(rsRdlated("SoftTime"), CInt(Newasp.HtmlSetting(3))))
strContent = Replace(strContent, "{$DateTime}", Newasp.ShowDateTime(rsRdlated("SoftTime"), CInt(Newasp.HtmlSetting(3))))
ArrayTemp(i) = strContent
rsRdlated.MoveNext
i = i + 1
Loop
End If
rsRdlated.Close
Set rsRdlated = Nothing
strRearrange = Join(ArrayTemp, vbCrLf)
RelatedSoft = strRearrange
End Function
'=================================================
'函数名:ShowHotSoft
'作 用:显示热门软件
'参 数:ClassID ----软件分类ID
'=================================================
Private Function ShowHotSoft(ClassID)
Dim rsHot, SQL, HtmlFileUrl, HtmlFileName
Dim strSoftName, softname, strContent
Dim i, Resize, strRearrange
Dim ArrayTemp()
On Error Resume Next
SQL = "SELECT Top " & CInt(Newasp.HtmlSetting(1)) & " A.SoftID,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,C.HtmlFileDir,C.UseHtml FROM [NC_SoftList] A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID WHERE A.ChannelID=" & ChannelID & " And A.isAccept > 0 And A.AllHits >= " & CLng(Newasp.LeastHotHist) & " And A.ClassID in (" & Rs("ChildStr") & ") ORDER BY A.AllHits DESC,A.SoftID DESC"
Set rsHot = Newasp.Execute(SQL)
If rsHot.EOF And rsHot.BOF Then
ShowHotSoft = ""
Set rsHot = Nothing
Exit Function
Else
i = 0
Resize = 0
Do While Not rsHot.EOF
ReDim Preserve ArrayTemp(i + Resize)
strContent = ArrayTemp(i) & Newasp.HtmlSetting(4)
strSoftName = rsHot("SoftName") & " " & rsHot("SoftVer")
strSoftName = Newasp.GotTopic(rsHot("SoftName"), CInt(Newasp.HtmlSetting(2)))
strSoftName = Newasp.ReadFontMode(strSoftName, rsHot("ColorMode"), rsHot("FontMode"))
If CreateHtml <> 0 Then
HtmlFileUrl = ShowChannelPath(ChannelRootDir,rsHot("HtmlFileDir")) & Newasp.ShowDatePath(rsHot("HtmlFileDate"), Newasp.HtmlPath)
HtmlFileName = Newasp.ReadFileName(rsHot("HtmlFileDate"), rsHot("SoftID"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, "")
softname = "<a href=" & HtmlFileUrl & HtmlFileName & " title='" & rsHot("SoftName") & "'>" & strSoftName & "</a>"
Else
softname = "<a href=show.asp?id=" & rsHot("SoftID") & " title='" & rsHot("SoftName") & "'>" & strSoftName & "</a>"
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -