找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz!x GIF缩略图

1.source\function\function_forum.php
搜索:

  1. function getthreadcover($tid, $cover = 0, $getfilename = 0) {
  2.         global $_G;
  3.         if(empty($tid)) {
  4.                 return '';
  5.         }
  6.         $coverpath = '';
  7.         $covername = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'.$tid.'.jpg';
  8.         if($getfilename) {
  9.                 return $covername;
  10.         }
  11.         if($cover) {
  12.                 $coverpath = ($cover < 0 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$covername;
  13.         }
  14.         return $coverpath;
  15. }
复制代码

改成:
  1. function getthreadcover($tid, $cover = 0, $getfilename = 0) {
  2.         global $_G;
  3.         if(empty($tid)) {
  4.                 return '';
  5.         }
  6.         $coverpath = '';
  7.         //$covername = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'.$tid.'.jpg';
  8.         $covername = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'.$tid.'.'.$ext;
  9.         if($getfilename) {
  10.                 return $covername;
  11.         }
  12.         if($cover) {
  13.                 $coverpath = ($cover < 0 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$covername;
  14.         }
  15.         return $coverpath;
  16. }
复制代码


2.source\function\function_post.php
搜索:
  1. $basedir = !$_G['setting']['attachdir'] ? (DISCUZ_ROOT.'./data/attachment/') : $_G['setting']['attachdir'];
  2.                 $coverdir = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/';
  3.                 dmkdir($basedir.'./forum/'.$coverdir);
复制代码


下面加入
  1. if(fileext($picsource) == 'gif') { // 判断是否是gif
  2.             copy($picsource, 'data/attachment/forum/'.$coverdir.$tid.'.gif'); // 直接把gif图片复制到缩略图目录,并改名为tid.gif
  3.             $cover = C::t('forum_attachment_n')->count_image_by_id($attachtable, 'pid', $pid);  
  4.             if($imgurl && empty($cover)) {
  5.                 $cover = 1;
  6.             }
复制代码

本教程由无限星辰工作室CRX349独家整理和提供,转载请注明地址,谢谢。本文地址:https://www.xmspace.net/thread-831-1-1.html
无限星辰工作室  好集导航 Discuz全集下载  星辰站长网  集热爱361  一品文学  手机小游戏合集   海外空间网 星辰api  星辰支付二维码管理平台 阿里云服务器 腾讯云服务器
服务Discuz!建站|DiscuzQ配置|二开|小程序|APP|搬家|挂马清理|防护|Win/Linux环境搭建|优化|运维|
服务理念:专业 诚信 友好QQ842062626 服务项目 Q群315524225

发表于 2020-5-31 21:59:27 | 显示全部楼层 |阅读模式

回复 | 使用道具 举报

该帖共收到 0 条回复!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

美图秀

    • fastadmin 后台界面使用字段数组类型
    • Discuz!x3.5 修改标题高亮颜色
    • Discuz!x3.5 应用中心 下载应用一直下载中
    • 帖子定时显示
    • 论坛辅助审核
拖动客服框
Online Service
点击这里给我发消息
点击这里联系我们
微信扫一扫
在线客服
快速回复 返回顶部 返回列表