国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

dede 下載統計 for 鏈接到真實軟件地址

2024-04-25 20:48:46
字體:
來源:轉載
供稿:網友

將軟件下載鏈接弄成顯示真實地址時的下載統計
第一步
打開
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.fy007.com/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);
    }
?>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黎城县| 汨罗市| 抚顺县| 聂拉木县| 白城市| 大化| 敦煌市| 芜湖县| 文昌市| 孟村| 凤庆县| 澜沧| 青铜峡市| 渑池县| 大渡口区| 陕西省| 阿拉善右旗| 永仁县| 漠河县| 稷山县| 祁东县| 巴彦淖尔市| 潞西市| 花莲市| 黄山市| 崇义县| 济南市| 肥城市| 肇源县| 绥中县| 巢湖市| 睢宁县| 临邑县| 鸡东县| 渭南市| 潞城市| 湘潭县| 沁阳市| 遂宁市| 漾濞| 丰都县|