회원레벨이 안되어도 공지 볼수 있게 정보
회원레벨이 안되어도 공지 볼수 있게본문
board.php 상단에
// 로그인된 회원의 권한이 설정된 읽기 권한보다 작다면
if ($member['mb_level'] < $board['bo_read_level']) {
if ($is_member)
alert('글을 읽을 권한이 없습니다.', G5_URL);
else
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
}
이분분을
$notice_level = ($board[bo_1])?$board[bo_1]:1; //게시판설정을 통하여 레벨 제한을 둔다
//공지가 있고 , 읽기 레벨이 안되고 , 공지 볼 레벨 보다 크거나 같다면
if($board['bo_notice'] && ($member['mb_level'] < $board['bo_read_level']) && ($member['mb_level']>= $notice_level) ){
$arr_notice = explode(',', trim($board['bo_notice']));
if(in_array($write['wr_id'], $arr_notice)){//notice 라면
$old_level = $board['bo_read_level']; //검사후 되돌리기
$board['bo_read_level']=$member['mb_level'];
$is_notice=true;
}
}
// 로그인된 회원의 권한이 설정된 읽기 권한보다 작다면
if ($member['mb_level'] < $board['bo_read_level']) {
if ($is_member)
alert('글을 읽을 권한이 없습니다.', G5_URL);
else
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
}
//되돌려 놓기
if($is_notice){
$board['bo_read_level']=$old_level;
}
변경하시면 됩니다 (위아래가 추가 되었습니다.)
게시판 관리자의 bo_1 을 이용하여 공지 볼수 있는 레벨을 설정하실수 있습니다.
// 로그인된 회원의 권한이 설정된 읽기 권한보다 작다면
if ($member['mb_level'] < $board['bo_read_level']) {
if ($is_member)
alert('글을 읽을 권한이 없습니다.', G5_URL);
else
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
}
이분분을
$notice_level = ($board[bo_1])?$board[bo_1]:1; //게시판설정을 통하여 레벨 제한을 둔다
//공지가 있고 , 읽기 레벨이 안되고 , 공지 볼 레벨 보다 크거나 같다면
if($board['bo_notice'] && ($member['mb_level'] < $board['bo_read_level']) && ($member['mb_level']>= $notice_level) ){
$arr_notice = explode(',', trim($board['bo_notice']));
if(in_array($write['wr_id'], $arr_notice)){//notice 라면
$old_level = $board['bo_read_level']; //검사후 되돌리기
$board['bo_read_level']=$member['mb_level'];
$is_notice=true;
}
}
// 로그인된 회원의 권한이 설정된 읽기 권한보다 작다면
if ($member['mb_level'] < $board['bo_read_level']) {
if ($is_member)
alert('글을 읽을 권한이 없습니다.', G5_URL);
else
alert('글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.$qstr.'&url='.urlencode(G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.$qstr));
}
//되돌려 놓기
if($is_notice){
$board['bo_read_level']=$old_level;
}
변경하시면 됩니다 (위아래가 추가 되었습니다.)
게시판 관리자의 bo_1 을 이용하여 공지 볼수 있는 레벨을 설정하실수 있습니다.
추천
2
2
댓글 2개
감사합니다. 스크랩해놧다가 봐야겠네요
좋아요..잘쓰겠습니다.감사합니다.