#328 상품문의에 비밀글 추가
This commit is contained in:
@ -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);
|
||||
}
|
||||
?>
|
||||
|
||||
@ -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 '',
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -11,14 +11,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<?php
|
||||
$thumbnail_width = 500;
|
||||
$iq_num = $total_count - ($page - 1) * $rows;
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$iq_num = $total_count - ($page - 1) * $rows - $i;
|
||||
$iq_star = get_star($row['iq_score']);
|
||||
$iq_name = get_text($row['iq_name']);
|
||||
$iq_subject = conv_subject($row['iq_subject'],50,"…");
|
||||
$iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width);
|
||||
|
||||
$is_secret = false;
|
||||
if($row['iq_secret']) {
|
||||
$iq_subject .= ' <img src="'.G5_SHOP_SKIN_URL.'/img/icon_secret.png">';
|
||||
|
||||
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 '<ol id="sit_qa_ol">';
|
||||
@ -59,10 +73,12 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; // 상품 문의 내용 ?>
|
||||
</div>
|
||||
<?php if(!$is_secret) { ?>
|
||||
<div class="sit_qa_qaa">
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?>
|
||||
@ -76,7 +92,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php }
|
||||
<?php
|
||||
$iq_num--;
|
||||
}
|
||||
|
||||
if ($i >= 0) echo '</ol>';
|
||||
|
||||
|
||||
@ -20,6 +20,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">옵션</th>
|
||||
<td>
|
||||
<input type="checkbox" name="iq_secret" value="1" <?php echo $chk_secret; ?>>
|
||||
<label for="iq_secret">비밀글</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_subject">제목</label></th>
|
||||
<td><input type="text" name="iq_subject" value="<?php echo get_text($qa['iq_subject']); ?>" id="iq_subject" required class="required frm_input" minlength="2" maxlength="250"></td>
|
||||
|
||||
@ -32,29 +32,41 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<?php
|
||||
$thumbnail_width = 500;
|
||||
$num = $total_count - ($page - 1) * $rows;
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$num = $total_count - ($page - 1) * $rows - $i;
|
||||
$star = get_star($row['is_score']);
|
||||
$iq_subject = conv_subject($row['iq_subject'],50,"…");
|
||||
|
||||
$small_image = $row['it_id'];
|
||||
$is_secret = false;
|
||||
if($row['iq_secret']) {
|
||||
$iq_subject .= ' <img src="'.G5_SHOP_SKIN_URL.'/img/icon_secret.png">';
|
||||
|
||||
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 '<ol>';
|
||||
@ -63,13 +75,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<div class="sqa_img">
|
||||
<a href="<?php echo $it_href; ?>">
|
||||
<?php echo get_it_image($small_image, 70, 70); ?>
|
||||
<?php echo get_it_image($row['it_id'], 70, 70); ?>
|
||||
<span><?php echo $row['it_name']; ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<section class="sqa_section">
|
||||
<h2><?php echo $row['iq_subject']; ?></h2>
|
||||
<h2><?php echo $iq_subject; ?></h2>
|
||||
|
||||
<dl class="sqa_dl">
|
||||
<dt>작성자</dt>
|
||||
@ -85,17 +97,22 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; // 상품 문의 내용 ?>
|
||||
</div>
|
||||
<?php if(!$is_secret) { ?>
|
||||
<div class="sit_qa_qaa">
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="sqa_con_btn"><button class="sqa_con_<?php echo $i; ?>">보기</button></div>
|
||||
</section>
|
||||
|
||||
</li>
|
||||
<?php }
|
||||
<?php
|
||||
$num--;
|
||||
}
|
||||
|
||||
if ($i > 0) echo '</ol>';
|
||||
if ($i == 0) echo '<p id="sps_empty">자료가 없습니다.</p>';
|
||||
?>
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -11,14 +11,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<?php
|
||||
$thumbnail_width = 500;
|
||||
$iq_num = $total_count - ($page - 1) * $rows;
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$iq_num = $total_count - ($page - 1) * $rows - $i;
|
||||
$iq_star = get_star($row['iq_score']);
|
||||
$iq_name = get_text($row['iq_name']);
|
||||
$iq_subject = conv_subject($row['iq_subject'],50,"…");
|
||||
$iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width);
|
||||
|
||||
$is_secret = false;
|
||||
if($row['iq_secret']) {
|
||||
$iq_subject .= ' <img src="'.G5_SHOP_SKIN_URL.'/img/icon_secret.png">';
|
||||
|
||||
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 '<ol id="sit_qa_ol">';
|
||||
@ -59,10 +73,12 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; // 상품 문의 내용 ?>
|
||||
</div>
|
||||
<?php if(!$is_secret) { ?>
|
||||
<div class="sit_qa_qaa">
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?>
|
||||
@ -76,7 +92,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php }
|
||||
<?php
|
||||
$iq_num--;
|
||||
}
|
||||
|
||||
if ($i >= 0) echo '</ol>';
|
||||
|
||||
|
||||
@ -20,6 +20,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">옵션</th>
|
||||
<td>
|
||||
<input type="checkbox" name="iq_secret" value="1" <?php echo $chk_secret; ?>>
|
||||
<label for="iq_secret">비밀글</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_subject">제목</label></th>
|
||||
<td><input type="text" name="iq_subject" value="<?php echo get_text($qa['iq_subject']); ?>" id="iq_subject" required class="required frm_input" minlength="2" maxlength="250"></td>
|
||||
|
||||
@ -33,29 +33,41 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<?php
|
||||
$thumbnail_width = 500;
|
||||
$num = $total_count - ($page - 1) * $rows;
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$num = $total_count - ($page - 1) * $rows - $i;
|
||||
$star = get_star($row['is_score']);
|
||||
$iq_subject = conv_subject($row['iq_subject'],50,"…");
|
||||
|
||||
$small_image = $row['it_id'];
|
||||
$is_secret = false;
|
||||
if($row['iq_secret']) {
|
||||
$iq_subject .= ' <img src="'.G5_SHOP_SKIN_URL.'/img/icon_secret.png">';
|
||||
|
||||
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 '<ol>';
|
||||
@ -64,13 +76,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<div class="sqa_img">
|
||||
<a href="<?php echo $it_href; ?>">
|
||||
<?php echo get_it_image($small_image, 70, 70); ?>
|
||||
<?php echo get_it_image($row['it_id'], 70, 70); ?>
|
||||
<span><?php echo $row['it_name']; ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<section class="sqa_section">
|
||||
<h2><?php echo $row['iq_subject']; ?></h2>
|
||||
<h2><?php echo $iq_subject; ?></h2>
|
||||
|
||||
<dl class="sqa_dl">
|
||||
<dt>작성자</dt>
|
||||
@ -86,17 +98,22 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; // 상품 문의 내용 ?>
|
||||
</div>
|
||||
<?php if(!$is_secret) { ?>
|
||||
<div class="sit_qa_qaa">
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="sqa_con_btn"><button class="sqa_con_<?php echo $i; ?>">보기</button></div>
|
||||
</section>
|
||||
|
||||
</li>
|
||||
<?php }
|
||||
<?php
|
||||
$num--;
|
||||
}
|
||||
|
||||
if ($i > 0) echo '</ol>';
|
||||
if ($i == 0) echo '<p id="sqa_empty">자료가 없습니다.</p>';
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user