使用下载频道的朋友,一般都会选择快车或者迅雷下载,今天修改了下载频道代码,增加了下载地址判断,站外连接直接下载,站内资源则自动选择快车下载和迅雷下载。在此特别感谢雨哲提供的思路!
主要修改文件ShowSoftDown.asp,修改前建议自己做好备份:
1.在<!--#include file="CommonCode.asp"-->下面增加:
代码如下: <script src="Dim rs, SoftID, SoftName SoftID = Trim(request("SoftID")) Call openconn Set rs = Conn.Execute("select SoftName from PE_Soft where SoftID = " & SoftID & " ") SoftName = rs("SoftName") Set rs = Nothing Call closeconn '雨哲在线-获取软件名称和ID
3.下面代码增加红色部分:
代码如下: Dim DownloadUrl, FileExt, flashgetUrl, thunderUrl, DownloadUrlLink DownloadUrlLink = "" DownloadUrl = PE_Soft.GetDownloadUrl() If DownloadUrl = "ErrorDownloadUrl" Then Response.End Set PE_Soft = Nothing FileExt = LCase(Mid(DownloadUrl, InStrRev(DownloadUrl, ".") + 1)) If InStr(DownloadUrl, "://") <= 0 Then DownloadUrl = "http://" & Trim(Request.ServerVariables("HTTP_HOST")) & DownloadUrl flashgetUrl = FlashgetEncode(DownloadUrl,1106) thunderUrl = ThunderEncode(DownloadUrl) Else DownloadUrlLink = "1" End If
4.再把下面代码
代码如下: '方法二可以使用“目标另存为”,但会有中文乱码问题 Response.Redirect DownloadUrl
改为 代码如下: '方法二可以使用“目标另存为”,但会有中文乱码问题 if DownloadUrlLink <> "" Then Response.Redirect DownloadUrl Else %> <div> <table height=80 cellSpacing=0 cellPadding=0 width=500 align=center border=0> <tr> <td></td> </tr> </table> <table class=Guest_border cellSpacing=1 cellPadding=0 width=500 align=center border=0> <tr> <td vAlign=top align=middle> <table bgcolor=#8EB4DB cellSpacing=0 cellPadding=0 width="100%" height=28 border=0> <tr> <TH><font color=#FFFFFF><%=SiteName%>—友情提示</font></TH> </tr> </table> </td> </tr> <tr> <td class=Guest_tdbg vAlign=top align=middle> <table height=15 cellSpacing=0 cellPadding=0 width="80%" border=0> <tr> <td></td> </tr> </table> <table height="100%" cellSpacing=0 cellPadding=0 width="80%" border=0> <tr> <td class=TableRow1 vAlign=center height=25> <LI>软件名称:<font color=#990000><%=SoftName%></font></LI></td> </tr> <tr> <td class=TableRow1 vAlign=center height=25> <LI>我要报错:如果您发现该软件不能下载,请点击【<A href="DownError.asp?
SoftID=<%=SoftID%>"><FONT color=red><B>报错</B></FONT></A>】!同时,本站强烈推荐您再搜搜看。
。。。。。</LI></td> </tr> <tr> <td class=TableRow1 vAlign=center height=25> <LI><FONT color=blue>快车高速下载:</FONT><a href="#" onClick="ConvertURL2FG
('<%=flashgetUrl%>','<%= DownloadUrl%>',1106)" fg="<%=flashgetUrl%>"
oncontextmenu="Flashget_SetHref(this)" ><%=SoftName%></a></LI></td> </tr>
<tr> <td class=TableRow1 vAlign=center Align=center> <script src="http://ufile.kuaiche.com/form.php?sid=1106&code=gb2312"
></script></td> </tr>
<tr> <td class=TableRow1 vAlign=center height=25> <LI><a href="http://download.it168.com/01/0122/19711/19711_4.shtml"
target="_blank" style="color:red">web迅雷专用链合作商样板页</a> <a
href="http://union.xunlei.com/download/ASP.rar" target="_blank" style="color:red">附件下载
</a></LI></td> </tr> <tr> <td class=TableRow1 vAlign=center height=25> <LI><FONT color=blue>迅雷高速下载:</FONT><a href="#" thunderHref="<%
=thunderUrl%>" thunderPid="00679" thunderType="" thunderResTitle="<%=SoftName%>"
onClick="return OnDownloadClick_Simple(this,2)" oncontextmenu="ThunderNetwork_SetHref(this)"
><%=SoftName%></a></LI></td> </tr>
<tr> <td class=TableRow1 vAlign=center Align=center> <form action="http://so.xunlei.com/search" target="_blank" method="get"> <div align="center"> <a href="http://www.xunlei.com/" target="_blank"><img
src="
border="0"></a> <input type=text name="search" value="<%=SoftName%>" size=30> <input type="submit" value="迅雷搜索"> <input type="hidden" name="id" value="778"> </div> </form></td> </tr>
</table> </td> </tr> <tr> <td class=left_tdbg1 vAlign=top align=middle> <table style="TABLE-LAYOUT: fixed" cellSpacing=0 cellPadding=0 width="100%"
border=0> <tr> <td class=TableRow2 align=middle height=20><A href="<%=SiteUrl%>">返回首页</A> |
<A href="nojavascript...window.close()">关闭窗口</A></td> </tr> </table> </td> </tr> </table> </div> <% End If
OK!大功告成!
有何错误欢迎指正! [Web开发]动易ACCESS转MSSQL实现动易系统的迁移 [Web开发]动易SiteWeaver版自定义采集标签使用说明 [常用软件]小技巧:迅雷下载小插件有大作用 [网站运营]动易SiteWeaver版下载频道标签 [网站运营]动易下载频道添加快车和迅雷下载的方法 [网站运营]动易2006系统标签说明 [网站运营]动易2006系统标签说明1 [网站运营]动易2006系统标签说明-2-网站通用标签 [网站运营]动易2006系统标签说明-3-专用页标签 [网站运营]动易2006系统标签说明-4-频道专用页标签
|