그누보드 [G4] 게시글 댓글(코멘트) 날짜 수정
페이지 정보
본문
게시물 댓글(코멘트) 날짜 수정 하는 방법입니다
1. skin / board / basic / view_comment.skin.php 67라인 에서
<input type=hidden id='secret_comment_<?=$comment_id?>' value="<?=strstr($list[$i][wr_option],"secret")?>">
밑으로 아래 소스를 추가합니다.
<?php if ($is_admin) { ?>
<tr>
<td style="padding-left:20px; background:url(<?php echo $board_skin_path; ?>/img/co_title_bg.gif); line-height:28px;"><form name='hp_comment_update' method='post' style='padding:0;' action="<?php echo $board_skin_path; ?>/view_comment_dateupdate.php">
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>" />
<input type="hidden" name="wr_id" value="<?php echo $wr_id; ?>" />
<input type="hidden" name="page" value="<?php echo $page; ?>" />
<input type="hidden" name="sca" value="<?php echo $sca; ?>" />
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>" />
<input type="hidden" name="stx" value="<?php echo $stx; ?>" />
<input type="hidden" name="spt" value="<?php echo $spt; ?>" />
<input type="hidden" name="page" value="<?php echo $page; ?>" />
<input type="hidden" name="cwin" value="<?php echo $cwin; ?>" />
<input type="hidden" name="is_good" value="" />
<?php
//echo $comment_id;
$sql_comment = " select wr_id, wr_datetime from {$write_table} where wr_id = '{$comment_id}' ";
//echo $sql_comment;
$result_comment = sql_query($sql_comment);
while($row_comment = mysql_fetch_array($result_comment)) {
//echo $comment_id;
?>
<input type="hidden" name="cid" value="<?php echo $comment_id; ?>" />
작성일 <input required style="width:140px;" name="cdate" maxlength="19" value="<?php echo $row_comment['wr_datetime']; ?>" />
<input type="submit" name="submit" value="수정" />
<?php
}
?>
</form></td>
</tr>
<?php } ?>
2. skin / board / basic / view_comment_dateupdate.php 파일을 신규로 생성합니다.
<?php
include_once "_common.php";
include_once "../../../dbconfig.php";
if(!is_admin) {
echo 'Administrators only';
exit;
}
$dbconn = mysql_connect("{$mysql_host}","{$mysql_user}","{$mysql_password}") or die("데이터베이스 연결에 실패하였습니다.");
mysql_select_db($mysql_db, $dbconn);
$sql = "update {$write_table} set wr_datetime = '{$_POST['cdate']}' where wr_id = '{$_POST['cid']}' ";
$result=mysql_query($sql,$dbconn);
echo mysql_error();
mysql_close($dbconn); // MySQL에 접속종료
// 그누보드 설치경로를 확인해서 오류나면 아래 링크를 수정하세요.
echo " <script>alert('Has been modified.'); document.location.href='/bbs/board.php?bo_table={$_POST['bo_table']}&wr_id={$_POST['wr_id']}&page={$_POST['page']}&sca={$_POST['sca']}&sfl={$_POST['sfl']}&stx={$_POST['stx']}&spt={$_POST['spt']}&page={$_POST['page']}&cwin={$_POST['cwin']}&is_good={$_POST['is_good']}'; </script>";
1. skin / board / basic / view_comment.skin.php 67라인 에서
<input type=hidden id='secret_comment_<?=$comment_id?>' value="<?=strstr($list[$i][wr_option],"secret")?>">
밑으로 아래 소스를 추가합니다.
<?php if ($is_admin) { ?>
<tr>
<td style="padding-left:20px; background:url(<?php echo $board_skin_path; ?>/img/co_title_bg.gif); line-height:28px;"><form name='hp_comment_update' method='post' style='padding:0;' action="<?php echo $board_skin_path; ?>/view_comment_dateupdate.php">
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>" />
<input type="hidden" name="wr_id" value="<?php echo $wr_id; ?>" />
<input type="hidden" name="page" value="<?php echo $page; ?>" />
<input type="hidden" name="sca" value="<?php echo $sca; ?>" />
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>" />
<input type="hidden" name="stx" value="<?php echo $stx; ?>" />
<input type="hidden" name="spt" value="<?php echo $spt; ?>" />
<input type="hidden" name="page" value="<?php echo $page; ?>" />
<input type="hidden" name="cwin" value="<?php echo $cwin; ?>" />
<input type="hidden" name="is_good" value="" />
<?php
//echo $comment_id;
$sql_comment = " select wr_id, wr_datetime from {$write_table} where wr_id = '{$comment_id}' ";
//echo $sql_comment;
$result_comment = sql_query($sql_comment);
while($row_comment = mysql_fetch_array($result_comment)) {
//echo $comment_id;
?>
<input type="hidden" name="cid" value="<?php echo $comment_id; ?>" />
작성일 <input required style="width:140px;" name="cdate" maxlength="19" value="<?php echo $row_comment['wr_datetime']; ?>" />
<input type="submit" name="submit" value="수정" />
<?php
}
?>
</form></td>
</tr>
<?php } ?>
2. skin / board / basic / view_comment_dateupdate.php 파일을 신규로 생성합니다.
<?php
include_once "_common.php";
include_once "../../../dbconfig.php";
if(!is_admin) {
echo 'Administrators only';
exit;
}
$dbconn = mysql_connect("{$mysql_host}","{$mysql_user}","{$mysql_password}") or die("데이터베이스 연결에 실패하였습니다.");
mysql_select_db($mysql_db, $dbconn);
$sql = "update {$write_table} set wr_datetime = '{$_POST['cdate']}' where wr_id = '{$_POST['cid']}' ";
$result=mysql_query($sql,$dbconn);
echo mysql_error();
mysql_close($dbconn); // MySQL에 접속종료
// 그누보드 설치경로를 확인해서 오류나면 아래 링크를 수정하세요.
echo " <script>alert('Has been modified.'); document.location.href='/bbs/board.php?bo_table={$_POST['bo_table']}&wr_id={$_POST['wr_id']}&page={$_POST['page']}&sca={$_POST['sca']}&sfl={$_POST['sfl']}&stx={$_POST['stx']}&spt={$_POST['spt']}&page={$_POST['page']}&cwin={$_POST['cwin']}&is_good={$_POST['is_good']}'; </script>";
댓글목록
등록된 댓글이 없습니다.