Merge branch 'master' of github.com:gnuboard/yc4s

This commit is contained in:
whitedot
2013-11-21 15:16:46 +09:00
11 changed files with 172 additions and 69 deletions

View File

@ -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_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); 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);
}
?> ?>

View File

@ -541,6 +541,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item_qa` (
`iq_id` int(11) NOT NULL AUTO_INCREMENT, `iq_id` int(11) NOT NULL AUTO_INCREMENT,
`it_id` varchar(20) NOT NULL DEFAULT '', `it_id` varchar(20) NOT NULL DEFAULT '',
`mb_id` varchar(255) 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_name` varchar(255) NOT NULL DEFAULT '',
`iq_password` varchar(255) NOT NULL DEFAULT '', `iq_password` varchar(255) NOT NULL DEFAULT '',
`iq_subject` varchar(255) NOT NULL DEFAULT '', `iq_subject` varchar(255) NOT NULL DEFAULT '',

View File

@ -10,6 +10,8 @@ $w = escape_trim($_REQUEST['w']);
$it_id = escape_trim($_REQUEST['it_id']); $it_id = escape_trim($_REQUEST['it_id']);
$iq_id = escape_trim($_REQUEST['iq_id']); $iq_id = escape_trim($_REQUEST['iq_id']);
$chk_secret = '';
if ($w == "u") if ($w == "u")
{ {
$qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' "); $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']) { if (!$iq_admin && $qa['mb_id'] != $member['mb_id']) {
alert_close("자신의 상품문의만 수정이 가능합니다."); alert_close("자신의 상품문의만 수정이 가능합니다.");
} }
if($qa['iq_secret'])
$chk_secret = 'checked="checked"';
} }
include_once(G5_PATH.'/head.sub.php'); include_once(G5_PATH.'/head.sub.php');

View File

@ -11,14 +11,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<?php <?php
$thumbnail_width = 500; $thumbnail_width = 500;
$iq_num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++) 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_name = get_text($row['iq_name']);
$iq_subject = conv_subject($row['iq_subject'],50,"…"); $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); $iq_time = substr($row['iq_time'], 2, 8);
$hash = md5($row['iq_id'].$row['iq_time'].$row['iq_ip']); $hash = md5($row['iq_id'].$row['iq_time'].$row['iq_ip']);
@ -26,17 +38,19 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$iq_stats = ''; $iq_stats = '';
$iq_style = ''; $iq_style = '';
$iq_answer = ''; $iq_answer = '';
if ($row['iq_answer']) if(!$is_secret) {
{ if ($row['iq_answer'])
$iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); {
$iq_stats = '답변완료'; $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width);
$iq_style = 'sit_qaa_done'; $iq_stats = '답변완료';
$is_answer = true; $iq_style = 'sit_qaa_done';
} else { $is_answer = true;
$iq_stats = '답변전'; } else {
$iq_style = 'sit_qaa_yet'; $iq_stats = '답변전';
$iq_answer = '답변이 등록되지 않았습니다.'; $iq_style = 'sit_qaa_yet';
$is_answer = false; $iq_answer = '답변이 등록되지 않았습니다.';
$is_answer = false;
}
} }
if ($i == 0) echo '<ol id="sit_qa_ol">'; if ($i == 0) echo '<ol id="sit_qa_ol">';
@ -59,10 +73,12 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<strong>문의내용</strong><br> <strong>문의내용</strong><br>
<?php echo $iq_question; // 상품 문의 내용 ?> <?php echo $iq_question; // 상품 문의 내용 ?>
</div> </div>
<?php if(!$is_secret) { ?>
<div class="sit_qa_qaa"> <div class="sit_qa_qaa">
<strong>답변</strong><br> <strong>답변</strong><br>
<?php echo $iq_answer; ?> <?php echo $iq_answer; ?>
</div> </div>
<?php } ?>
</div> </div>
<?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?> <?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?>
@ -76,7 +92,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
</div> </div>
</li> </li>
<?php } <?php
$iq_num--;
}
if ($i >= 0) echo '</ol>'; if ($i >= 0) echo '</ol>';

View File

@ -20,6 +20,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<col> <col>
</colgroup> </colgroup>
<tbody> <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> <tr>
<th scope="row"><label for="iq_subject">제목</label></th> <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> <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>

View File

