dedecms 软件下载频道防盗链php代码

dedecms 软件下载频道防盗链php代码,第1张

dedecms软件下载频道防盗链php代码

由于网站改版升级,之前很多网站都是连接到人人的内容页面。达不到客户体验,避开一些窃取大家资源的网站。

dede做软件站有的缺陷
便是他人转帖你的下载的情况下立即转帖http://www.xxx.com/plus/download.php.........
便是立即开启下载地址目录页这类就可以下载了,消耗資源却又带不上客户。
历经科学研究,总算拿下了软件频道下载的防盗链,代码传出来大伙儿共享资源,期待可用的到
改后的作用是
倘若手机软件信息内容页详细地址是:https://www.jb51.net/soft/1.htm
下载地址联接是:https://www.jb51.net/plus/download.php?.........
分辨来路,
要不是https://www.jb51.net/soft/1.htm,
立即自动跳转到https://www.jb51.net/soft/1.htm
假如来路是https://www.jb51.net/soft/1.htm则展现下载地址
表明下:下面的代码是立即拷贝自己站在的,我开启的是整站迅雷资源下载,开启就全自动应用迅雷资源下载,你也能够做下小改动,不许应用迅雷资源下载
不应用迅雷资源的非常容易改动:删除迅雷资源有关代码,只引入$link就可以了
必须改动的文档为/plus/download.php
演试:
https://www.jb51.net/do/plus/download.php?open=0&aid=20975&cid=3
务必从https://www.jb51.net/codes/20975.html这一网页页面进到才一切正常

拷贝代码代码以下:
<scriptsrc="http://pstatic.xunlei.com/js/webThunderDetect.js"></script>
<?phprequire("encode.inc");?>
<?php
require_once(dirname(__FILE__)."/../include/config_base.php");
require_once(dirname(__FILE__)."/../include/inc_channel_unit.php");
if(!isset($open))$open=0;
if(!isset($aid))$aid="";
$dsql=newDedeSql(false);
//载入文本文档基本资料
$arctitle="";
$arcurl="";
$gquery="Select
dede_archives.title,dede_archives.senddate,dede_archives.arcrank,
dede_archives.ismake,dede_archives.typeid,dede_archives.channel,dede_archives.money,
dede_arctype.typedir,dede_arctype.namerule
Fromdede_archives
leftjoindede_arctypeondede_arctype.ID=dede_archives.typeid
wheredede_archives.ID='$aid'
";
$arcRow=$dsql->GetOne($gquery);
if(is_array($arcRow)){
$arctitle=$arcRow['title'];
$arcurl=GetFileUrl($aid,$arcRow['typeid'],$arcRow['senddate'],$arctitle,$arcRow['ismake'],$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money']);
}else{
$dsql->Close();
ShowMsg("没法获得不明文本文档的信息内容!","-1");
exit();
}
$cu=newChannelUnit($arcRow['channel'],$aid);
if(!is_array($cu->ChannelFields)){
$cu->Close();
$dsql->Close();
ShowMsg("获得文本文档连接信息内容不成功!","-1");
exit();
}
$vname="";
foreach($cu->ChannelFieldsas$k=>$v){
if($v['type']=="softlinks"){$vname=$k;break;}
}
if(!is_array($cu->ChannelFields)){
$cu->Close();
$dsql->Close();
ShowMsg("获得文本文档连接信息内容不成功!","-1");
exit();
}
if(!strstr($_SERVER['HTTP_REFERER'],$arcurl))
{
echo"<scriptlanguage='javascript'>location=\"$arcurl\";</script>";
}
$row=$dsql->GetOne("Select$vnameFrom".$cu->ChannelInfos['addtable']."whereaid='$aid'");
$downlinks=$cu->GetAddLinks($row[$vname]);
$dsql->Close();
$cu->Close();
$link=base64_decode($link);
$thunderUrl=ThunderEncode($link);
echo"<script>OnDownloadClick('".$thunderUrl."','',location.href,'07231',2,'')</script>";
?>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="zh-cn">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title><?phpecho$arctitle?>下载地址目录</title>
<linkhref="../templets/style/dede.css"rel="stylesheet"type="text/css"/>
<linkhref="../templets/style/spage.css"rel="stylesheet"type="text/css"/>
</head>
</head>
<body>
<center>
<divclass="stop">
<spanclass="toptitle">下载</span>
<spanclass="toplink"><ahref="/"_fcksavedurl="/">返回首页</a></span></div>
<divclass="smain">
<divclass="mtitle">
<divclass="mtname">软件名称:<ahref='<?phpecho$arcurl?>'_fcksavedurl='<?phpecho$arcurl?>'style='font-size:11pt'><?phpecho$arctitle?></a></div>
</div>
<divclass="">
<divclass="svote">
<divclass="vtinfo">
下载地址目录:
<divclass="vtbox"><ahref='<?phpecho$thunderUrl?>'_fcksavedurl='<?phpecho$thunderUrl?>'style='font-size:11pt'>点这儿鼠标右键应用迅雷资源下载-><?phpecho$arctitle?></a></div>
</div>
</div>
</div>
</div>
</center>
</body>
</html>

填补:
1.本软件频道防盗链作用务必在软件频道设定中设定
连接动态显示:规定进到下载地址目录页
2.假如事例的状况与您网址的不一样,您还可以手动式改动您的/plus/download.php
改动方式以下:
寻找:
$row=$dsql->GetOne("Select$vnameFrom".$cu->ChannelInfos['addtable']."whereaid='$aid'");
在他的上边再加上
if(!strstr($_SERVER['HTTP_REFERER'],$arcurl))
{
echo"<scriptlanguage='javascript'>location=\"$arcurl\";</script>";
}
那样就可以了.
载请标明出處,创作者huahua101.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/773712.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-03
下一篇 2022-05-03

发表评论

登录后才能评论

评论列表(0条)

保存