이것은 설정 파일입니다. 이미지 하위 도메인을 변경했지만 이미지가로드되지 않습니다.opencart 2의 이미지에 하위 도메인을 사용하는 방법은 무엇입니까?
<?php
// HTTP
define('HTTP_SERVER', 'http://www.Yek.com/');
define('HTTP_IMAGE', 'http://img.Yek.com/');
// HTTPS
define('HTTPS_SERVER', 'https://www.Yek.com/');
define('HTTPS_IMAGE', 'https://img.Yek.com/');
// DIR
define('DIR_APPLICATION', '/home/Yek/public_html/catalog/');
define('DIR_SYSTEM', '/home/Yek/public_html/system/');
define('DIR_DATABASE', '/home/Yek/public_html/system/database/');
define('DIR_LANGUAGE', '/home/Yek/public_html/catalog/language/');
define('DIR_TEMPLATE', '/home/Yek/public_html/catalog/view/theme/');
define('DIR_CONFIG', '/home/Yek/public_html/system/config/');
//define('DIR_IMAGE', '/home/Yek/public_html/image/');//defult For Images/catlog on main host
define('DIR_IMAGE', '/home/Yek/public_html/img/image/'); // image/catalog in download host
define('DIR_CACHE', '/home/Yek/public_html/system/cache/');
define('DIR_DOWNLOAD', '/home/Yek/public_html/system/download/');
define('DIR_LOGS', '/home/Yek/public_html/system/logs/');
define('DIR_UPLOAD', '/home/Yek/public_html/system/upload/');
define('DIR_MODIFICATION', '/home/Yek/public_html/system/modification/');
// DB
....
?>
이것은 내 image.php입니다. 나를 위해 편집할까요? 모름이 코드 편집 ........................................... .................................................. .................................................. .................................................. .................................................. 이미지 디렉토리에 .....................
<?php
class ModelToolImage extends Model {
public function resize($filename, $width, $height) {
if (!is_file(DIR_IMAGE . $filename)) {
return;
}
$extension = pathinfo($filename, PATHINFO_EXTENSION);
$old_image = $filename;
$new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
if (!is_file(DIR_IMAGE . $new_image) || (filectime(DIR_IMAGE . $old_image) > filectime(DIR_IMAGE . $new_image))) {
$path = '';
$directories = explode('/', dirname(str_replace('../', '', $new_image)));
foreach ($directories as $directory) {
$path = $path . '/' . $directory;
if (!is_dir(DIR_IMAGE . $path)) {
@mkdir(DIR_IMAGE . $path, 0777);
}
}
list($width_orig, $height_orig) = getimagesize(DIR_IMAGE . $old_image);
if ($width_orig != $width || $height_orig != $height) {
$image = new Image(DIR_IMAGE . $old_image);
$image->resize($width, $height);
$image->save(DIR_IMAGE . $new_image);
} else {
copy(DIR_IMAGE . $old_image, DIR_IMAGE . $new_image);
}
}
if ($this->request->server['HTTPS']) {
return $this->config->get('config_ssl') . 'image/' . $new_image;
} else {
return $this->config->get('config_url') . 'image/' . $new_image;
}
}
}
이 코드를 발견했지만 오류가 발생했습니다. 질문을 편집하십시오. 내 코드를 편집하십시오. – RedArmy