織夢/dedecms軟件頻道判斷是本站下載鏈接后再列出鏡像的代碼

字號:


    所以想辦法去加個判斷,只有是自己域名的了解才生成鏡像下載點。
    詳細的修改方法:
    找到文件include/taglib/channel/softlinks.lib.php,按如下來添加一個判斷代碼,只添加加粗部分即可,域名jb51.net請?zhí)鎿Q為自己網(wǎng)站域名即可。
    代碼如下:
    if (strstr($firstLink, 'jb51.net')) //xiaoxin-20120818-判斷是jb51.net域名下才出現(xiàn)鏡像
    { //xiaoxin-20120818-判斷是jb51.net域名下才出現(xiàn)鏡像
    $firstLink = preg_replace("#http:\/\/([^\/]*)\/#i", '/', $firstLink);
    foreach($sites as $site)
    {
    if(trim($site)=='') continue;
    list($link,$serverName,$serverType) = explode('|', $site);
    if (!empty($link_type) && $link_type != trim($serverType)) continue;
    $link = trim( preg_replace("#\/$#", "", $link) ).$firstLink;
    $downloads = getDownloads($link);
    $uhash = substr(md5($link), 0, 24);
    if($row['gotojump']==1)
    {
    $link = $phppath."/download.php?open=2&id={$refObj->ArcID}&uhash={$uhash}";
    }
    $temp = str_replace("~link~", $link, $tempStr);
    $temp = str_replace("~server~", $serverName, $temp);
    $temp = str_replace("~downloads~", $downloads, $temp);
    $downlinks .= $temp;
    }
    } //xiaoxin-20120818-判斷是jb51.net域名下才出現(xiàn)鏡像