, 내가 미리 정의한 ckFinder의 특정 폴더에 자동 크기 조정 값을 지정하여 사용자가 해당 폴더에 업로드하는 이미지의 크기를 조정합니다. 나는이 같은 config.php 파일에 약간의 코드를 추가하여 해당 작업을 수행합니다
// This next block sets the default max image size and quality
$config['Images'] = Array(
'maxWidth' => 1600,
'maxHeight' => 1200,
'quality' => 80);
// Here we override those settings for a given folder
if(isset($_GET['currentFolder']) && urldecode($_GET['currentFolder']) == '/some-folder-name/'){
$config['Images']['maxWidth'] = 150;
$config['Images']['maxHeight'] = 150;
}
나는 아마 $ _SESSION 값을 사용하여, 당신은 유사한 해킹을 할 수있는 의심 것이다. 사용자가 필요로하는 자동 크기 조정 값을 선택하여 $ _SESSION에 저장하게하십시오. 그런 다음 설정 파일에서 해당 세션 값을 찾습니다. 다음과 같은 것 :
if(isset($_SESSION['resize_w']) && isset($_SESSION['resize_h'])){
$config['Images']['maxWidth'] = $_SESSION['resize_w'];
$config['Images']['maxHeight'] = $_SESSION['resize_h'];
}
아직 config.php 파일에 session_start()를 호출해야합니다.