我已阅读并接受《用户协议》
注册VIP账号,全站资源免费任意下!
欢迎来到微视媒-源码测试 经验教程 小程序源码 设计资源
开通会员全站免费下载
立即加入
您的一年会员开通成功!
您的一年会员开通成功!
今日下载数已用完
升级会员
提交
下载提示!请输入验证码验证哦!
看不清,重新获取
提交验证码
首页 > 织梦学习 >

dede下载统计for链接到真实软件地址

织梦dedecms下载统计for链接到真实软件地址 :
将软件下载链接弄成显示真实地址时的下载统计
第一步
打开
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);
788
127
  • 分 享 者:
    虎哥
  • 更新时间:
    06-03
  • 资源评分:
  • 分享方式:
    共享
  • 技术支持:
    暂无
  • 使用场景:
    仅供个人技术学习参考,拒绝商用
  • 可用操作:
您可能会喜欢的其他资源
点击咨询
在线时间:9:00-21:00