Merge remote-tracking branch '그누보드/master'
This commit is contained in:
@ -3951,10 +3951,16 @@ class str_encrypt
|
||||
|
||||
function __construct($salt='')
|
||||
{
|
||||
if(!$salt)
|
||||
$this->salt = md5(preg_replace('/[^0-9A-Za-z]/', substr(G5_MYSQL_USER, -1), $_SERVER['SERVER_SOFTWARE'].$_SERVER['DOCUMENT_ROOT']));
|
||||
else
|
||||
global $config;
|
||||
|
||||
if (!$salt) {
|
||||
$config_hash = md5(serialize(array($config['cf_title'], $config['cf_theme'], $config['cf_admin_email_name'], $config['cf_login_point'], $config['cf_memo_send_point'])));
|
||||
|
||||
//$this->salt = md5(preg_replace('/[^0-9A-Za-z]/', substr($config_hash, -1), $_SERVER['SERVER_SOFTWARE'].$config_hash.$_SERVER['DOCUMENT_ROOT']));
|
||||
$this->salt = hash('sha256', preg_replace('/[^0-9A-Za-z]/', substr($config_hash, -1), $_SERVER['SERVER_SOFTWARE'].$config_hash.$_SERVER['DOCUMENT_ROOT']));
|
||||
} else {
|
||||
$this->salt = $salt;
|
||||
}
|
||||
|
||||
$this->length = strlen($this->salt);
|
||||
}
|
||||
|
||||
@ -2461,7 +2461,7 @@ function get_itemuselist_thumbnail($it_id, $contents, $thumb_width, $thumb_heigh
|
||||
}
|
||||
|
||||
function shop_is_taxsave($od, $is_view_receipt=false){
|
||||
global $default, $is_memeber;
|
||||
global $default, $is_member;
|
||||
|
||||
$od_pay_type = '';
|
||||
|
||||
@ -2770,6 +2770,50 @@ function get_item_images_info($it, $size=array(), $image_width=0, $image_height=
|
||||
return $images;
|
||||
}
|
||||
|
||||
// 카테고리 전체 경로를 가져오는 함수 (예: 남성의류 > 상의 > 셔츠)
|
||||
function get_shop_category_path($ca_id, $separator = ' > ')
|
||||
{
|
||||
global $g5;
|
||||
static $category_cache = array(); // 카테고리명 캐시
|
||||
static $path_cache = array(); // 경로 캐시
|
||||
|
||||
if (!$ca_id) return '';
|
||||
|
||||
// 동일한 separator로 이미 조회한 경로가 있으면 캐시에서 반환
|
||||
$cache_key = $ca_id . '|' . $separator;
|
||||
if (isset($path_cache[$cache_key])) {
|
||||
return $path_cache[$cache_key];
|
||||
}
|
||||
|
||||
$path_arr = array();
|
||||
$ca_id_len = strlen($ca_id);
|
||||
|
||||
// 카테고리 ID를 2자리씩 분할하여 각 단계의 카테고리명을 조회
|
||||
for ($i = 2; $i <= $ca_id_len; $i += 2) {
|
||||
$current_ca_id = substr($ca_id, 0, $i);
|
||||
|
||||
// 캐시에 없으면 DB 조회
|
||||
if (!isset($category_cache[$current_ca_id])) {
|
||||
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$current_ca_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row) {
|
||||
$category_cache[$current_ca_id] = $row['ca_name'];
|
||||
} else {
|
||||
$category_cache[$current_ca_id] = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($category_cache[$current_ca_id]) {
|
||||
$path_arr[] = $category_cache[$current_ca_id];
|
||||
}
|
||||
}
|
||||
|
||||
$result = implode($separator, $path_arr);
|
||||
$path_cache[$cache_key] = $result; // 결과를 캐시에 저장
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function check_payment_method($od_settle_case) {
|
||||
global $default;
|
||||
|
||||
|
||||
@ -275,11 +275,10 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
|
||||
// $thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
|
||||
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$file_ext;
|
||||
|
||||
$thumb_time = @filemtime($thumb_file);
|
||||
$source_time = @filemtime($source_file);
|
||||
|
||||
if (file_exists($thumb_file)) {
|
||||
$thumb_time = @filemtime($thumb_file);
|
||||
$source_time = @filemtime($source_file);
|
||||
if ($is_create == false && $source_time < $thumb_time) {
|
||||
return basename($thumb_file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user