完美解決35dir獲取網站縮略圖問題(兩種方法)償試過不行
來源:本站原創 瀏覽:1101次 時間:2023-08-17
兩種修改方法針對商業版2.2 免費版本差不多
第一種方法也是我推薦的方法,把網頁快照外鏈其他網站的縮略圖,這樣很省你的服務器空間和帶寬資源
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文件內的
get_webthumb($link['web_pic']);
替換成
get_webthumb($link['web_url']);
3.在將module\siteinfo.php文件內的
get_webthumb($web['web_pic']);
替換成
get_webthumb($web['web_url']);
4.在將source\module\website.php文件內的(此處有兩處修改)
$row['web_pic'] = get_webthumb($row['web_pic']);
替換成
查找代碼:
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文件內的
get_webthumb($link['web_pic']);
替換成
get_webthumb($link['web_url']);
3.在將module\siteinfo.php文件內的
get_webthumb($web['web_pic']);
替換成
get_webthumb($web['web_url']);
4.在將source\module\website.php文件內的(此處有兩處修改)
$row['web_pic'] = get_webthumb($row['web_pic']);
替換成
$row['web_pic'] = get_webthumb($row['web_url']);
利用myip的接口顯示縮略圖 圖片是調用myip的 不會占用自己服務器空間 資源 速度也有保證 myip是很老的站了 相信不會輕易關閉
第二種是修復官方的失效自帶下載縮略圖功能 2.修改 \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目錄下 (個人認為很占空間與帶寬) 轉載請注明:天狐博客 ? 完美解決35dir獲取網站縮略圖問題(兩種方法) |
|
- 上一篇: 35dir有縮略圖顯示本地,沒有縮略圖調用愛站修改方法
- 下一篇: 網站庫一個神奇的網站地址庫