@ -32,29 +32,41 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<?php <?php
$thumbnail_width = 500; $thumbnail_width = 500;
$num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i=0; $row=sql_fetch_array($result); $i++)
{ {
$num = $total_count - ($page - 1) * $rows - $i; $iq_subject = conv_subject($row['iq_subject'],50,"…");
$star = get_star($row['is_score']);
$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']; $it_href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); if(!$is_secret) {
if ($row['iq_answer'])
if ($row['iq_answer']) {
{ $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width);
$iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); $iq_stats = '답변완료';
$iq_stats = '답변완료'; $iq_style = 'sit_qaa_done';
$iq_style = 'sit_qaa_done'; $is_answer = true;
$is_answer = true; } else {
} else { $iq_stats = '답변전';
$iq_stats = '답변전'; $iq_style = 'sit_qaa_yet';
$iq_style = 'sit_qaa_yet'; $iq_answer = '답변이 등록되지 않았습니다.';
$iq_answer = '답변이 등록되지 않았습니다.'; $is_answer = false;
$is_answer = false; }
} }
if ($i == 0) echo '<ol>'; if ($i == 0) echo '<ol>';
@ -63,13 +75,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<div class="sqa_img"> <div class="sqa_img">
<a href="<?php echo $it_href; ?>"> <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> <span><?php echo $row['it_name']; ?></span>
</a> </a>
</div> </div>
<section class="sqa_section"> <section class="sqa_section">
<h2><?php echo $row['iq_subject']; ?></h2> <h2><?php echo $iq_subject; ?></h2>
<dl class="sqa_dl"> <dl class="sqa_dl">
<dt>작성자</dt> <dt>작성자</dt>
@ -85,17 +97,22 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<strong>문의내용</strong><br> <strong>문의내용</strong><br>
<?php echo $iq_question; // 상품 문의 내용 ?> <?php echo $iq_question; // 상품 문의 내용 ?>
</div> </div>
<?php if(!$is_secret) { ?>
<div class="sit_qa_qaa"> <div class="sit_qa_qaa">
<strong>답변</strong><br> <strong>답변</strong><br>
<?php echo $iq_answer; ?> <?php echo $iq_answer; ?>
</div> </div>
<?php } ?>
</div> </div>
<div class="sqa_con_btn"><button class="sqa_con_<?php echo $i; ?>">보기</button></div> <div class="sqa_con_btn"><button class="sqa_con_<?php echo $i; ?>">보기</button></div>
</section> </section>
</li> </li>
<?php } <?php
$num--;
}
if ($i > 0) echo '</ol>'; if ($i > 0) echo '</ol>';
if ($i == 0) echo '<p id="sps_empty">자료가 없습니다.</p>'; if ($i == 0) echo '<p id="sps_empty">자료가 없습니다.</p>';
?> ?>

View File

@ -16,6 +16,8 @@ $w = escape_trim($_REQUEST['w']);
$it_id = escape_trim($_REQUEST['it_id']); $it_id = escape_trim($_REQUEST['it_id']);
$iq_id = escape_trim($_REQUEST['iq_id']); $iq_id = escape_trim($_REQUEST['iq_id']);
$chk_secret = '';
if ($w == "u") if ($w == "u")
{ {
$qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' "); $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']) { if (!$iq_admin && $qa['mb_id'] != $member['mb_id']) {
alert_close("자신의 상품문의만 수정이 가능합니다."); alert_close("자신의 상품문의만 수정이 가능합니다.");
} }
if($qa['iq_secret'])
$chk_secret = 'checked="checked"';
} }
include_once(G5_PATH.'/head.sub.php'); include_once(G5_PATH.'/head.sub.php');

View File

@ -26,6 +26,7 @@ if ($w == "")
$sql = "insert {$g5['g5_shop_item_qa_table']} $sql = "insert {$g5['g5_shop_item_qa_table']}
set it_id = '$it_id', set it_id = '$it_id',
mb_id = '{$member['mb_id']}', mb_id = '{$member['mb_id']}',
iq_secret = '$iq_secret',
iq_name = '$iq_name', iq_name = '$iq_name',
iq_password = '$iq_password', iq_password = '$iq_password',
iq_subject = '$iq_subject', iq_subject = '$iq_subject',
@ -47,7 +48,8 @@ else if ($w == "u")
} }
$sql = " update {$g5['g5_shop_item_qa_table']} $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' iq_question = '$iq_question'
where iq_id = '$iq_id' "; where iq_id = '$iq_id' ";
sql_query($sql); sql_query($sql);

View File

