discuz手机触屏版上传图片缩略图大小调整宽高自适应-Discuz教程下载

discuz手机触屏版上传图片缩略图大小调整宽高自适应

开通本站Svip会员,全站资源免费下
Discuz手机传图,缩略图无法自适应,默认是按照方形裁剪缩略。
下面的方法可以彻底解决这个问题,图片会自适应缩略。
\template\default\touch\forum\discuzcode.htm
1、搜索  
  1. function imagelist($attach)
复制代码

整段替换为
  1. function imagelist($attach) {
  2. global $_G, $post;
  3. $fix = count($post[imagelist]) == 1 ? 480 : 800;
  4. $fixtype = count($post[imagelist]) == 1 ? 'fixnone' : 'fixwr';
  5. $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')));
  6. $mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 480, 10000, 'fixnone') : '' ;
  7. $aidencode = packaids($attach);
  8. $is_archive = $_G['forum_thread']['is_archived'] ? "&fid=".$_G['fid']."&archiveid=".$_G[forum_thread][archiveid] : '';
  9. }
复制代码

2、搜索
  1. function attachinpost($attach)
复制代码

整段替换为
  1. function attachinpost($attach) {
  2. global $_G;
  3. $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')));
  4. $mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 480, 10000, 'fixnone') : '' ;
  5. $aidencode = packaids($attach);
  6. $is_archive = $_G['forum_thread']['is_archived'] ? '&fid='.$_G['fid'].'&archiveid='.$_G[forum_thread][archiveid] : '';
  7. }
复制代码

效果
1596520644663120.png

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部