第一種方法也是我推薦的方法,把網(wǎng)頁快照外鏈其他網(wǎng)站的縮略圖,這樣很省你的服務(wù)器空間和帶寬資源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
1.打開文件 source\module\prelink.php
查找代碼:
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_url) {
return 'http://www.myip.cn/webthumb.php?q='.$web_url;
}
2.在將module\linkinfo.php文件內(nèi)的
get_webthumb($link['web_pic']);
替換成
get_webthumb($link['web_url']);
3.在將module\siteinfo.php文件內(nèi)的
get_webthumb($web['web_pic']);
替換成
get_webthumb($web['web_url']);
4.在將source\module\website.php文件內(nèi)的(此處有兩處修改)
$row['web_pic'] = get_webthumb($row['web_pic']);
替換成
$row['web_pic'] = get_webthumb($row['web_url']);
|
利用myip的接口顯示縮略圖 圖片是調(diào)用myip的 不會(huì)占用自己服務(wù)器空間 資源 速度也有保證 myip是很老的站了 相信不會(huì)輕易關(guān)閉
第二種是修復(fù)官方的失效自帶下載縮略圖功能
2.修改 \source\include\function.php
搜索save_to_local函數(shù)
大約在434行
1
|
$imgurl = 'http://open.thumbshots.org/image.pxf?url='.$weburl;
|
替換成
1
|
$imgurl = 'http://www.myip.cn/webthumb.php?q='.$weburl;
|
保存即可,然后去后臺(tái)-站點(diǎn)管理-下載圖片 下載所有圖片即可 大約每個(gè)圖片100K 圖片保存在\uploads\website目錄下
(個(gè)人認(rèn)為很占空間與帶寬)