📄 create_softindexcls.asp
字号:
HtmlTitle = "首页"
If Len(DownsysClass.temphtml(0)) < 50 Then
TempTopStr = DownsysClass.mainhtml(2)
Else
TempTopStr = DownsysClass.mainhtml(0) & DownsysClass.mainhtml(2)
End If
If Len(DownsysClass.temphtml(5)) = 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.SortingMenu)
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, "{$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, "{$Catalog}", CatalogInfo)
temphtml = Replace(temphtml, "{$hangye}", hangye)
temphtml = Replace(temphtml, "{$sousuo}", sousuo)
temphtml = Replace(temphtml, "{$HotPic}", SingleImage("Hits"))
temphtml = Replace(temphtml, "{$Adcolumn(0)}", DownloadClass_Ads.ScriptFixedAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(1)}", DownloadClass_Ads.tuijianAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(2)}", DownloadClass_Ads.BannerAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(3)}", DownloadClass_Ads.AdsColumn(1, 3))
temphtml = Replace(temphtml, "{$Adcolumn(6)}", DownloadClass_Ads.AdsColumn(1, 7))
temphtml = Replace(temphtml, "{$Adcolumn(4)}", DownloadClass_Ads.ScriptFloatAds(1))
temphtml = Replace(temphtml, "{$Adcolumn(5)}", DownloadClass_Ads.BannerAds(2))
Set DownloadClass_Ads = Nothing
CreateHtmlFile = temphtml
End Function
'******************************************************************************
'图片转换
Private Function SingleImage(orders)
Dim Rs, SQL, HtmlString, Topic, images, OrderName, ii, temphtml
ii=-1
Set Rs = Server.CreateObject("adodb.recordset")
If orders = "Hits" Then
OrderName = "Hits"
Else
OrderName = "InfoTime"
End If
SQL = "select Top 6 id,classid,title,images from NC_Article where isLock = 0 And images <>'' order by " & OrderName & " desc, id desc"
Rs.Open SQL, Conn, 1, 1
HtmlString = HtmlString & "<SCRIPT language=JavaScript>" & vbCrLf
HtmlString = HtmlString & "<!--" & vbCrLf
HtmlString = HtmlString & "var bannerAD=new Array();" & vbCrLf
HtmlString = HtmlString & "var bannerADlink=new Array();" & vbCrLf
HtmlString = HtmlString & "var adNum=0;" & vbCrLf
If Rs.bof And Rs.EOF Then
Else
Do While Not Rs.EOF
ii=ii+1
HtmlString = HtmlString & "bannerADlink[ "& ii &"]='" & DownsysClass.SetupDir & "Article/Catalog" & Rs("ClassID") &"/" & Rs("id") & ".html';" & vbCrLf
HtmlString = HtmlString & "bannerAD["& ii &"]='" & Rs("images") & "';" & vbCrLf
Rs.movenext
Loop
End If
HtmlString = HtmlString & "var preloadedimages=new Array();" & vbCrLf
HtmlString = HtmlString & " for (i=0;i<6;i++){" & vbCrLf
HtmlString = HtmlString & "preloadedimages[i]=new Image();" & vbCrLf
HtmlString = HtmlString & " preloadedimages[i].src=bannerAD[i];" & vbCrLf
HtmlString = HtmlString & " }" & vbCrLf
HtmlString = HtmlString & "function setTransition(){" & vbCrLf
HtmlString = HtmlString & " if (document.all){" & vbCrLf
HtmlString = HtmlString & " bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);" & vbCrLf
HtmlString = HtmlString & " bannerADrotator.filters.revealTrans.apply();" & vbCrLf
HtmlString = HtmlString & " }" & vbCrLf
HtmlString = HtmlString & "}" & vbCrLf
HtmlString = HtmlString & "function playTransition(){" & vbCrLf
HtmlString = HtmlString & " if (document.all)" & vbCrLf
HtmlString = HtmlString & " bannerADrotator.filters.revealTrans.play()" & vbCrLf
HtmlString = HtmlString & "}" & vbCrLf
HtmlString = HtmlString & "function nextAd(){" & vbCrLf
HtmlString = HtmlString & " if(adNum<bannerAD.length-1)adNum++ ;" & vbCrLf
HtmlString = HtmlString & " else adNum=0;" & vbCrLf
HtmlString = HtmlString & " setTransition();" & vbCrLf
HtmlString = HtmlString & " document.images.bannerADrotator.src=bannerAD[adNum];" & vbCrLf
HtmlString = HtmlString & " playTransition();" & vbCrLf
HtmlString = HtmlString & " theTimer=setTimeout(""nextAd()"", 6000);" & vbCrLf
HtmlString = HtmlString & "}" & vbCrLf
HtmlString = HtmlString & "function jump2url(){" & vbCrLf
HtmlString = HtmlString & " jumpUrl=bannerADlink[adNum];" & vbCrLf
HtmlString = HtmlString & " jumpTarget='_blank';" & vbCrLf
HtmlString = HtmlString & " if (jumpUrl != ''){" & vbCrLf
HtmlString = HtmlString & " if (jumpTarget != '')window.open(jumpUrl,jumpTarget);" & vbCrLf
HtmlString = HtmlString & " else location.href=jumpUrl;" & vbCrLf
HtmlString = HtmlString & " }" & vbCrLf
HtmlString = HtmlString & "}" & vbCrLf
HtmlString = HtmlString & "function displayStatusMsg() { " & vbCrLf
HtmlString = HtmlString & " status=bannerADlink[adNum];" & vbCrLf
HtmlString = HtmlString & " document.returnValue = true;" & vbCrLf
HtmlString = HtmlString & "}" & vbCrLf
HtmlString = HtmlString & "//-->" & vbCrLf
HtmlString = HtmlString & "</SCRIPT>" & vbCrLf
HtmlString = HtmlString & "<a onMouseOver=""displayStatusMsg();return document.returnValue"" href=""javascript:jump2url()"" onMouseDown=""return aliclick(this,'?info=topimg');""><img class=black-border style=""FILTER: revealTrans(duration=2,transition=20)"" height='155' src=""javascript:nextAd()"" width='288' border=0 name=bannerADrotator></a>" & vbCrLf
Rs.Close
Set Rs = Nothing
SingleImage = HtmlString
End Function
'*******************************************************
'搜索下拉框选择项目(整体分类部分:供应、求购)
Private Function sousuo()
Dim SoftType
Dim HtmlShowPage
Dim ii
HtmlShowPage = HtmlShowPage &" <select name=""action""> "
HtmlShowPage = HtmlShowPage &" <option value=""soft"" selected>全部信息</option>"
SoftType = Split(DownsysClass.Setting(35), ",")
For ii = 0 To UBound(SoftType)
HtmlShowPage = HtmlShowPage & "<option value=""soft"& ii &""">" & Trim(SoftType(ii)) & "</option>"
Next
HtmlShowPage = HtmlShowPage & "<option value=""info"">文章搜索</option></SELECT>"
sousuo = HtmlShowPage
End Function
'行业下拉框选择项目
Private Function hangye()
Dim rs2,sql2,HtmlShowPage
HtmlShowPage = HtmlShowPage &" <SELECT name=CategoryId id=""CategoryId""> "
HtmlShowPage = HtmlShowPage &" <OPTION value='0' selected>=选择行业=</OPTION>"
set rs2=server.createobject("adodb.recordset")
sql2="select * from NC_SoftSort where depth=0 order by sortid "
rs2.open sql2,conn,1,3
do while not rs2.EOF
HtmlShowPage = HtmlShowPage & "<option value='"& rs2("rootid") &"'>"& trim(rs2("SortName")) &"</option>"
rs2.MoveNext
loop
Rs2.Close
HtmlShowPage = HtmlShowPage & "</SELECT>"
hangye = HtmlShowPage
End Function
'*************************************************************
'函数作用:分类列表
'*************************************************************
Private Function CatalogInfo()
Dim Rs
Dim Rs_c
Dim HtmlString
Dim TotalNumber
Dim TotalNum
Dim i,m
Set Rs = CreateObject("adodb.recordset")
Set Rs_c = CreateObject("adodb.recordset")
HtmlString = HtmlString & "<TABLE width=""100%"" cellSpacing=0 cellPadding=0 border=0>" & vbCrLf
Rs.Open "select * from NC_softSort Where depth = 0 order by sortid asc", conn, 1, 1
If Not (Rs.bof And Rs.EOF) Then
Do While Not Rs.EOF
for m = 1 to 2
if not Rs.eof then
HtmlString = HtmlString & " <td><table><TR>" & vbCrLf
HtmlString = HtmlString & " <TD width=""50%"" class=paddlefthome>"
If CInt(DownsysClass.Setting(5)) = 0 Then
HtmlString = HtmlString & "<a href='" & DownsysClass.SetupDir & "Sorting0/Catalog" & Rs("sortid") & "/Sorting_Indate_Desc_1.html' title='" & Rs("readme") & "<BR>共有信息:" & Rs("SoftNum") & " 个'><b>" & Rs("sortName") & "</b></a> "
Else
HtmlString = HtmlString & "<a href='" & DownsysClass.SetupDir & "Sorting.Asp?sortid=" & Rs("sortid") & "' title='" & Rs("readme") & "<BR>共有信息:" & Rs("SoftNum") & " 个'>" & Rs("sortName") & "</a> "
End If
HtmlString = HtmlString & "</TD></tr><tr><TD width=""100%"" class=paddhome>" & vbCrLf
'二级目录循环开始
Rs_c.Open "select top 3 * from NC_softSort where depth = 1 and rootid=" & Rs("rootid") & " order by sortid asc", conn, 1, 1
If Rs_c.bof And Rs_c.EOF Then
HtmlString = HtmlString & "没有添加分类"
Else
TotalNumber = Rs_c.recordcount
i = 1
Do While Not Rs_c.EOF
If CInt(DownsysClass.Setting(5)) = 0 Then
HtmlString = HtmlString & "<a href='" & DownsysClass.SetupDir & "Sorting0/Catalog" & Rs_c("sortid") & "/Sorting_Indate_Desc_1.html' title='" & Rs_c("readme") & "<BR>共有信息:" & Rs_c("SoftNum") & " 个'>" & Rs_c("sortName") & "</a> " & vbCrLf
Else
HtmlString = HtmlString & "<a href='" & DownsysClass.SetupDir & "Sorting.Asp?sortid=" & Rs_c("sortid") & "' title='" & Rs_c("readme") & "<BR>共有信息:" & Rs_c("SoftNum") & " 个'>" & Rs_c("sortName") & "</a> " & vbCrLf
End If
If (i Mod CInt(DownsysClass.mainset(28))) = 0 And i <> TotalNumber Then
HtmlString = HtmlString & " <br></tr>"
End If
i = i + 1
Rs_c.movenext
Loop
End If
Rs_c.Close
'二级目录循环结束
HtmlString = HtmlString & " </TR></table>"
Rs.movenext
'分列排序,开始
else
HtmlString = HtmlString & " </TR>" & vbCrLf
HtmlString = HtmlString & " <td height=1></td>"
end if
next
HtmlString = HtmlString & " </TR>" & vbCrLf
HtmlString = HtmlString & " <tr><td height=1></td></tr><tr >"
Loop
End If
Rs.Close
Set Rs_c = Nothing
Set Rs = Nothing
CatalogInfo = HtmlString
End Function
Public Sub Init_IndexHtml()
Response.Buffer = True
Dim CreateHtml, FSO, Fout
Set NC_Admin = New Check
NC_Admin.AdminChk = "31"
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 & DownsysClass.Setting(6))
With FSO
.Open
.Charset = "GB2312"
.WriteText CreateHtmlFile
.SaveToFile CreateHtml,2
.Close
End With
Set FSO = Nothing
NC_Admin.Succeed_Msg ("生成供求信息首页成功!")
DownsysClass.admin_footer
End Sub
Public Sub IndexHtml()
Response.Buffer = True
If CInt(DownsysClass.Setting(5)) = 0 Then
Response.redirect (DownsysClass.SetupDir & DownsysClass.Setting(6))
Else
Response.Write CreateHtmlFile
End If
End Sub
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -