首页 > 技术支撑 > 织梦学习

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);

感谢 会员:虎哥 分享文章,亦感谢文章原作者为我们提供如此优秀信息,如果此信息对您有帮助,请购买正版以支持作者!
---------------------------
此信息仅供个人学习、研究免费使用,禁止非法转播。
免责申明:本信息由 会员:虎哥 搜集整理发布,版权归原作者及发布者所有,您如有异议请 举报 或者 版权申诉
六出奇e站内部资源仅提供学习的平台,所有资料均来自于网络,版权归原创者所有!
六出奇e站内部资源不提供任何保证,并不承担任何法律责任。
如果该信息对您的版权或者利益造成损害,请提供相应的资质证明提交 版权投诉,我们将于3个工作日内予以处理。
六出奇e站内部资源采用 BY-NC-SA 协议进行授权 转载请注明原文链接:
dede下载统计for链接到真实软件地址 http://www.lcqez.com/news/107.html

嘿,我来帮您!

找不到需要的信息?请给我们留言

注意:本需求仅接收资源需求信息。
系统自动过滤不符合要求的信息!

其他信息请提交 站内信息 给技术客服!