DedeCms附件目录统一修改为年月方法
作者:未知 文章ID:507 浏览:
DedeCms已经升级到5.7版本了,附件的目录还是不统一。比如我们从后台把附件目录调整为ym(默认为ymd),附件路径依然是不一样的。
1.附件上传部分:打开/dede/media_add.php,找到$dpath = MyDate("ymd", $uptime);修改为$dpath = MyDate($cfg_addon_savetype, $uptime);
2.采集部分:打开/include/dedecollection.class.php,找到global $cfg_image_dir,$cfg_dir_purview;修改为global $cfg_image_dir,$cfg_dir_purview,$cfg_addon_savetype; //增加全局变量cfg_addon_savetype的读取。然后找到$timedir = "c".MyDate("ymd",time());修改为$timedir = "c".MyDate($cfg_addon_savetype,time());
3.自动获取和下载文章内的图片和资源部分:打开dede/inc/inc_archives_functions.php,找到global $cfg_multi_site,$cfg_basehost,$cfg_basedir,$cfg_image_dir;修改为global $cfg_multi_site,$cfg_basehost,$cfg_basedir,$cfg_image_dir,$cfg_addon_savetype;。然后找到$imgUrl = $cfg_uploaddir.'/'.MyDate("ymd", time());修改为$imgUrl = $cfg_uploaddir.'/'.MyDate($cfg_addon_savetype,time());