From 9f9f581f111c4d1ef493a3413c5406ae7cc8b7f2 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 21 Nov 2013 15:07:14 +0900 Subject: [PATCH] =?UTF-8?q?#328=20=EC=83=81=ED=92=88=EB=AC=B8=EC=9D=98?= =?UTF-8?q?=EC=97=90=20=EB=B9=84=EB=B0=80=EA=B8=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/shop.extend2.php | 6 +++ install/gnuboard5shop.sql | 1 + mobile/shop/itemqaform.php | 5 ++ mobile/skin/shop/basic/itemqa.skin.php | 48 +++++++++++++------ mobile/skin/shop/basic/itemqaform.skin.php | 7 +++ mobile/skin/shop/basic/itemqalist.skin.php | 55 ++++++++++++++-------- shop/itemqaform.php | 5 ++ shop/itemqaformupdate.php | 4 +- skin/shop/basic/itemqa.skin.php | 48 +++++++++++++------ skin/shop/basic/itemqaform.skin.php | 7 +++ skin/shop/basic/itemqalist.skin.php | 55 ++++++++++++++-------- 11 files changed, 172 insertions(+), 69 deletions(-) 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 '
    '; @@ -59,10 +73,12 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 문의내용
    +
    답변
    + @@ -76,7 +92,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 - = 0) echo '
'; diff --git a/mobile/skin/shop/basic/itemqaform.skin.php b/mobile/skin/shop/basic/itemqaform.skin.php index 408d8f6c2..5343b2ea6 100644 --- a/mobile/skin/shop/basic/itemqaform.skin.php +++ b/mobile/skin/shop/basic/itemqaform.skin.php @@ -20,6 +20,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 + + 옵션 + + > + + + diff --git a/mobile/skin/shop/basic/itemqalist.skin.php b/mobile/skin/shop/basic/itemqalist.skin.php index ce76e8f59..bd5c1a0e5 100644 --- a/mobile/skin/shop/basic/itemqalist.skin.php +++ b/mobile/skin/shop/basic/itemqalist.skin.php @@ -32,29 +32,41 @@ 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); + } $it_href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id']; - $iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); - - 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 '
    '; @@ -63,13 +75,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
    -

    +

    작성자
    @@ -85,17 +97,22 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 문의내용
    +
    답변
    +
    - 0) echo '
'; 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 '
    '; @@ -59,10 +73,12 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 문의내용
    +
    답변
    + @@ -76,7 +92,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 - = 0) echo '
'; diff --git a/skin/shop/basic/itemqaform.skin.php b/skin/shop/basic/itemqaform.skin.php index 428e67292..f6e50f071 100644 --- a/skin/shop/basic/itemqaform.skin.php +++ b/skin/shop/basic/itemqaform.skin.php @@ -20,6 +20,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 + + 옵션 + + > + + + diff --git a/skin/shop/basic/itemqalist.skin.php b/skin/shop/basic/itemqalist.skin.php index 403917b2f..377a9e2ad 100644 --- a/skin/shop/basic/itemqalist.skin.php +++ b/skin/shop/basic/itemqalist.skin.php @@ -33,29 +33,41 @@ 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); + } $it_href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id']; - $iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); - - 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 '
    '; @@ -64,13 +76,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
    -

    +

    작성자
    @@ -86,17 +98,22 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 문의내용
    +
    답변
    +
    - 0) echo '
'; if ($i == 0) echo '

자료가 없습니다.

'; ?>