欢迎来到站长天空!

DedeCMS

当前位置: 主页 > CMS教程 > DedeCMS

织梦/dedecms软件频道判断是本站下载链接后再列出镜像的代码

时间:2020-11-04 00:00:00|栏目:DedeCMS|点击:

">所以想办法去加个判断,只有是自己域名的了解才生成镜像下载点。

详细的修改方法:

找到文件include/taglib/channel/softlinks.lib.php,按如下来添加一个判断代码,只添加加粗部分即可,域名freexyz.cn请替换为自己网站域名即可。


代码如下:
if (strstr($firstLink, 'freexyz.cn')) //xiaoxin-20120818-判断是freexyz.cn域名下才出现镜像
{ //xiaoxin-20120818-判断是freexyz.cn域名下才出现镜像
$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-判断是freexyz.cn域名下才出现镜像

上一篇:dedeCMS 织梦的日期时间格式大全(最新)

栏    目:DedeCMS

下一篇:织梦dedecms:让rss按照审核时间排序的方法

本文标题:织梦/dedecms软件频道判断是本站下载链接后再列出镜像的代码

本文地址:https://zz.feitang.co/CMSjiaocheng/27421.html

广告投放 | 联系我们 | 版权申明

申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:257218569 | 邮箱:257218569@qq.com

Copyright © 2018-2026 站长天空 版权所有 Powered by EyouCms冀ICP备14023439号