织梦/dedecms软件频道判断是本站下载链接后再列出镜像的代码
<p><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>所以想办法去加个判断,只有是自己域名的了解才生成镜像下载点。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>详细的修改方法: </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>找到文件include/taglib/channel/softlinks.lib.php,按如下来添加一个判断代码,只添加加粗部分即可,域名jb51.net请替换为自己网站域名即可。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>
</p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p class="right">
<span><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
if (strstr($firstLink, 'www.jb51.net')) //xiaoxin-20120818-判断是www.jb51.net域名下才出现镜像 <br>
{ //xiaoxin-20120818-判断是www.jb51.net域名下才出现镜像 <br>
$firstLink = preg_replace("#http:\/\/([^\/]*)\/#i", '/', $firstLink); <br>
foreach($sites as $site) <br>
{ <br>
if(trim($site)=='') continue; <br>
list($link,$serverName,$serverType) = explode('|', $site); <br>
if (!empty($link_type) && $link_type != trim($serverType)) continue; <br>
$link = trim( preg_replace("#\/$#", "", $link) ).$firstLink; <br>
$downloads = getDownloads($link); <br>
$uhash = substr(md5($link), 0, 24); <br>
if($row['gotojump']==1) <br>
{ <br>
$link = $phppath."/download.php?open=2&id={$refObj->ArcID}&uhash={$uhash}"; <br>
} <br>
$temp = str_replace("~link~", $link, $tempStr); <br>
$temp = str_replace("~server~", $serverName, $temp); <br>
$temp = str_replace("~downloads~", $downloads, $temp); <br>
$downlinks .= $temp; <br>
} <br>
} //xiaoxin-20120818-判断是www.jb51.net域名下才出现镜像 </p>
頁:
[1]