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

📄 create_soft_list.asp

📁 动感系统XP Access版,服务器需要安装Jmail 组件 配置SendMessages.asp 最后部分的参数
💻 ASP
📖 第 1 页 / 共 2 页
字号:
'dim strTitle,strCateNav,strCateTop,strSoftList
strCateNav=soft_cate_nav(CatalogID)
strSoftList=""
strTitle=CatalogName
strNavigate=soft_nav(CatalogID,"列表","")
strCateTop="<script src=""../js/Catalog_MonthTop_"&CatalogID&".js""></script>"
if isDepth=0 then	
	sql= "select SoftID,SoftName,SoftVer,Content,LicenceType,[Language],SoftSize,System,Rank,AllHits,SoftTime,isCommend,isTop from "&CategoryName&"_SoftInfo Where RootID="&RootID&" order by isTop desc,"&strOrderName&" "&strBy1&""
else
	sql= "select SoftID,SoftName,SoftVer,Content,LicenceType,[Language],SoftSize,System,Rank,AllHits,SoftTime,isCommend,isTop from "&CategoryName&"_SoftInfo Where CatalogID="&CatalogID&" order by isTop desc,"&strOrderName&" "&strBy1&""
end if
'response.write sql
'response.end
rs.open sql,conn,1,1
if rs.eof and rs.bof then 
    strSoftList = strSoftList & "<table width=""100%"" border=0 cellpadding=4 cellspacing=1 bgcolor=""#CCCCCC"" id=""TbSoftList"">" & vbcrlf
    strSoftList = strSoftList & "        <tr align=""center"" bgcolor=""#F5F5F5""> " & vbcrlf
    strSoftList = strSoftList & "          <td width=""420""><a href=""Catalog_"&CatalogID&"_SoftName_"&strBy2&"_1.html"" title=""点击按软件名称排列顺序"">软件名称</A></td>" & vbcrlf
    strSoftList = strSoftList & "          <td nowrap><a href=""Catalog_"&CatalogID&"_SoftTime_"&strBy2&"_1.html"" title=""点击按整理日期排列顺序"">整理日期</A></td>" & vbcrlf
    strSoftList = strSoftList & "          <td nowrap><a href=""Catalog_"&CatalogID&"_SoftSize_"&strBy2&"_1.html"" title=""点击按软件大小排列顺序"">软件大小</A></td>" & vbcrlf
    strSoftList = strSoftList & "          <td nowrap><a href=""Catalog_"&CatalogID&"_AllHits_"&strBy2&"_1.html"" title=""点击按下载次数排列顺序"">人气</A></td>" & vbcrlf
    strSoftList = strSoftList & "          <td nowrap><a href=""Catalog_"&CatalogID&"_Rank_"&strBy2&"_1.html"" title=""点击按软件等级排列顺序"">软件等级</A></td>" & vbcrlf
    strSoftList = strSoftList & "        </tr>" & vbcrlf
    strSoftList = strSoftList & "        <tr> " & vbcrlf
    strSoftList = strSoftList & "          <td colspan=""5"" nowrap bgcolor=""#FFFFFF"">Sorry!本类没有任何软件! </td>" & vbcrlf
    strSoftList = strSoftList & "        </tr>" & vbcrlf
    strSoftList = strSoftList & "      </table>" & vbcrlf
		
    HtmlContent=HtmlTemplate
    HtmlContent=replace(HtmlContent,"$Title$",""&strTitle&"")
	HtmlContent=replace(HtmlContent,"$Navigate$",""&strNavigate&"")
    HtmlContent=replace(HtmlContent,"$CateNav$",""&strCateNav&"")
    HtmlContent=replace(HtmlContent,"$CateTop$",""&strCateTop&"")
    HtmlContent=replace(HtmlContent,"$SoftList$",""&strSoftList&"")
    HtmlContent=replace(HtmlContent,"</HEAD>","</HEAD>"&Copyright&"")

    HtmlFileName=Server.MapPath("SoftList/Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_1.html")
    Set fout = fso.CreateTextFile(HtmlFileName)
    fout.WriteLine HtmlContent 
    fout.close:set fout = nothing 
