아이디당 하나의 게시글을 작성을 허용하고 싶을때 (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년 전 | 4427 | ||
| 2514 | 1년 전 | 902 | ||
| 2513 |
베리소프트
|
1년 전 | 619 | |
| 2512 |
|
1년 전 | 950 | |
| 2511 |
|
1년 전 | 1080 | |
| 2510 | 1년 전 | 1007 | ||
| 2509 | 1년 전 | 1058 | ||
| 2508 | 1년 전 | 1309 | ||
| 2507 | 1년 전 | 687 | ||
| 2506 | 1년 전 | 1253 | ||
| 2505 |
|
1년 전 | 1209 | |
| 2504 | 1년 전 | 1411 | ||
| 2503 | 1년 전 | 946 | ||
| 2502 | 1년 전 | 1071 | ||
| 2501 | 1년 전 | 1170 | ||
| 2500 |
welcome
|
1년 전 | 1079 | |
| 2499 |
하늘그루터기
|
1년 전 | 872 | |
| 2498 | 1년 전 | 1178 | ||
| 2497 | 1년 전 | 646 | ||
| 2496 | 1년 전 | 968 | ||
| 2495 |
|
1년 전 | 1419 | |
| 2494 | 1년 전 | 948 | ||
| 2493 | 1년 전 | 947 | ||
| 2492 | 1년 전 | 1156 | ||
| 2491 | 1년 전 | 1120 | ||
| 2490 | 1년 전 | 1091 | ||
| 2489 | 1년 전 | 1021 | ||
| 2488 | 1년 전 | 775 | ||
| 2487 |
|
1년 전 | 1213 | |
| 2486 | 1년 전 | 831 | ||
| 2485 | 1년 전 | 1007 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기