diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php index 8eacb7e2a..ddb151b4e 100644 --- a/extend/shop.extend2.php +++ b/extend/shop.extend2.php @@ -718,4 +718,10 @@ if(!sql_query(" select de_mobile_search_list_skin from {$g5['g5_shop_default_tab ADD `de_mobile_search_img_width` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_search_list_mod`, ADD `de_mobile_search_img_height` int(11) NOT NULL DEFAULT '0' AFTER `de_mobile_search_img_width` ", true); } + +// 상품문의 비밀글 필드 추가 +if(!sql_query(" select iq_secret from {$g5['g5_shop_item_qa_table']} limit 1 ", false)) { + sql_query(" ALTER TABLE `{$g5['g5_shop_item_qa_table']}` + ADD `iq_secret` tinyint(4) NOT NULL DEFAULT '0' AFTER `mb_id` ", true); +} ?> diff --git a/install/gnuboard5shop.sql b/install/gnuboard5shop.sql index 1700b9e76..c2095d059 100644 --- a/install/gnuboard5shop.sql +++ b/install/gnuboard5shop.sql @@ -541,6 +541,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item_qa` ( `iq_id` int(11) NOT NULL AUTO_INCREMENT, `it_id` varchar(20) NOT NULL DEFAULT '', `mb_id` varchar(255) NOT NULL DEFAULT '', + `iq_secret` tinyint(4) NOT NULL DEFAULT '0', `iq_name` varchar(255) NOT NULL DEFAULT '', `iq_password` varchar(255) NOT NULL DEFAULT '', `iq_subject` varchar(255) NOT NULL DEFAULT '', diff --git a/mobile/shop/itemqaform.php b/mobile/shop/itemqaform.php index 279205068..d897f0acf 100644 --- a/mobile/shop/itemqaform.php +++ b/mobile/shop/itemqaform.php @@ -10,6 +10,8 @@ $w = escape_trim($_REQUEST['w']); $it_id = escape_trim($_REQUEST['it_id']); $iq_id = escape_trim($_REQUEST['iq_id']); +$chk_secret = ''; + if ($w == "u") { $qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' "); @@ -22,6 +24,9 @@ if ($w == "u") if (!$iq_admin && $qa['mb_id'] != $member['mb_id']) { alert_close("자신의 상품문의만 수정이 가능합니다."); } + + if($qa['iq_secret']) + $chk_secret = 'checked="checked"'; } include_once(G5_PATH.'/head.sub.php'); diff --git a/mobile/skin/shop/basic/itemqa.skin.php b/mobile/skin/shop/basic/itemqa.skin.php index 84fb0ef4e..4cee17de9 100644 --- a/mobile/skin/shop/basic/itemqa.skin.php +++ b/mobile/skin/shop/basic/itemqa.skin.php @@ -11,14 +11,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 '; + + if($is_admin || $member['mb_id' ] == $row['mb_id']) { + $iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); + } else { + $iq_question = '비밀글로 보호된 문의입니다.'; + $is_secret = true; + } + } else { + $iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); + } $iq_time = substr($row['iq_time'], 2, 8); $hash = md5($row['iq_id'].$row['iq_time'].$row['iq_ip']); @@ -26,17 +38,19 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 $iq_stats = ''; $iq_style = ''; $iq_answer = ''; - if ($row['iq_answer']) - { - $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); - $iq_stats = '답변완료'; - $iq_style = 'sit_qaa_done'; - $is_answer = true; - } else { - $iq_stats = '답변전'; - $iq_style = 'sit_qaa_yet'; - $iq_answer = '답변이 등록되지 않았습니다.'; - $is_answer = false; + if(!$is_secret) { + if ($row['iq_answer']) + { + $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); + $iq_stats = '답변완료'; + $iq_style = 'sit_qaa_done'; + $is_answer = true; + } else { + $iq_stats = '답변전'; + $iq_style = 'sit_qaa_yet'; + $iq_answer = '답변이 등록되지 않았습니다.'; + $is_answer = false; + } } if ($i == 0) echo '
자료가 없습니다.
'; ?> diff --git a/shop/itemqaform.php b/shop/itemqaform.php index 16d2a1a38..6db24e1f6 100644 --- a/shop/itemqaform.php +++ b/shop/itemqaform.php @@ -16,6 +16,8 @@ $w = escape_trim($_REQUEST['w']); $it_id = escape_trim($_REQUEST['it_id']); $iq_id = escape_trim($_REQUEST['iq_id']); +$chk_secret = ''; + if ($w == "u") { $qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' "); @@ -28,6 +30,9 @@ if ($w == "u") if (!$iq_admin && $qa['mb_id'] != $member['mb_id']) { alert_close("자신의 상품문의만 수정이 가능합니다."); } + + if($qa['iq_secret']) + $chk_secret = 'checked="checked"'; } include_once(G5_PATH.'/head.sub.php'); diff --git a/shop/itemqaformupdate.php b/shop/itemqaformupdate.php index 408005e09..922dd882d 100644 --- a/shop/itemqaformupdate.php +++ b/shop/itemqaformupdate.php @@ -26,6 +26,7 @@ if ($w == "") $sql = "insert {$g5['g5_shop_item_qa_table']} set it_id = '$it_id', mb_id = '{$member['mb_id']}', + iq_secret = '$iq_secret', iq_name = '$iq_name', iq_password = '$iq_password', iq_subject = '$iq_subject', @@ -47,7 +48,8 @@ else if ($w == "u") } $sql = " update {$g5['g5_shop_item_qa_table']} - set iq_subject = '$iq_subject', + set iq_secret = '$iq_secret', + iq_subject = '$iq_subject', iq_question = '$iq_question' where iq_id = '$iq_id' "; sql_query($sql); diff --git a/skin/shop/basic/itemqa.skin.php b/skin/shop/basic/itemqa.skin.php index bb810c8b3..5a5c51a02 100644 --- a/skin/shop/basic/itemqa.skin.php +++ b/skin/shop/basic/itemqa.skin.php @@ -11,14 +11,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 '; + + if($is_admin || $member['mb_id' ] == $row['mb_id']) { + $iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); + } else { + $iq_question = '비밀글로 보호된 문의입니다.'; + $is_secret = true; + } + } else { + $iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); + } $iq_time = substr($row['iq_time'], 2, 8); $hash = md5($row['iq_id'].$row['iq_time'].$row['iq_ip']); @@ -26,17 +38,19 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 $iq_stats = ''; $iq_style = ''; $iq_answer = ''; - if ($row['iq_answer']) - { - $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); - $iq_stats = '답변완료'; - $iq_style = 'sit_qaa_done'; - $is_answer = true; - } else { - $iq_stats = '답변전'; - $iq_style = 'sit_qaa_yet'; - $iq_answer = '답변이 등록되지 않았습니다.'; - $is_answer = false; + if(!$is_secret) { + if ($row['iq_answer']) + { + $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); + $iq_stats = '답변완료'; + $iq_style = 'sit_qaa_done'; + $is_answer = true; + } else { + $iq_stats = '답변전'; + $iq_style = 'sit_qaa_yet'; + $iq_answer = '답변이 등록되지 않았습니다.'; + $is_answer = false; + } } if ($i == 0) echo '자료가 없습니다.
'; ?>