@ -11,14 +11,26 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<?php <?php
$thumbnail_width = 500; $thumbnail_width = 500;
$iq_num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++) 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_name = get_text($row['iq_name']);
$iq_subject = conv_subject($row['iq_subject'],50,"…"); $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); $iq_time = substr($row['iq_time'], 2, 8);
$hash = md5($row['iq_id'].$row['iq_time'].$row['iq_ip']); $hash = md5($row['iq_id'].$row['iq_time'].$row['iq_ip']);
@ -26,17 +38,19 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$iq_stats = ''; $iq_stats = '';
$iq_style = ''; $iq_style = '';
$iq_answer = ''; $iq_answer = '';
if ($row['iq_answer']) if(!$is_secret) {
{ if ($row['iq_answer'])
$iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); {
$iq_stats = '답변완료'; $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width);
$iq_style = 'sit_qaa_done'; $iq_stats = '답변완료';
$is_answer = true; $iq_style = 'sit_qaa_done';
} else { $is_answer = true;
$iq_stats = '답변전'; } else {
$iq_style = 'sit_qaa_yet'; $iq_stats = '답변전';
$iq_answer = '답변이 등록되지 않았습니다.'; $iq_style = 'sit_qaa_yet';
$is_answer = false; $iq_answer = '답변이 등록되지 않았습니다.';
$is_answer = false;
}
} }
if ($i == 0) echo '<ol id="sit_qa_ol">'; if ($i == 0) echo '<ol id="sit_qa_ol">';
@ -59,10 +73,12 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<strong>문의내용</strong><br> <strong>문의내용</strong><br>
<?php echo $iq_question; // 상품 문의 내용 ?> <?php echo $iq_question; // 상품 문의 내용 ?>
</div> </div>
<?php if(!$is_secret) { ?>
<div class="sit_qa_qaa"> <div class="sit_qa_qaa">
<strong>답변</strong><br> <strong>답변</strong><br>
<?php echo $iq_answer; ?> <?php echo $iq_answer; ?>
</div> </div>
<?php } ?>
</div> </div>
<?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?> <?php if ($is_admin || ($row['mb_id'] == $member['mb_id'] && !$is_answer)) { ?>
@ -76,7 +92,9 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
</div> </div>
</li> </li>
<?php } <?php
$iq_num--;
}
if ($i >= 0) echo '</ol>'; if ($i >= 0) echo '</ol>';

View File

@ -20,6 +20,13 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<col> <col>
</colgroup> </colgroup>
<tbody> <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> <tr>
<th scope="row"><label for="iq_subject">제목</label></th> <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> <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>

View File

@ -33,29 +33,41 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<?php <?php
$thumbnail_width = 500; $thumbnail_width = 500;
$num = $total_count - ($page - 1) * $rows;
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i=0; $row=sql_fetch_array($result); $i++)
{ {
$num = $total_count - ($page - 1) * $rows - $i; $iq_subject = conv_subject($row['iq_subject'],50,"…");
$star = get_star($row['is_score']);
$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']; $it_href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
$iq_question = get_view_thumbnail($row['iq_question'], $thumbnail_width); if(!$is_secret) {
if ($row['iq_answer'])
if ($row['iq_answer']) {
{ $iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width);
$iq_answer = get_view_thumbnail($row['iq_answer'], $thumbnail_width); $iq_stats = '답변완료';
$iq_stats = '답변완료'; $iq_style = 'sit_qaa_done';
$iq_style = 'sit_qaa_done'; $is_answer = true;
$is_answer = true; } else {
} else { $iq_stats = '답변전';
$iq_stats = '답변전'; $iq_style = 'sit_qaa_yet';
$iq_style = 'sit_qaa_yet'; $iq_answer = '답변이 등록되지 않았습니다.';
$iq_answer = '답변이 등록되지 않았습니다.'; $is_answer = false;
$is_answer = false; }
} }
if ($i == 0) echo '<ol>'; if ($i == 0) echo '<ol>';
@ -64,13 +76,13 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<div class="sqa_img"> <div class="sqa_img">
<a href="<?php echo $it_href; ?>"> <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> <span><?php echo $row['it_name']; ?></span>
</a> </a>
</div> </div>
<section class="sqa_section"> <section class="sqa_section">
<h2><?php echo $row['iq_subject']; ?></h2> <h2><?php echo $iq_subject; ?></h2>
<dl class="sqa_dl"> <dl class="sqa_dl">
<dt>작성자</dt> <dt>작성자</dt>
@ -86,17 +98,22 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<strong>문의내용</strong><br> <strong>문의내용</strong><br>
<?php echo $iq_question; // 상품 문의 내용 ?> <?php echo $iq_question; // 상품 문의 내용 ?>
</div> </div>
<?php if(!$is_secret) { ?>
<div class="sit_qa_qaa"> <div class="sit_qa_qaa">
<strong>답변</strong><br> <strong>답변</strong><br>
<?php echo $iq_answer; ?> <?php echo $iq_answer; ?>
</div> </div>
<?php } ?>
</div> </div>
<div class="sqa_con_btn"><button class="sqa_con_<?php echo $i; ?>">보기</button></div> <div class="sqa_con_btn"><button class="sqa_con_<?php echo $i; ?>">보기</button></div>
</section> </section>
</li> </li>
<?php } <?php
$num--;
}
if ($i > 0) echo '</ol>'; if ($i > 0) echo '</ol>';
if ($i == 0) echo '<p id="sqa_empty">자료가 없습니다.</p>'; if ($i == 0) echo '<p id="sqa_empty">자료가 없습니다.</p>';
?> ?>