그누보드 [G5] 글 작성자가 댓글 비밀글 선택 가능하도록 하기
페이지 정보
본문
게시글 작성자가 댓글의 비밀글 여부를 선택하도록 하는 방법입니다.
1. 그누보드 / skin / board / basic / list.skin.php
상단에 아래 내용을 추가합니다.
// 비밀댓글 필드 추가
$field_query = "SHOW COLUMNS FROM {$write_table} WHERE `Field` = 'wr_comment_secret';";
$field_row = sql_fetch( $field_query );
if(!$field_row['Field']) {
sql_query(" ALTER TABLE `{$write_table}`ADD `wr_comment_secret` varchar(10) NOT NULL ", true);
}
2. 그누보드 / skin / board / basic / write.skin.php
비밀댓글 설정을 위해 적당한 곳에 내용을 추가
2-1. 그누보드5.4 / skin / board / basic / write.skin.php
<div class="write_div">
<label for="ca_name" class="sound_only">비밀댓글</label>
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</div>
2-2. 그누보드5.3 / skin / board / basic / write.skin.php
<div class="write_div">
<span class="sound_only">비밀댓글</span>
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</div>
2-3. 그누보드5.2 / skin / board / basic / write.skin.php
<tr>
<th scope="row">비밀댓글</th>
<td>
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</td>
</tr>
2-4. 아미나 / skin / board / basic / write.skin.php
<div class="form-group">
<label class="col-sm-2 control-label" for="wr_commnet_secret">비밀댓글</label>
<div class="col-sm-10">
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</div>
</div>
3. 그누보드5 / skin / board / basic / write_update.kin.php
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
// 비밀댓글 저장
$sql_comment_secret = " update {$write_table} set wr_comment_secret = '{$_REQUEST['wr_comment_secret']}' where wr_id = '{$wr_id}' ";
sql_query($sql_comment_secret);
4. 그누보드 / skin / board / basic / write_comment.skin.php
댓글 비밀글 설정을 아래와 같이 변경
4-1. 그누보드5.4 / skin / board / basic / write_comment.skin.php
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret" class="selec_chk">
<label for="wr_secret"><span></span>비밀글</label>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다
<?php
} else {
?>
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret" class="selec_chk">
<label for="wr_secret"><span></span>비밀글</label>
<?php
}
?>
4-2. 그누보드5.3 / skin / board / basic / write_comment.skin.php
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret" class="selec_chk">
<label for="wr_secret"><span></span>비밀글</label>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다
<?php
} else {
?>
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret">
<label for="wr_secret"><i class="fa fa-lock" aria-hidden="true"></i><span class="sound_only">비밀글사용</span></label>
<?php
}
?>
4-3. 그누보드5.2 / skin / board / basic / write_comment.skin.php
<th scope="row"><label for="wr_secret">비밀글사용</label></th>
<td><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"></td>
를 아래와 같이 변경
<th scope="row"><label for="wr_secret">비밀글사용</label></th>
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<td><input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다</td>
<?php
} else {
?>
<td><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"></td>
<?php
}
?>
4-4-1. 아미나 / skin / board / basic / view_comment.page.skin.php
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<li><input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다</li>
<?php
} else {
?>
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
<?php
}
?>
4-5-2. 아미나 / skin / board / basic / view_comment.skin.php
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<li><input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다</li>
<?php
} else {
?>
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
<?php
}
?>
1. 그누보드 / skin / board / basic / list.skin.php
상단에 아래 내용을 추가합니다.
// 비밀댓글 필드 추가
$field_query = "SHOW COLUMNS FROM {$write_table} WHERE `Field` = 'wr_comment_secret';";
$field_row = sql_fetch( $field_query );
if(!$field_row['Field']) {
sql_query(" ALTER TABLE `{$write_table}`ADD `wr_comment_secret` varchar(10) NOT NULL ", true);
}
2. 그누보드 / skin / board / basic / write.skin.php
비밀댓글 설정을 위해 적당한 곳에 내용을 추가
2-1. 그누보드5.4 / skin / board / basic / write.skin.php
<div class="write_div">
<label for="ca_name" class="sound_only">비밀댓글</label>
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</div>
2-2. 그누보드5.3 / skin / board / basic / write.skin.php
<div class="write_div">
<span class="sound_only">비밀댓글</span>
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</div>
2-3. 그누보드5.2 / skin / board / basic / write.skin.php
<tr>
<th scope="row">비밀댓글</th>
<td>
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</td>
</tr>
2-4. 아미나 / skin / board / basic / write.skin.php
<div class="form-group">
<label class="col-sm-2 control-label" for="wr_commnet_secret">비밀댓글</label>
<div class="col-sm-10">
<?php //if ($is_admin) { echo "wr_comment_secret=".$write['wr_comment_secret']; } ?>
<input type="checkbox" name="wr_comment_secret" value="1" <?php if ($write['wr_comment_secret']=='1') { echo " checked"; } ?> id="wr_comment_secret">
체크하면 이후 작성되는 댓글은 비밀글로 저장됩니다.<br>
비밀댓글은 작성자와 글 게시자만 열람이 가능합니다.
</div>
</div>
3. 그누보드5 / skin / board / basic / write_update.kin.php
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
// 비밀댓글 저장
$sql_comment_secret = " update {$write_table} set wr_comment_secret = '{$_REQUEST['wr_comment_secret']}' where wr_id = '{$wr_id}' ";
sql_query($sql_comment_secret);
4. 그누보드 / skin / board / basic / write_comment.skin.php
댓글 비밀글 설정을 아래와 같이 변경
4-1. 그누보드5.4 / skin / board / basic / write_comment.skin.php
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret" class="selec_chk">
<label for="wr_secret"><span></span>비밀글</label>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다
<?php
} else {
?>
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret" class="selec_chk">
<label for="wr_secret"><span></span>비밀글</label>
<?php
}
?>
4-2. 그누보드5.3 / skin / board / basic / write_comment.skin.php
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret" class="selec_chk">
<label for="wr_secret"><span></span>비밀글</label>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다
<?php
} else {
?>
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret">
<label for="wr_secret"><i class="fa fa-lock" aria-hidden="true"></i><span class="sound_only">비밀글사용</span></label>
<?php
}
?>
4-3. 그누보드5.2 / skin / board / basic / write_comment.skin.php
<th scope="row"><label for="wr_secret">비밀글사용</label></th>
<td><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"></td>
를 아래와 같이 변경
<th scope="row"><label for="wr_secret">비밀글사용</label></th>
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<td><input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다</td>
<?php
} else {
?>
<td><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"></td>
<?php
}
?>
4-4-1. 아미나 / skin / board / basic / view_comment.page.skin.php
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<li><input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다</li>
<?php
} else {
?>
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
<?php
}
?>
4-5-2. 아미나 / skin / board / basic / view_comment.skin.php
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
를 아래와 같이 변경
<?php
$sql_comment_secret = " select wr_comment_secret from {$write_table} where wr_id='{$wr_id}' ";
$qry_comment_secret = sql_query($sql_comment_secret);
$row_comment_secret = sql_fetch_array($qry_comment_secret);
if ($is_admin) {
//echo $sql_comment_secret."<br>";
//echo "wr_comment_secret = ". $row_comment_secret['wr_comment_secret'];
}
if ($row_comment_secret['wr_comment_secret']=='1') {
?>
<li><input type="hidden" name="wr_secret" value="secret" id="wr_secret"> 비밀글로 작성됩니다</li>
<?php
} else {
?>
<li><label><input type="checkbox" name="wr_secret" value="secret" id="wr_secret"> 비밀글</label></li>
<?php
}
?>
댓글목록
등록된 댓글이 없습니다.