缩略图加载失败怎么办

缩略图加载失败怎么办,第1张

第一种方法是在网页上抓取其他网站的缩略图,这样会节省你的服务器空和带宽资源

1。打开文件source\module\prelink.php

查找代码:

函数get _ web thumb($ web _ pic){ global $ options;

如果(!empty($web_pic)) {

$ strurl = $ options[' site _ root ']。$options['upload_dir']。'/'.$ web _ pic} else {

$ strurl = $ options[' site _ root ']。public/images/no pic . gif ';}

return $ strurl;}

修改为:

函数get_webthumb($web_url) {

return ' http://www . myip . cn/web thumb . PHP?q= '。$ web _ url}

2。在模块\linkinfo.php文件中,

get _ web thumb($ link[' web _ pic ']);替换为

get _ web thumb($ link[' web _ URL ']);

3。在module\siteinfo.php文件中,

get _ web thumb($ web[' web _ pic ']);

替换为

get _ web thumb($ web[' web _ URL ']);

4。在source\module\website.php文件中(这里有两处修改)

$ row[' web _ pic ']= get _ web thumb($ row[' web _ pic ']);

替换为$ row[' web _ pic ']= get _ web thumb($ row[' web _ URL ']);

使用myip的界面显示缩略图。图片叫myip,不会占用自己的服务器空和资源,速度有保障。myip是个很老的站,相信不会轻易关闭。

第二种方法是修复下载缩略图的官方功能

修改\source\include\function.php搜索save_to_local函数,大概434行

$imgurl = 'http://open.thumbshots.org/image.pxf?url='.$weburl; $ imgurl = ' http://open . thumb shots . org/image . pxf?url= '。$ weburl

替换为

$imgurl = 'http://www.myip.cn/webthumb.php?q='.$weburl; $ imgurl = ' http://www . myip . cn/web thumb . PHP?q= '。$ weburl

保存好就行了,然后去后台-站点管理-下载图片,把所有的图片都下载下来。每张图片约100K,图片保存在\uploads\website目录下。

欢迎分享,转载请注明来源:聚客百科

原文地址: https://juke.outofmemory.cn/life/712972.html

()
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-07-13
下一篇 2022-07-13

发表评论

登录后才能评论

评论列表(0条)

保存