downlist.asp

来自「生成html的ASP企业站点,可以进行二次开发的」· ASP 代码 · 共 322 行

ASP
322
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/NoHackSql.Asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<%
call SiteInfo
if ISHTML = 1 then
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
End If
if request.QueryString("SortID")="" then
SeoTitle="Download Center"
elseif not IsNumeric(request.QueryString("SortID")) then
SeoTitle="Parameter error"
elseif conn.execute("select * from LiangJingCMS_DownSort Where ViewFlag"&Language&" and  ID="&request.QueryString("SortID")).eof then
SeoTitle="Parameter error"
else
set rs = server.createobject("adodb.recordset")
sql="select * from LiangJingCMS_DownSort where ViewFlag"&Language&" and ID="&request.QueryString("SortID")
rs.open sql,conn,1,1
SeoTitle=rs("SortName"&Language)
rs.close
set rs=nothing
end if
headid=6
%>
<!--#include file="Head.Asp" -->
<div class="clear"></div>
<div id="contant">
  <div class="cleft">
    
	<div class="news">
      <div class="title">
	  &nbsp;<b>Download List</b>
	  </div>
	  <div>
	  <ul>
<%=WebMenu(0,0,2)%>
</ul>
	  </div>
    </div>
	<div class="news">
      <div class="title">
	  &nbsp;<b>Hot Download</b>
	  </div>
	  <div>
	  <ul>
	  <%=Downloadhot(10)%>
	  </ul>
	  </div>
    </div>
  </div>
<div class="cright">
	<div class="crightb">
	  <div class="crightbtitle">
	    <div class="crightbtitlel">
		Location:
		</div>
		<div class="crightbtitler">
		<%=WebLocation()%>
		</div>
	  </div>
	  <div class="crightbcontent">
<table cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff" border="0" heihgt="">
    <tbody>
        <tr>
            <td>
<%=WebContent("LiangJingCMS_DownSort",request.QueryString("SortID"),"")%>
            </td>
        </tr>
    </tbody>
</table>
</div>
	</div>
  </div>
