From acc5b9dc4a33af8a5fc541ffe51ae0e098ad242d Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 10 Feb 2020 19:13:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=81=EC=B9=B4=ED=8A=B8=205.4=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=83=81=ED=92=88=EC=A0=9C=EB=AA=A9=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=8B=9C=20=EC=A7=A7=EC=9D=80=20=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=EB=A1=9C=20=EC=A0=81=EC=9A=A9=EC=9D=B4=20=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/itemformupdate.php | 3 ++- adm/shop_admin/itemlistupdate.php | 2 ++ lib/shop.uri.lib.php | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php index 529c92498..17616fd29 100644 --- a/adm/shop_admin/itemformupdate.php +++ b/adm/shop_admin/itemformupdate.php @@ -601,7 +601,8 @@ if($all_fields) { sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$all_fields} "); } -if( function_exists('shop_seo_title_update') ) shop_seo_title_update($it_id); +$is_seo_title_edit = $w ? true : false; +if( function_exists('shop_seo_title_update') ) shop_seo_title_update($it_id, $is_seo_title_edit); run_event('shop_admin_itemformupdate', $it_id, $w); diff --git a/adm/shop_admin/itemlistupdate.php b/adm/shop_admin/itemlistupdate.php index 9655cef3b..02c1d827b 100644 --- a/adm/shop_admin/itemlistupdate.php +++ b/adm/shop_admin/itemlistupdate.php @@ -53,6 +53,8 @@ if ($_POST['act_button'] == "선택수정") { where it_id = '".preg_replace('/[^a-z0-9_\-]/i', '', $_POST['it_id'][$k])."' "; sql_query($sql); + + if( function_exists('shop_seo_title_update') ) shop_seo_title_update(preg_replace('/[^a-z0-9_\-]/i', '', $_POST['it_id'][$k]), true); } } else if ($_POST['act_button'] == "선택삭제") { diff --git a/lib/shop.uri.lib.php b/lib/shop.uri.lib.php index 7d7cc1bfa..e22f50bec 100644 --- a/lib/shop.uri.lib.php +++ b/lib/shop.uri.lib.php @@ -208,15 +208,16 @@ function shop_exist_check_seo_title($seo_title, $type, $shop_item_table, $it_id) return ''; } -function shop_seo_title_update($it_id){ +function shop_seo_title_update($it_id, $is_edit=false){ global $g5; - $item = get_shop_item($it_id, true); + $shop_item_cache = $is_edit ? false : true; + $item = get_shop_item($it_id, $shop_item_cache); - if( ! $item['it_seo_title'] && $item['it_name'] ){ + if( (! $item['it_seo_title'] || $is_edit) && $item['it_name'] ){ $it_seo_title = exist_seo_title_recursive('shop', generate_seo_title($item['it_name']), $g5['g5_shop_item_table'], $item['it_id']); - if( $it_seo_title ){ + if( isset($item['it_seo_title']) && $it_seo_title !== $item['it_seo_title'] ){ $sql = " update `{$g5['g5_shop_item_table']}` set it_seo_title = '{$it_seo_title}' where it_id = '{$item['it_id']}' "; sql_query($sql); }