以下有两种方法,一种是直接链接别的网站,第二种是使用后台自带的功能。
方法一:
1. 打开文件 source\module\prelink.php
搜索get_webthumb 找到以下代码
function get_webthumb($web_pic) {
global $options;
if (!empty($web_pic)) {
$strurl = $options['site_root'].$options['upload_dir'].'/'.$web_pic;
} else {
$strurl = $options['site_root'].'public/images/nopic.gif';
}
return $strurl;
}
修改成以下代码
function get_webthumb($web_pic,$web_url) {
global $options;
if (!empty($web_pic)) {
$strurl = $options['site_root'].$options['upload_dir'].'/'.$web_pic;
} else {
$strurl= 'http://www.aizhan.com/ajaxAction/webthumb.php?domain='.$web_url;
}
return $strurl;
}
2.打开文件 source\module\website.php
搜索get_webthumb
找到
$web['web_pic'] = get_webthumb($web['web_pic']); 需要替换两次
全部替换成
$row['web_pic'] = get_webthumb($row['web_pic'],$row['web_url']);
3.打开文件 module\siteinfo.php
搜索get_webthumb
找到
$web['web_pic'] = get_webthumb($web['web_pic']); 这行
替换成
$web['web_pic'] = get_webthumb($web['web_pic'],$web['web_url']);
4.打开文件 module\linkinfo.php
搜索get_webthumb
找到
$link['web_pic'] = get_webthumb($link['web_pic']);
这行
替换成
$link['web_pic'] = get_webthumb($link['web_pic'],$link['web_url']);
方法二:修复官方的失效自带下载缩略图功能
修改 \source\include\function.php
搜索 save_to_local 函数
大约在434行
$imgurl = 'http://open.thumbshots.org/image.pxf?url='.$weburl;
替换成
$imgurl = 'http://www.myip.cn/webthumb.php?q='.$weburl;
保存即可,然后去后台-站点管理-下载图片
下载所有图片即可大约每个图片100K 图片保存在\uploads\website目录下
方法一:把网页图片调用其他网站的缩略图。这种方法比较节省服务器资源。具体操作如下。
1.打开文件 source\module\prelink.php
查找代码:
<span class="crayon-t">function</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$web_pic</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-8"><span class="crayon-h"> </span><span class="crayon-m">global</span><span class="crayon-h"> </span><span class="crayon-v">$options</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-9"> </div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-10"><span class="crayon-h"> </span><span class="crayon-st">if</span><span class="crayon-h"> </span><span class="crayon-sy">(</span><span class="crayon-o">!</span><span class="crayon-k ">empty</span><span class="crayon-sy">(</span><span class="crayon-v">$web_pic</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-11"><span class="crayon-h"> </span><span class="crayon-v">$strurl</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$options</span><span class="crayon-sy">[</span><span class="crayon-s">'site_root'</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-v">$options</span><span class="crayon-sy">[</span><span class="crayon-s">'upload_dir'</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-s">'/'</span><span class="crayon-sy">.</span><span class="crayon-v">$web_pic</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-12"><span class="crayon-h"> </span><span class="crayon-sy">}</span><span class="crayon-h"> </span><span class="crayon-st">else</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-13"><span class="crayon-h"> </span><span class="crayon-v">$strurl</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$options</span><span class="crayon-sy">[</span><span class="crayon-s">'site_root'</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-s">'public/images/nopic.gif'</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-14"><span class="crayon-h"> </span><span class="crayon-sy">}</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-15"> </div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-16"><span class="crayon-h"> </span><span class="crayon-k ">return</span><span class="crayon-h"> </span><span class="crayon-v">$strurl</span><span class="crayon-sy">;</span></div>}
修改为:
<span class="crayon-t">function</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$web_pic</span><span class="crayon-sy">,</span><span class="crayon-v">$web_url</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span><div class="crayon-line" id="crayon-55c425564969d459345953-21"><span class="crayon-m">global</span><span class="crayon-h"> </span><span class="crayon-v">$options</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-22"> </div><div class="crayon-line" id="crayon-55c425564969d459345953-23"><span class="crayon-st">if</span><span class="crayon-h"> </span><span class="crayon-sy">(</span><span class="crayon-o">!</span><span class="crayon-k ">empty</span><span class="crayon-sy">(</span><span class="crayon-v">$web_pic</span><span class="crayon-sy">)</span><span class="crayon-sy">)</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-24"><span class="crayon-v">$strurl</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-v">$options</span><span class="crayon-sy">[</span><span class="crayon-s">'site_root'</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-v">$options</span><span class="crayon-sy">[</span><span class="crayon-s">'upload_dir'</span><span class="crayon-sy">]</span><span class="crayon-sy">.</span><span class="crayon-s">'/'</span><span class="crayon-sy">.</span><span class="crayon-v">$web_pic</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-25"><span class="crayon-sy">}</span><span class="crayon-h"> </span><span class="crayon-st">else</span><span class="crayon-h"> </span><span class="crayon-sy">{</span></div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-26"><span class="crayon-v">$strurl</span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-s">'http://www.aizhan.com/ajaxAction/webthumb.php?domain='</span><span class="crayon-sy">.</span><span class="crayon-v">$web_url</span><span class="crayon-sy">;</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-27"> </div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-28"><span class="crayon-sy">}</span></div><div class="crayon-line" id="crayon-55c425564969d459345953-29"><span class="crayon-k ">return</span><span class="crayon-h"> </span><span class="crayon-v">$strurl</span><span class="crayon-sy">;</span></div><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-30"><span class="crayon-sy">}</span></div>
2.打开文件 module\linkinfo.php
搜索get_webthumb
<span class="crayon-v"></span><span class="crayon-v"></span><span class="crayon-v">$link</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$link</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span><span class="crayon-sy"></span><span class="crayon-h"></span>
<span class="crayon-v"></span>
替换成
<div class="crayon-line" id="crayon-55c425564969d459345953-37"><span class="crayon-v"></span><div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-52"><span class="crayon-v">$link</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$link</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-sy">,</span><span class="crayon-v">$link</span><span class="crayon-sy">[</span><span class="crayon-s">'web_url'</span><span class="crayon-sy">]</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span><span class="crayon-sy"></span></div></div>
3.打开文件 module\siteinfo.php
搜索get_webthumb
<span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span>
替换成
<div class="crayon-line crayon-striped-line" id="crayon-55c425564969d459345953-44"><span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-sy">,</span><span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_url'</span><span class="crayon-sy">]</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div>
4.打开文件 source\module\website.php 修改以下两处
<span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$web</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span><span class="crayon-h"></span>
替换成(替换两次)
<div class="crayon-line" id="crayon-55c425564969d459345953-37"><span class="crayon-v">$row</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-h"> </span><span class="crayon-o">=</span><span class="crayon-h"> </span><span class="crayon-e">get_webthumb</span><span class="crayon-sy">(</span><span class="crayon-v">$row</span><span class="crayon-sy">[</span><span class="crayon-s">'web_pic'</span><span class="crayon-sy">]</span><span class="crayon-sy">,</span><span class="crayon-v">$row</span><span class="crayon-sy">[</span><span class="crayon-s">'web_url'</span><span class="crayon-sy">]</span><span class="crayon-sy">)</span><span class="crayon-sy">;</span></div>
利用myip的接口显示缩略图图片是调用myip的不会占用自己服务器空间资源速度也有保证
myip是很老的站了相信不会轻易关闭
35dir无法获取网站缩略图解决办法
来源:优站网 浏览:3199次 时间:2021-01-21
简介:以下有两种方法,一种是直接链接别的网站,第二种是使用后台自带的功能。
- 标签:35DIR缩略图,网站缩略图,生成缩略图,优站缩略图"
- 上一篇: 完美解决35dir获取网站缩略图问题(两种方法)
- 下一篇: 35dir优站分类目录nginx伪静态规则
版权声明: "35dir无法获取网站缩略图解决办法"来源于会员自助提稿或网络转载,并不代表优站目录网站大全的观点,如有疑问,敬请联系我们,我们将在第一时间予以审查或更改。
原文链接: http://www.showmulu.com/artinfo/155.html ( 转载请注明来源 )
推荐资讯
推荐站点
- 秒支付
真正的微信和支付宝个人版即时到账支付接口,无需提现,即时到账,100%资金安全,彩虹系统合作服务商,无需手续费,无需人工操作,是个人收款的最佳解决方案。
pay.yzxt.cc - 设计师网址导航
优站设计师网站导航为设计师提供全方位的供ps教程、UI设计、素材下载、高清图库、配色方案、用户体验、网页设计等全方位设计师网站导航指引。每周更新及时,同时是优站网(YOUZHAN.CO)旗下最实用、最专业、最全面、最好用的设计师网址导航!
dc.xinmeit.com - Onlylady女人志
Onlylady女人志女性时尚生活平台是专业的女性时尚网站,为广大用户提供专业的时尚潮流、美容方法、流行趋势、服饰时装资讯,打造专业时尚、美容、生活、达人、互动平台。
www.onlylady.com - 网址导航
hao125是最具权威的中文上网导航,汇集最优秀的网站及资源。及时收录影视、音乐、小说、游戏等分类的网址和内容,让您的网络生活更简单精彩。上网,从hao125开始。
hao125.com.cn - 中国政府网
中华人民共和国中央人民政府门户网站
www.gov.cn - 第一星座网
专业的占星学星座网,提供星座知识、星座个性分析、星座开运方法、星座运势、配对、查询以及心理测试、塔罗牌、在线算命、风水、生肖等星相命理相关内容。
www.d1xz.net