아이디당 하나의 게시글을 작성을 허용하고 싶을때 (2017-05-23 수정}
게시판에 아이디당 글을 한개만 작성하도록 하고 싶을때 아래와 같이 스킨을 수정합니다.
관리자일때는 예외로 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>";
} 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>";
} else {
echo "";
}
}
?>
댓글 4개
사이트메이크
8년 전
멋진 팁입니다.
언젠가 유용하게 써먹을것같아 스크랩합니다 ㅎ
언젠가 유용하게 써먹을것같아 스크랩합니다 ㅎ
8년 전
^^
1년 전
나도 스크랩 언젠간쓰일날이 있을것같아요 ~~^^ 감사합니다.
1년 전
뽀뽀
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4420 | ||
| 774 | 8년 전 | 5545 | ||
| 773 |
saesini
|
8년 전 | 5455 | |
| 772 |
sozet
|
8년 전 | 3779 | |
| 771 |
sozet
|
8년 전 | 6610 | |
| 770 |
sozet
|
8년 전 | 4496 | |
| 769 | 8년 전 | 8415 | ||
| 768 | 8년 전 | 7949 | ||
| 767 | 8년 전 | 5663 | ||
| 766 | 8년 전 | 3321 | ||
| 765 | 8년 전 | 4384 | ||
| 764 | 8년 전 | 3689 | ||
| 763 |
|
8년 전 | 5435 | |
| 762 |
|
8년 전 | 4791 | |
| 761 |
|
8년 전 | 4839 | |
| 760 |
|
8년 전 | 5695 | |
| 759 | 8년 전 | 8096 | ||
| 758 |
|
8년 전 | 6722 | |
| 757 | 8년 전 | 14314 | ||
| 756 | 8년 전 | 9142 | ||
| 755 | 8년 전 | 10379 | ||
| 754 |
아빠는웹쟁이
|
8년 전 | 4277 | |
| 753 | 8년 전 | 4838 | ||
| 752 | 8년 전 | 5201 | ||
| 751 |
|
8년 전 | 6787 | |
| 750 | 8년 전 | 8727 | ||
| 749 | 8년 전 | 5115 | ||
| 748 |
|
8년 전 | 10920 | |
| 747 | 8년 전 | 6717 | ||
| 746 | 8년 전 | 4624 | ||
| 745 |
|
8년 전 | 7063 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기