그누보드 [G5] 아이디당 하나의 게시글을 작성을 허용하고 싶을때
페이지 정보
본문
게시판에 아이디당 글을 한개만 작성하도록 하고 싶을때 아래와 같이 스킨을 수정합니다.
관리자일때는 예외로 2개 이상을 작성할 수 있습니다.
2017-05-23 쿼리 오류 수정
1. 그누보드5 / skin / board / 폴더 / list.skin.php
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>
를 아래와 같이 변경
<?php
if ($write_href) {
$sql_sum = " select count(*) as cnt from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' ";
$row_sum = sql_fetch($sql_sum);
if ($row_sum["cnt"] < 1 || $admin_href) {
echo "<li><a href='". $write_href ."' class='btn_b02'>글쓰기</a></li>";
} elseif ($row_sum["cnt"] == 1) {
$sql_view = " select wr_id from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' order by wr_id desc ";
$row_view = sql_fetch($sql_view);
echo "<li><a href='". G5_BBS_URL ."/board.php?bo_table=". $_GET["bo_table"] ."&wr_id=". $row_view['wr_id'] ."' class='btn_b02'>글보기</a></li>";
} else {
echo "";
}
}
?>
2. 그누보드5 / skin / board / 폴더 / view.skin.php
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>
를 아래와 같이 변경
<?php
if ($write_href) {
$sql_sum = " select count(*) as cnt from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' ";
$row_sum = sql_fetch($sql_sum);
if ($row_sum["cnt"] < 1 || $admin_href) {
echo "<li><a href='". $write_href ."' class='btn_b02'>글쓰기</a></li>";
} elseif ($row_sum["cnt"] == 1) {
$sql_view = " select wr_id from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' order by wr_id desc ";
$row_view = sql_fetch($sql_view);
echo "<li><a href='". G5_BBS_URL ."/board.php?bo_table=". $_GET["bo_table"] ."&wr_id=". $row_view['wr_id'] ."' class='btn_b02'>글보기</a></li>";
} else {
echo "";
}
}
?>
관리자일때는 예외로 2개 이상을 작성할 수 있습니다.
2017-05-23 쿼리 오류 수정
1. 그누보드5 / skin / board / 폴더 / list.skin.php
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>
를 아래와 같이 변경
<?php
if ($write_href) {
$sql_sum = " select count(*) as cnt from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' ";
$row_sum = sql_fetch($sql_sum);
if ($row_sum["cnt"] < 1 || $admin_href) {
echo "<li><a href='". $write_href ."' class='btn_b02'>글쓰기</a></li>";
} elseif ($row_sum["cnt"] == 1) {
$sql_view = " select wr_id from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' order by wr_id desc ";
$row_view = sql_fetch($sql_view);
echo "<li><a href='". G5_BBS_URL ."/board.php?bo_table=". $_GET["bo_table"] ."&wr_id=". $row_view['wr_id'] ."' class='btn_b02'>글보기</a></li>";
} else {
echo "";
}
}
?>
2. 그누보드5 / skin / board / 폴더 / view.skin.php
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>
를 아래와 같이 변경
<?php
if ($write_href) {
$sql_sum = " select count(*) as cnt from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' ";
$row_sum = sql_fetch($sql_sum);
if ($row_sum["cnt"] < 1 || $admin_href) {
echo "<li><a href='". $write_href ."' class='btn_b02'>글쓰기</a></li>";
} elseif ($row_sum["cnt"] == 1) {
$sql_view = " select wr_id from ". $g5['write_prefix'] . $_GET["bo_table"] ." where mb_id='". $member['mb_id'] ."' and wr_is_comment='0' order by wr_id desc ";
$row_view = sql_fetch($sql_view);
echo "<li><a href='". G5_BBS_URL ."/board.php?bo_table=". $_GET["bo_table"] ."&wr_id=". $row_view['wr_id'] ."' class='btn_b02'>글보기</a></li>";
} else {
echo "";
}
}
?>
댓글목록
등록된 댓글이 없습니다.