ASP generates static file code

Source: Internet
Author: User

<%
Dim rs,sql,htmlcontent
Dim Channelrootdir,strinstalldir,strindexname
Dim flashid,downid,showurl,errmsg
Dim Strtitle,straddress,addtime
Dim allhits,introduce,filesize
Dim Htmlfileurl,htmlfilename,strurl
Newasp.readchannel (Channelid)
Channelrootdir = Newasp.installdir & Newasp.channeldir
Strinstalldir = Newasp.installdir
Strindexname = "<a href= '" & Channelrootdir & "' >" & newasp.channelname & "</a>"
Flashid = Newasp.chknumeric (Request.QueryString ("id"))
If Flashid = 0 Then
Outalertscript ("wrong system parameters!)" Please enter the correct software ID.
Response.End
End If
Newasp.loadtemplates Channelid, 6, Newasp.channelskin
Htmlcontent = Newasp.htmlcontent
Htmlcontent = Replace (Htmlcontent, "{$ChannelRootDir}", Channelrootdir)
Htmlcontent = Replace (Htmlcontent, "{$InstallDir}", Newasp.installdir)
Htmlcontent = Replace (Htmlcontent, "{$ChannelID}", Channelid)
Htmlcontent = Replace (Htmlcontent, "{$ModuleName}", Newasp.modulename)
Htmlcontent = Replace (Htmlcontent, "{$FlashIndex}", Strindexname)
Htmlcontent = Readclassmenu (htmlcontent)
Htmlcontent = Readclassmenubar (htmlcontent)
SQL = "Select A.flashid,a.title,a.introduce,a.filesize,a.downid,a.showurl,a.addtime,a.allhits,a.htmlfiledate,a. Downaddress,c.htmlfiledir from Nc_flashlist A INNER JOIN [nc_classify] C on A.classid=c.classid WHERE a.channelid= "& C Hannelid & "and a.isaccept > 0 and a.flashid=" & Flashid
Set Rs = Newasp.execute (SQL)
If rs.eof and Rs.bof Then
ErrMsg = errmsg & <li> Sorry ~! Did not find the software you want to download. </li> "
Returnerr (errmsg)
Set Rs = Nothing
Response.End
Else
Strtitle = Rs ("title")
straddress = Newasp.chknull (Rs ("downaddress"))
Showurl = Newasp.chknull (Rs ("Showurl"))
Addtime = Rs ("Addtime")
Allhits = Rs ("Allhits")
Downid = Rs ("Downid")
introduce = Ubbcode (Rs ("introduce"))
If CLng (Rs ("FileSize")) > 0 Then
FileSize = Newcloud.readfilesize (Rs ("FileSize"))
Else
FileSize = "Unknown Size"
End If
If CInt (newasp.iscreatehtml) <> 0 Then
Htmlfileurl = Channelrootdir & RS ("Htmlfiledir") & Newasp.showdatepath (RS ("Htmlfiledate"), Newasp.htmlpath)
Htmlfilename = Newasp.readfilename (rs ("Htmlfiledate"), RS ("Flashid"), Newasp.htmlextname, Newasp.htmlprefix, Newasp.htmlform, "")
strURL = Htmlfileurl & Htmlfilename
Else
strURL = channelrootdir & "show.asp?id=" & Rs ("Flashid")
End If
End If
Rs.Close:Set Rs = Nothing
Htmlcontent = Replace (Htmlcontent, "{$PageTitle}", strtitle)
Htmlcontent = Replace (Htmlcontent, "{$FlashTitle}", strtitle)
Htmlcontent = Replace (Htmlcontent, "{$STRURL}", strURL)
Htmlcontent = Replace (Htmlcontent, "{$DateAndTime}", Addtime)
Htmlcontent = Replace (Htmlcontent, "{$FleshSize}", FileSize)
Htmlcontent = Replace (Htmlcontent, "{$AllHits}", Allhits)
Htmlcontent = Replace (Htmlcontent, "{$Introduce}", introduce)
Htmlcontent = Replace (Htmlcontent, "{$ShowDownAddress}", Showdownaddress ())
Htmlcontent = Replace (Htmlcontent, "{$FlashTitle}", strtitle)
Htmlcontent = Replace (Htmlcontent, "{$FlashID}", Flashid)
Htmlcontent = Replace (Htmlcontent, "{$flashid}", Flashid)
Htmlcontent = Replace (Htmlcontent, "{$ChannelRootDir}", Channelrootdir)
Htmlcontent = Replace (Htmlcontent, "{$SkinPath}", Newasp.skinpath)
Htmlcontent = Replace (Htmlcontent, "{$InstallDir}", Strinstalldir)
Htmlcontent = Replace (Htmlcontent, "{$ChannelID}", Channelid)
Response.Write Htmlcontent
Set Newcloud = Nothing
Public Function showdownaddress ()
On Error Resume Next

Dim rsdown,strdownaddress
Dim I,downloadpath
Strdownaddress = ""
If Len (Showurl) > 3 Then
Strdownaddress = newasp.htmlsetting (3)
strdownaddress = Replace (strdownaddress, "{$DownLoadName}", "Click to Download Now")
If CInt (newasp.htmlsetting (1)) > 0 Then
strdownaddress = Replace (strdownaddress, "{$DOWNLOADURL}", Newcloud.formatshowurl (Showurl))
Else
strdownaddress = Replace (strdownaddress, "{$DOWNLOADURL}", "Downfile.asp?url=" & Showurl)
End If
End If
If Len (straddress) > 3 Then
Set Rsdown = Newasp.execute ("Select Downid,downloadname,downloadpath,isdisp from Nc_downserver WHERE channelid=" & Channelid & "and depth=1 and Rootid =" & Downid & "and islock=0 Order by orders ASC")
If not (RSDOWN.BOF and rsdown.eof) Then
i = 0
Do as not rsdown.eof
If Rsdown ("Isdisp") > 0 Then
Downloadpath = Rsdown ("Downloadpath") & straddress
Else
Downloadpath = "download.asp?id=" & Flashid & "&amp;downid=" & Rsdown ("Downid")
End If
strdownaddress = strdownaddress & Newasp.htmlsetting (3)
strdownaddress = Replace (strdownaddress, "{$DOWNLOADURL}", Downloadpath)
strdownaddress = Replace (strdownaddress, "{$DownLoadName}", Rsdown ("Downloadname"))
Rsdown.movenext
i = i + 1
Loop
Else
strdownaddress = strdownaddress & Newasp.htmlsetting (3)
strdownaddress = Replace (strdownaddress, "{$DownLoadName}", "Click to Download Now")
If CInt (newasp.htmlsetting (1)) > 0 Then
strdownaddress = Replace (strdownaddress, "{$DOWNLOADURL}", straddress)
Else
strdownaddress = Replace (strdownaddress, "{$DOWNLOADURL}", "Download.asp?id=" & Flashid & "&amp;downid=0")
End If
End If
Set Rsdown = Nothing
End If
Showdownaddress = strdownaddress
End Function
Closeconn
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.