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

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。


来源:网友投稿 关注: 时间:2020-05-19 08:32
首先声明,只要是我们的vip会员所有源码均可以免费下载,不做任何限制(了解更多)
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ进行交流。
相关织梦教程