Chevereto3.20.10
编辑chevereto/app/lib/classes/class.image.php文件
- 修改288行
case 'datefolder':
$datetime = $filearray[$prefix . 'date'];
$datefolder = preg_replace('/(.*)(\s.*)/', '$1', str_replace('-', '/', $datetime));
$folder .= G\add_ending_slash($datefolder); // Y/m/d/
break;
- 修改为
case 'datefolder':
$folder .= '2022/';
break;
- 或者你也可以修改为
case 'datefolder':
$datetime = date('Y');
//$datetime = $filearray[$prefix . 'date'];
$datefolder = preg_replace('/(.*)(\s.*)/', '$1', str_replace('-', '/', $datetime));
$folder .= G\add_ending_slash( $datefolder); // Y/m/d/
break;
还可以修改为目录加年份
$datetime = ('img/'). date('Y');
打印当前年份
上述为打印
- 修改607行
$datefolder = date('Y/m/d/', strtotime($datefolder_stock['date']));
$upload_path = CHV_PATH_IMAGES . $datefolder;
break;
- 修改为
$datefolder = date('2022/', strtotime($datefolder_stock['date']));
$upload_path = CHV_PATH_IMAGES . $datefolder;
break;
上述为上传目录
- 第3种需要修改为
$datefolder = ('img/').date('Y/', strtotime($datefolder_stock['date']));