Discuz手机传图,缩略图无法自适应,默认是按照方形裁剪缩略。
下面的方法可以彻底解决这个问题,图片会自适应缩略。
\template\default\touch\forum\discuzcode.htm
1、搜索
- function imagelist($attach)
复制代码
整段替换为
- function imagelist($attach) {
- global $_G, $post;
- $fix = count($post[imagelist]) == 1 ? 480 : 800;
- $fixtype = count($post[imagelist]) == 1 ? 'fixnone' : 'fixwr';
- $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp')));
- $mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 480, 10000, 'fixnone') : '' ;
- $aidencode = packaids($attach);
- $is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G[forum_thread][archiveid] : '';
- }
复制代码
2、搜索
- function attachinpost($attach)
复制代码
整段替换为
- function attachinpost($attach) {
- global $_G;
- $attach['refcheck'] = (!$attach['remote'] && $_G['setting']['attachrefcheck']) || ($attach['remote'] && ($_G['setting']['ftp']['hideurl'] || ($attach['isimage'] && $_G['setting']['attachimgpost'] && strtolower(substr($_G['setting']['ftp']['attachurl'], 0, 3)) == 'ftp')));
- $mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 480, 10000, 'fixnone') : '' ;
- $aidencode = packaids($attach);
- $is_archive = $_G['forum_thread']['is_archived'] ? '&fid='.$_G['fid'].'&archiveid='.$_G[forum_thread][archiveid] : '';
- }
复制代码
效果
|