完美解決35dir獲取網(wǎng)站縮略圖問題(兩種方法)償試過不行
來源:本站原創(chuàng) 瀏覽:1346次 時(shí)間:2023-08-17
兩種修改方法針對(duì)商業(yè)版2.2 免費(fèi)版本差不多
第一種方法也是我推薦的方法,把網(wǎng)頁快照外鏈其他網(wǎng)站的縮略圖,這樣很省你的服務(wù)器空間和帶寬資源
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']);
替換成
查找代碼:
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行
$imgurl = 'http://open.thumbshots.org/image.pxf?url='.$weburl;
替換成
$imgurl = 'http://www.myip.cn/webthumb.php?q='.$weburl;
保存即可,然后去后臺(tái)-站點(diǎn)管理-下載圖片 下載所有圖片即可 大約每個(gè)圖片100K 圖片保存在\uploads\website目錄下 (個(gè)人認(rèn)為很占空間與帶寬) 轉(zhuǎn)載請(qǐng)注明:天狐博客 ? 完美解決35dir獲取網(wǎng)站縮略圖問題(兩種方法) |
|



