dedeCMS织梦系统如何修改下载地址链接的真实软件地址

dedeCMS织梦系统如何修改下载地址链接的真实软件地址

 

使软件下载链接的下载统计显示真实地址

 

 

 

打开

 

Quote:

 

\include\taglib\channel\softlinks.lib.php

 

找到

 

function getDownloads($url)

 

在它之前加入

 

function ch_softlinks_allb($fvalue,&$ctag,&$refObj,&$row)

{

global $dsql;

 

//引入权限判断

require_once(DEDEINC.”/memberlogin.class.php”);

$cfg_ml = new MemberLogin(-1);

$query = “select daccess from “.$refObj->ChannelInfos[‘addtable’].” where aid=’”.$refObj->ArcID.”’”;

$daccess = $dsql->GetOne($query);

if($cfg_ml->M_Rank < $daccess[‘daccess’])

{

return ‘你的权限不足或者未登录, 不能下载! 请登陆或者升级等级‘;

}

 

$phppath = $GLOBALS[‘cfg_phpurl’];

$downlinks = ”;

$dtp = new DedeTagParse();

$dtp->LoadSource($fvalue);

if(!is_array($dtp->CTags))

{

$dtp->Clear();

return “无链接信息!”;

}

$tempStr = GetSysTemplets(‘channel_downlinksb.htm’);

foreach($dtp->CTags as $ctag)

{

if($ctag->GetName()==’link’)

{

$links = trim($ctag->GetInnerText());

$serverName = trim($ctag->GetAtt(‘text’));

$islocal = trim($ctag->GetAtt(‘islocal’));

if(!isset($firstLink) && $islocal==1)

{

$firstLink = $links;

}

if($islocal==1 && $row[‘islocal’]!=1)

{

continue;

}

else

{

//支持http,迅雷下载,ftp,flashget

if(!eregi(‘^http://|^thunder://|^ftp://|^flashget://’,$links))

{

$links = $GLOBALS[‘cfg_mainsite’].$links;

}

$downloads = getDownloads($links);

if($row[‘gotojump’]==1)

{

$links = $phppath.”/download.php?open=1&id=”.$refObj->ArcID.”&link=”.urlencode(base64_encode($links));

}

$temp = str_replace(“~link~”,$links,$tempStr);

$downlinks .= $temp;

}

}

}

$dtp->Clear();

 

//启用镜像功能的情况

if($row[‘ismoresite’]==1 && !empty($row[‘sites’]) && isset($firstLink))

{

$firstLink = @eregi_replace($GLOBALS[‘cfg_basehost’],”,$firstLink);

$row[‘sites’] = ereg_replace(“[\r\n]{1,}”,”\n”,$row[‘sites’]);

$sites = explode(“\n”,trim($row[‘sites’]));

foreach($sites as $site)

{

if(trim($site)==”)

{

continue;

}

list($link,$serverName) = explode(‘|’,$site);

$link = trim($link).$firstLink;

$downloads = getDownloads($link);

if($row[‘gotojump’]==1)

{

$link = $phppath.”/download.php?open=1&link=”.urlencode(base64_encode($link));

}

$temp = str_replace(“~link~”,$link,$tempStr);

$temp = str_replace(“~server~”,$serverName,$temp);

$temp = str_replace(“~downloads~”,$downloads,$temp);

$downlinks .= $temp;

}

}

return $downlinks;

}

 

第二步找到

 

function ch_softlinks_all($fvalue,&$ctag,&$refObj,&$row)

 

在其之前加入

 

function ch_softlinksb($fvalue,&$ctag,&$refObj,$fname=”,$downloadpage=false)

{

global $dsql;

$row = $dsql->GetOne(“Select * From `2d30_softconfig` “);

$phppath = $GLOBALS[‘cfg_phpurl’];

$downlinks = ”;

if($row[‘downtype’]!=’0′ && !$downloadpage)

{

$tempStr = GetSysTemplets(“channel_downlinkpage.htm”);

$links = $phppath.”/download.php?open=0&aid=”.$refObj->ArcID.”&cid=”.$refObj->ChannelID;

$downlinks = str_replace(“~link~”,$links,$tempStr);

return $downlinks;

}

else

{

return ch_softlinks_allb($fvalue,$ctag,$refObj,$row);

}

}

 

第三步

 

打开plus\download.php

 

找到

 

$downlinks = ch_softlinks($row[$vname],$ctag,$cu,”,true);

 

在其后面另起一行加入

 

$myurl=ch_softlinksb($row[$vname],$ctag,$cu,”,true);

 

第四步

 

新建个文件 channel_downlinksb.htm,该文件保存于templets\system\channel_downlinksb.htm

 

其内容如下:

 

<li>~link~</li>

 

第五步

 

打开

 

Quote:

 

templets\plus\download_links_templet.htm

 

找到

 

<td height=”78″>

 

替换为(注意把网站域名换成你自己的)

 

<td height=”78″ onClick=”javascript:window.location.href=’http://www.ithov.net/plus/downloadcouter.php?aid=<?php echo $aid; ?>&myurl=<?php echo $myurl;?>’”>

 

第六步

 

新建个 downloadcouter.php 存入于\plus目录下 与download.php同在一个目录

 

其内容如下

 

<?php

require_once(dirname(__FILE__).”/../include/common.inc.php”);

require_once(DEDEINC.”/channelunit.class.php”);

 

echo “感谢您支持本站,回到<a href=’/’>网站主页</a>”;

$id = $_GET[“aid”];

$url=$_GET[“myurl”];

$hash = md5($url);

$query = “select count(*) as dd from 2d30_downloads where hash=’$hash’”;

$row = $dsql->GetOne($query);

if($row[‘dd’] > 0)

{

$query = “update 2d30_downloads set downloads=downloads+1 where hash=’$hash’”;

$dsql->ExecNoneQuery($query);

}else {

$query = “insert into 2d30_downloads(hash,id,downloads) values(‘$hash’,’$id’,1)”;

$dsql->ExecNoneQuery($query);

}

?>

 

文章来源网络,作者:管理,如若转载,请注明出处:https://shuyeidc.com/wp/114892.html<

(0)
管理的头像管理
上一篇2025-02-17 23:19
下一篇 2025-02-17 23:20

相关推荐

  • 服务器防火墙硬件和软件哪个效果更好,怎么选

    在服务器防火墙的选型中,硬件防火墙与软件防火墙并非非此即彼,而是互补关系,对于追求高安全等级与稳定性的生产环境,采用硬件防火墙做网络层隔离,配合软件防火墙做主机层加固,是当前公认效果最好的组合方案,硬件防火墙与软件防火墙的核心差异性能与资源占用硬件防火墙依托专用ASIC芯片或FPGA处理数据包,转发延迟通常在微……

    2026-07-26
    0
  • 站群服务器做GEO的核心逻辑是什么?,怎么做

    站群服务器做SEO的核心逻辑,是通过独立IP和资源隔离,彻底切断站点间的关联性,让搜索引擎对每个网站进行独立评估,从而降低连带风险并提升整体排名效率,站群服务器的核心价值:独立性与隔离性IP独立性:为什么是命门搜索引擎在评估网站时,会记录IP地址,如果多个站点共享同一个IP,它们之间很容易被判定为同一主体控制……

    2026-07-26
    0
  • 弹性云服务器到底是什么意思怎么收费,多少钱一个月

    弹性云服务器(Elastic Cloud Server,ECS)是一种可随时调整计算资源的云服务器,收费方式以按需付费和包年包月为主,用户只需为实际使用的资源买单,什么是弹性云服务器弹性云服务器本质上是一台运行在云端、配置可以灵活调整的虚拟机,它不像物理服务器那样固定规格,你可以在业务高峰期快速增加CPU、内存……

    2026-07-26
    0
  • 黑洞解封到底是什么意思,需要多久才能恢复

    黑洞解封是指将被黑洞路由策略屏蔽的IP地址恢复正常通信的过程,恢复时间通常取决于攻击流量是否彻底停止,多数情况下在攻击停止后10分钟到24小时内自动解除,用户也可通过联系服务商手动加速解封,黑洞解封到底是什么用拟人化的方式理解,黑洞就是网络世界的“强制隔离区”,当某个IP地址遭遇大量异常流量,比如DDoS攻击……

    2026-07-26
    0
  • 站群服务器IP段怎么选最安全,有哪些注意事项

    选择站群服务器IP段的安全核心在于IP地址的独立性、机房的路由策略以及服务商的合规资质,一个可靠的IP段必须来自持牌自营机房,具备独立C段和清洗能力,才能避免被关联风险,为什么IP段选择决定站群安全搜索引擎对IP关联的识别算法近年来越来越精细,同一C段或广播域的IP,爬虫通过反向DNS、路由跳数等特征很容易判断……

    2026-07-26
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注