else
'MaxPerPage,totalPut,CurrentPage,TotalPages
    totalPut=rs.recordcount  '软件数
	        if (totalPut mod MaxPerPage)=0 then 
	     			tempPcount= totalPut \ MaxPerPage 
	   		else 
	      			tempPcount= totalPut \ MaxPerPage + 1 
	   		end if 
	
		for CurrentPage=1 to tempPcount
		
		    if (totalPut mod MaxPerPage)=0 then 
	     			Pcount= totalPut \ MaxPerPage 
	   		else 
	      			Pcount= totalPut \ MaxPerPage + 1 
	   		end if 
			
		'rs.AbsolutePage=CurrentPage
	
		
listContent=""
listContent = listContent & "<table width=""100%"" border=0 cellpadding=4 cellspacing=1 bgcolor=""#CCCCCC"" id=""TbSoftList"">" & vbcrlf
listContent = listContent & "        <tr align=""center"" bgcolor=""#F5F5F5""> " & vbcrlf
listContent = listContent & "          <td width=""420""><a href=""Catalog_"&CatalogID&"_SoftName_"&strBy2&"_1.html"" title=""点击按软件名称排列顺序"">软件名称</A></td>" & vbcrlf
listContent = listContent & "          <td nowrap><a href=""Catalog_"&CatalogID&"_SoftTime_"&strBy2&"_1.html"" title=""点击按整理日期排列顺序"">整理日期</A></td>" & vbcrlf
listContent = listContent & "          <td nowrap><a href=""Catalog_"&CatalogID&"_SoftSize_"&strBy2&"_1.html"" title=""点击按软件大小排列顺序"">软件大小</A></td>" & vbcrlf
listContent = listContent & "          <td nowrap><a href=""Catalog_"&CatalogID&"_AllHits_"&strBy2&"_1.html"" title=""点击按下载次数排列顺序"">人气</A></td>" & vbcrlf
listContent = listContent & "          <td nowrap><a href=""Catalog_"&CatalogID&"_Rank_"&strBy2&"_1.html"" title=""点击按软件等级排列顺序"">软件等级</A></td>" & vbcrlf
listContent = listContent & "        </tr>" & vbcrlf
listContent = listContent & "        <tr bgcolor=""#FFFFFF""> " & vbcrlf
listContent = listContent & "          <td colspan=""5"" align=""center"">$showPage$</td>" & vbcrlf
listContent = listContent & "        </tr>" & vbcrlf
    RS.MoveFirst
	if currentpage > Pcount then currentpage = Pcount
   	if currentpage<1 then currentpage=1
	RS.Move (currentpage-1) * MaxPerPage
	page_count=0	
	do while not rs.eof and page_count < Clng(MaxPerPage)
			
listContent = listContent & "        <tr bgcolor=""#FFFFFF""> " & vbcrlf
listContent = listContent & "          <td width=""420"">"
if rs("isTop") then
	listContent = listContent & "<img src=""../images/isTop.gif"" align=""absmiddle"">"
elseif rs("isCommend") then
	listContent = listContent & "<img src=""../images/isHot.gif"" align=""absmiddle"">"
else
	listContent = listContent & "<img src=""../images/isList.gif"" align=""absmiddle"">"
end if
listContent = listContent & " <a href=""../SoftView/SoftView_"&rs("SoftID")&".html""><b>"&rs("SoftName")&" "&rs("SoftVer")&"</b></a></td>" & vbcrlf
listContent = listContent & "          <td align=""center"" nowrap>"&FormatDateTime(rs("SoftTime"),2)&"</td>" & vbcrlf
listContent = listContent & "          <td align=""center"" nowrap>" 
if rs("SoftSize")>1024 then 
	listContent = listContent & (round(rs("SoftSize")/1024,2)&" MB")
else
	listContent = listContent & (rs("SoftSize")&" KB") 
end if
listContent = listContent & "</td>"& vbcrlf
listContent = listContent & "          <td align=""center"" nowrap>"&rs("AllHits")&"</td>" & vbcrlf
listContent = listContent & "          <td align=""center"" nowrap><img src=""../images/"&trim(rs("Rank"))&"star.gif"">"
listContent = listContent & "</td>" & vbcrlf
listContent = listContent & "        </tr>" & vbcrlf
listContent = listContent & "        <tr bgcolor=""#FFFFFF"">" & vbcrlf
listContent = listContent & "          <td colspan=""5"">·"
	if rs("isCommend") then
		listContent = listContent & "<font color=""#CC3300"">"& left(trim(rs("Content")),118)&"...</font>"
	else
		listContent = listContent & left(trim(rs("Content")),118)&"..."
	end if
