使用下载频道的朋友,一般都会选择快车或者迅雷下载,今天修改了下载频道代码,增加了下载地址判断,站外连接直接下载,站内资源则自动选择快车下载和迅雷下载。在此特别感谢雨哲提供的思路!
主要修改文件ShowSoftDown.asp,修改前建议自己做好备份:
1.在<!--#include file="CommonCode.asp"-->下面增加:
代码如下:
<script src="http://ufile.kuaiche.com/Flashget_union.php?fg_uid=1106"></script>
<!--#include file="Flashget_base64.asp"-->
<!--#include file="base64.asp"-->
<script src="http://pstatic.xunlei.com/js/webThunderDetect.js"></script>
如需要添加快车搜索,还需添加:
<style type="text/css">
.skuaicheForm{margin:0px 0px 0px 0px;} /*--Form css--*/
.skuaicheImg{width:22px;height:22px;} /*--FlashgetLogo css--*/
.skuaicheInput{border:1px solid #CCCCCC;color:#7C7C7C;width:200px;height:22px;padding:3px
0px 0px 5px;border-left:none;}/*--searchText css--*/
.skuaicheButton{background:none;width:64px;height:22px;border:1px solid #CCCCCC;border-
left:none;padding:2px 0px 0px 2px;font-size:12px;color:#666666;cursor:pointer;}/*--
submitButton css--*/
</style>
2.在Response.CacheControl = "no-cache"下面添加
代码如下:
'雨哲在线-获取软件名称和ID
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="#" 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%>"
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="javascript:window.close()">关闭窗口</A></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<%
End If
OK!大功告成!
您也可以从本站下载,直接覆盖原文件即可:http://www.cherison.com.cn/Soft/ShowSoft.asp?SoftID=4
有何错误欢迎指正!
演示:站内资源下载:http://www.cherison.com.cn/Soft/ShowSoft.asp?SoftID=4
站外链接资源下载:http://www.cherison.com.cn/Soft/ShowSoft.asp?SoftID=3
注:如果是站外资源,快车或者迅雷转换会失效,无法下载。
上一篇:如何给普通管理员生成网站首页权限
共有 0 位网友发表了评论,平均得分: 0 查看完整内容