</div>
<!--#include file="Foot.Asp"-->
<%
function WebMenu(ParentID,i,level)
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select * from LiangJingCMS_DownSort where ViewFlag"&Language&" and ParentID="&ParentID&" order by ID asc"
  rs.open sql,conn,1,1
  if conn.execute("select ID from LiangJingCMS_DownSort Where ViewFlag"&Language&" and ParentID=0").eof then
    response.write "No relevant information"
  end if
  do while not rs.eof
  	If ISHTML = 1 Then
		AutoLink = ""&DownSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
	Else
		AutoLink = "DownList.asp?SortID="&rs("ID")&""
	End If
	if ParentID=0 then
	  response.write "<Li>  <img src=""images/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href="""&AutoLink&""" target=""_blank"" style=""margin-left:5px;"">"&rs("SortName"&Language)&"</a></li>"
	else
	  response.write string(i," ")&"<Li>  <img src=""images/Tx_Ar3.gif"" style=""margin-left:5px;"" /> <a href="""&AutoLink&""" target=""_blank"" style=""margin-left:5px;"">"&rs("SortName"&Language)&"</a></li>"
	end if
    i=i+1
	if i<level then call WebMenu(rs("ID"),i,level)
	i=i-1
	rs.movenext
  loop 
  rs.close
  set rs=nothing
end function

function WebLocation()
  WebLocation="&nbsp;Location:<a href=""index.asp"" class=""agray"">Home</a> - <a href=""DownList.asp"" class=""agray"">Download Center</a>"&VbCrLf
  if request.QueryString("SortID")="" then
    WebLocation=WebLocation
  elseif not IsNumeric(request.QueryString("SortID")) then
    WebLocation=WebLocation&"Parameter error"
  elseif conn.execute("select * from LiangJingCMS_DownSort Where ViewFlag"&Language&" and  ID="&request.QueryString("SortID")).eof then
    WebLocation=WebLocation&"Parameter error"
  else
    dim rs,sql
    set rs = server.createobject("adodb.recordset")
	sql="select * from LiangJingCMS_DownSort where ViewFlag"&Language&" and ID="&request.QueryString("SortID")
    rs.open sql,conn,1,1
	WebLocation=WebLocation&SortPathTXT("LiangJingCMS_DownSort",rs("ID"))
    rs.close
    set rs=nothing
  end if
end Function

function SortPathTXT(DataFrom,ID)
  dim rs,sql
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From "&DataFrom&" where ViewFlag"&Language&" and ID="&ID
  rs.open sql,conn,1,1
  if not rs.eof Then
	If ISHTML = 1 Then
		AutoLink = ""&DownSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
	Else
		AutoLink = "DownList.asp?SortID="&rs("ID")&""
	End If
	SortPathTXT=SortPathTXT(DataFrom,rs("ParentID"))&" - <a href="""&AutoLink&""">"&rs("SortName"&Language)&"</a>"
  end if
  rs.close
  set rs=nothing
end function

function WebContent(DataFrom,ID,SortPath)
  dim rs,sql
  dim HideSort
  set rs = server.createobject("adodb.recordset")
  if ID="" then
	SortPath="0,"
  elseif not IsNumeric(ID) then
    response.write "<center>No relevant information</center>"
	exit function
  elseif conn.execute("select * from "&DataFrom&" Where ViewFlag"&Language&" and  ID="&ID).eof then
    response.write "<center>No relevant information</center>"
	exit function
  else
	SortPath=conn.execute("select * from "&DataFrom&" Where ViewFlag"&Language&" and  ID="&ID)("SortPath")
	conn.execute("update "&DataFrom&" set ClickNumber=ClickNumber+1 Where ID="&ID)
  end if
  sql="select * from "&DataFrom&" Where not(ViewFlag"&Language&") and Instr(SortPath,'"&SortPath&"')>0"
  rs.open sql,conn,1,1
  while not rs.eof
	HideSort="and not(Instr(SortPath,'"&rs("SortPath")&"')>0) "&HideSort
    rs.movenext
  wend
  rs.close
  dim idCount
  dim pages
      pages=DownInfo
  dim pagec
  dim page
      page=clng(request("Page"))
  dim pagenc
      pagenc=5
  dim pagenmax
  dim pagenmin
  dim pageprevious
  dim pagenext
  datafrom="LiangJingCMS_Download"
  dim datawhere
	  datawhere="where ViewFlag"&Language&" and Instr(SortPath,'"&SortPath&"')>0 "&HideSort& " "
  dim sqlid
  dim Myself,PATH_INFO,QUERY_STRING
      PATH_INFO = request.servervariables("PATH_INFO")
	  QUERY_STRING = request.ServerVariables("QUERY_STRING")'
      if QUERY_STRING = "" then
	    Myself = PATH_INFO & "?"
	  elseif Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
	    Myself= PATH_INFO & "?" & QUERY_STRING & "&"
	  else
	    Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
	  end if
  dim taxis
      taxis="order by id desc "
  dim i
  sql="select count(ID) as idCount from ["& datafrom &"]" & datawhere
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,0,1
  idCount=rs("idCount")
  if(idcount>0) then
    if(idcount mod pages=0)then
	  pagec=int(idcount/pages)
   	else
      pagec=int(idcount/pages)+1
    end if
    sql="select id from ["& datafrom &"] " & datawhere & taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,1
    rs.pagesize = pages
    if page < 1 then page = 1
    if page > pagec then page = pagec
    if pagec > 0 then rs.absolutepage = page
    for i=1 to rs.pagesize
	  if rs.eof then exit for
	  if(i=1)then
	    sqlid=rs("id")
	  else
	    sqlid=sqlid &","&rs("id")
	  end if
	  rs.movenext
    next
  end if
  if(idcount>0 and sqlid<>"") then
    sql="select * from ["& datafrom &"] where id in("& sqlid &") "&taxis
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,0,1
	Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
	Response.Write "  <tr height=""26"">"&VbCrLf
	Response.Write "    <td style=""color:#FFFFFF; font-weight:bold; background:url(Images/split.gif) no-repeat right center; background-color:#abacaf"">&nbsp;&nbsp;&nbsp;&nbsp;Title</td>"&VbCrLf
	Response.Write "    <td style=""color:#FFFFFF; font-weight:bold; background:url(Images/split.gif) no-repeat right center; background-color:#abacaf"">&nbsp;&nbsp;File Size</td>"&VbCrLf
	Response.Write "    <td bgcolor=""#ABACAF"" style=""color:#FFFFFF; font-weight:bold"">&nbsp;&nbsp;Update Time</td>"&VbCrLf
	Response.Write "  </tr>"&VbCrLf
    while not rs.eof
	If ISHTML = 1 Then
		AutoLink = ""&DownNameDiy&""&Separated&""&rs("ID")&"."&HTMLName&""
	Else
		AutoLink = "DownView.asp?ID="&rs("ID")&""
	End If
	Response.Write "  <tr height=""28"">"&VbCrLf
	Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;<img src=""images/arr.gif"" width=""11"" height=""14"" align=""absmiddle"" />&nbsp;&nbsp;<a href="""&AutoLink&""">"&rs("DownName"&Language)&"</a></td>"&VbCrLf
	Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom;"">&nbsp;&nbsp;&nbsp;"&rs("FileSize")&"</td>"&VbCrLf
	Response.Write "    <td style=""background:url(Images/bg2.gif) repeat-x left bottom; color:#999999"">&nbsp;&nbsp;&nbsp;"&FormatDate(rs("Updatetime"),13)&"</td>"&VbCrLf
	Response.Write "  </tr>"&VbCrLf
	rs.movenext
    wend
	Response.Write "</table>"&VbCrLf
  else
    response.write "<center>No relevant information</center>"
	exit function
  end if
  Response.Write "<table width=""98%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&VbCrLf
  Response.Write "  <tr height=""35"">"&VbCrLf
  Response.Write "    <td align=""center"">"&VbCrLf
  Response.Write "Total:<strong style=""color:red"">"&idcount&"</strong>Records&nbsp;&nbsp;Page:<strong style=""color:red"">"&page&"</strong>/"&pagec&" PageSize:<strong style=""color:red"">"&pages&"</strong>Records" & vbCrLf
  pagenmin=page-pagenc
  pagenmax=page+pagenc
  if(pagenmin<1) then pagenmin=1
  If ISHTML = 1 Then
  If ID = "" Then
   if(page>1) then response.write ("<a href="""&DownSortName&""&Separated&"1."&HTMLName&""" title=""Return to page 1""><font face=""webdings"" color=""#000000"">9</font></a> ")
  Else
  if(page>1) then response.write ("<a href="""&DownSortName&""&Separated&""&ID&""&Separated&"1."&HTMLName&""" title=""Return to page 1""><font face=""webdings"" color=""#000000"">9</font></a> ")
  End If
  Else
  if(page>1) then response.write ("<a href="""& myself &"Page=1"" title=""Return to page 1""><font face=""webdings"" color=""#000000"">9</font></a> ")
  End If
  if page-(pagenc*2+1)<=0 then
	pageprevious=1
  else
	pageprevious=page-(pagenc*2+1)
  end If
  If ISHTML = 1 Then
  If ID = "" Then
  if(pagenmin>1) then response.write ("<a href="""&DownSortName&""&Separated&""&pageprevious&"."&HTMLName&""" title=""page"& pageprevious &"""><font face=""webdings"" color=""#000000"">3</font></a> ")
  Else
  if(pagenmin>1) then response.write ("<a href="""&DownSortName&""&Separated&""&ID&""&Separated&""&pageprevious&"."&HTMLName&""" title=""page"& pageprevious &"""><font face=""webdings"" color=""#000000"">3</font></a> ")
  End If
  Else
  if(pagenmin>1) then response.write ("<a href="""& myself &"Page="& pageprevious &""" title=""page"& pageprevious &"""><font face=""webdings"" color=""#000000"">3</font></a> ")
  End If
  if(pagenmax>pagec) then pagenmax=pagec
  for i = pagenmin to pagenmax
	if(i=page) then
	  response.write ("&nbsp;<strong style=""color:red"">"& i &"</strong>&nbsp;")
	Else
	If ISHTML = 1 Then
	If ID = "" Then
		response.write ("[<a href="""&DownSortName&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]")
	Else
		response.write ("[<a href="""&DownSortName&""&Separated&""&ID&""&Separated&""&i&"."&HTMLName&""">"& i &"</a>]")
	End If
	Else
		response.write ("[<a href="""& myself &"Page="&i&""">"& i &"</a>]")
	End If
	end if
  next
  if page+(pagenc*2+1)>=pagec then
    pagenext=pagec
  else
    pagenext=page+(pagenc*2+1)
  end If
  If ISHTML = 1 Then
  If ID = "" Then
  if(pagenmax<pagec) then response.write (" <a href="""&DownSortName&""&Separated&""&pagenext&"."&HTMLName&""" title=""Go to page"&pagenext&"""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""&DownSortName&""&Separated&""&pagec&"."&HTMLName&""" title=""Go to page"&pagec&"""><font face=""webdings"" color=""#000000"">:</font></a>")
  Else
  if(pagenmax<pagec) then response.write (" <a href="""&DownSortName&""&Separated&""&ID&""&Separated&""&pagenext&"."&HTMLName&""" title=""Go to page"&pagenext&"""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""&DownSortName&""&Separated&""&ID&""&Separated&""&pagec&"."&HTMLName&""" title=""Go to page"&pagec&"""><font face=""webdings"" color=""#000000"">:</font></a>")
  End If
  Else
  if(pagenmax<pagec) then response.write (" <a href="""& myself &"Page="& pagenext &""" title=""Go to page"&pagenext&"""><font face=""webdings"" color=""#999999"">:</font></a> ")
  if(page<pagec) then response.write (" <a href="""& myself &"Page="& pagec &""" title=""Go to page"&pagec&"""><font face=""webdings"" color=""#000000"">:</font></a>")
  End If
  Response.Write "    </td>"&VbCrLf
  Response.Write "  </tr>"&VbCrLf
  Response.Write "</table>"&VbCrLf
  rs.close
  set rs=nothing
end function
%>

⌨️ 快捷键说明

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