listContent = listContent & " </td>" & vbcrlf
listContent = listContent & "        </tr>" & vbcrlf
listContent = listContent & "        <tr bgcolor=""#FFFFFF""> " & vbcrlf
listContent = listContent & "          <td colspan=""5""><font color=""#009900"">语言界面:</font>"&rs("Language")&" <font color=""#009900"">授权方式:</font>"&rs("LicenceType")&" <font color=""#009900"">运行平台:</font>"&rs("system")&"</td>" & vbcrlf
listContent = listContent & "        </tr>" & vbcrlf
  page_count=page_count+1
		rs.movenext
	loop
'end if
listContent = listContent & "        <tr bgcolor=""#F5F5F5""> " & vbcrlf
listContent = listContent & "          <td colspan=""5"" align=""center"">$showPage$</td>" & vbcrlf
listContent = listContent & "        </tr>" & vbcrlf
listContent = listContent & "</table>" & vbcrlf
			
         strSoftList=replace(listContent,"$showPage$",""&showPage(CatalogID,CatalogName,strOrderName,strBy1,totalput,MaxPerPage)&"") 

			
    HtmlContent=HtmlTemplate
    HtmlContent=replace(HtmlContent,"$Title$",""&strTitle&"")
	HtmlContent=replace(HtmlContent,"$Navigate$",""&strNavigate&"")
    HtmlContent=replace(HtmlContent,"$CateNav$",""&strCateNav&"")
    HtmlContent=replace(HtmlContent,"$CateTop$",""&strCateTop&"")
    HtmlContent=replace(HtmlContent,"$SoftList$",""&strSoftList&"")
	HtmlContent=replace(HtmlContent,"$CatalogID$",""&CatalogID&"")
    HtmlContent=replace(HtmlContent,"</HEAD>","</HEAD>"&Copyright&"")

    HtmlFileName=Server.MapPath("SoftList/Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_"&currentPage&".html")
    Set fout = fso.CreateTextFile(HtmlFileName)
    fout.WriteLine HtmlContent 
    fout.close:set fout = nothing 
					
		next 
end if
rs.close

Create_SoftList_Cate="分类名称:"&CatalogName&" 按条件:order by "&strOrderName&" "&strBy1&" 成功创建列表网页。<br>"& vbcrlf
end function

function showPage(CatalogID,CatalogName,strOrderName,strBy1,TotalNumber,MaxPerPage)
showPage=""
  	if totalnumber mod maxperpage=0 then
     		n= totalnumber \ maxperpage
  	else
     		n= totalnumber \ maxperpage+1
  	end if
  	showPage=showPage & "<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
	showPage=showPage & "<tr><td>[<font color=""red"">"&CatalogName&"</font>] "
	
  	if CurrentPage<2 then
    	showPage=showPage &" 合计<font color=""red""><b>"&totalnumber&"</b></font>个 | 首页 上一页"
  	else
    	showPage=showPage &" 合计<font color=""red""><b>"&totalnumber&"</b></font>个 | <a href=""Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_1.html"">首页</a>"
    	showPage=showPage &" <a href=""Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_"&CurrentPage-1&".html"">上一页</a>"
  	end if

  	if n-currentpage<1 then
    	showPage=showPage &" 下一页 尾页"
  	else
    	showPage=showPage &" <a href=""Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_"&(CurrentPage+1)&".html"">"
    	showPage=showPage &" 下一页</a> <a href=""Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_"&n&".html"">尾页</a>"
  	end if
   	showPage=showPage &" 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    showPage=showPage &"<b>"&maxperpage&"</b>个/页</td>"
	showPage=showPage &"<form action="""" method=post onChange=""submit()""><td>Go:<select name=""select"" onChange='javascript:window.open(this.options[this.selectedIndex].value,""_top"")'>"
	for intPage=1 to n
	showPage=showPage &"<option value=""Catalog_"&CatalogID&"_"&strOrderName&"_"&strBy1&"_"&intPage&".html"""
	if intPage=CurrentPage then showPage=showPage &" selected"
	showPage=showPage &">第"&intPage&"页</option>"
	next
	showPage=showPage &"</select></td></FORM></tr></table>"
end function
%>
    </td>
  </tr>
</table>
<!-- #include file="admin_footer.asp" -->
</BODY></HTML>
<% CloseDatabase %>

⌨️ 快捷键说明

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