DZ原生代码交流学习,买插件不如自己动手解决
 
发新帖
楼主: 天启
查看: 660|回复: 0

[教程] DZ下载附件自动带缀名

[复制链接]
天启VIP6 发表于 2020-7-28 18:14:24 | 显示全部楼层
给附件增加下载自动带前缀或后缀名找到文件./source/module/forum/forum_attachment.php
搜索:
  1. $thread && $attachexists = TRUE;
复制代码
在下面添加代码:
  1. $attach['filename'] = $_G['setting']['bbname'].'-'.$attach['filename'];
复制代码

然后在:
  1. $attachexists = TRUE;
复制代码
在下面添加代码:
  1. $attach['filename'] = $_G['setting']['bbname'].'-'.$attach['filename'];
复制代码
保存文件,下载附件自动会带增加的前缀或后缀名。
快速回复 返回顶部 返回列表