Discuz X3.2附件下载 前面自动增加网站名称前缀?

来源: 作者: 发表时间:2017-02-27

 打开source/module/forum/forum_attachment.php搜索:

  1. $thread && $attachexists = TRUE;
复制代码

在后面增加,这是未插入帖内的附件增加文件名前缀,其中获取到的$_G['setting']['bbname']就是论坛名字。.'-'就是增加一个破折号。

  1. $attach['filename'] = $_G['setting']['bbname'].'-'.$attach['filename'];
复制代码

再后面一行。--这个是插入页面的附件增加文件名前缀

  1. $attachexists = TRUE;
复制代码

同样增加

  1. $attach['filename'] = $_G['setting']['bbname'].'-'.$attach['filename'];
复制代码


帖子中,上传的文件名字都显示网站名称(不下载也可以看见)

打开source/function/function_attachment.php搜索:

  1. $attachexists = TRUE;
复制代码

在后面增加:

  1. $attach['filename'] = $_G['setting']['bbname'].'-'.$attach['filename'];
复制代码