本帖最后由 Midnight☆ 于 2013-10-14 14:35 编辑
我的是discuz x3.1 开启远程附件之后,首页上如果调用缩略图会不显示,原因是调用的时候仍然调用的本地目录,解决办法如下:
修改 source/function/function_forum.php
找到 410行
- if($_G['setting']['ftp']['on']) {
- $ftp = & discuz_ftp::instance();
- $ftp->connect();
- if($ftp->connectid && $ftp->ftp_size($thumbpath) > 0 || ($return = $image->Thumb($replacevalue, $thumbpath, $block['picwidth'], $block['picheight'], 2) && $ftp->upload($_G['setting']['attachurl'].'/'.$thumbpath, $thumbpath))) {
- $picflag = 1; //common_block_pic表中的picflag标识(0本地,1远程)
- $_G['block_makethumb'] = true;
- @unlink($_G['setting']['attachdir'].'./'.$thumbpath);
- }
- } elseif(file_exists($_G['setting']['attachdir'].$thumbpath) || ($return = $image->Thumb($replacevalue, $thumbpath, $block['picwidth'], $block['picheight'], 2))) {
- $picflag = 0; //common_block_pic表中的picflag标识(0本地,1远程)
- $_G['block_makethumb'] = true;
- }
复制代码 改成如下:
- if(file_exists($_G['setting']['attachdir'].$thumbpath) || ($return = $image->Thumb($replacevalue, $thumbpath, $block['picwidth'], $block['picheight'], 2))) {
- $picflag = 0; //common_block_pic表中的picflag标识(0本地,1远程)
- $_G['block_makethumb'] = true;
- }
复制代码
也就是说在开启远程附件以后,禁用模块缩略图上传到远程FTP
|