답변 3개
1년 전
1. 게시판은 게시판 설정에서 가능
2. 일반 페이지라면 해당 페이지.php 파일에 아래 코드 넣기
Copy
if($member['mb_level'] < 3){
echo '회원 레벨 3이상 접근이 가능합니다.';
}else{
3레벨 이상일 때 코드 작성
}
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
1년 전
다음 코드가 도움이 될지 모르겠습니다.
extend/validation.extend.php
Copy
//$subroot = '/subdir';
$subroot = '';
if ($is_member == false) {
$allowed_urls = [
$subroot . '/bbs/login.php',
$subroot . '/bbs/login_check.php',
$subroot . '/bbs/logout.php',
$subroot . '/bbs/register.php',
$subroot . '/bbs/register_form.php',
$subroot . '/bbs/register_form_update.php',
$subroot . '/plugin/kcaptcha/kcaptcha_image.php',
$subroot . '/plugin/kcaptcha/kcaptcha_session.php',
$subroot . '/plugin/kcaptcha/kcaptcha_mp3.php',
$subroot . '/bbs/ajax.mb_id.php',
$subroot . '/bbs/ajax.mb_nick.php',
$subroot . '/bbs/ajax.mb_email.php',
];
if (in_array($_SERVER['PHP_SELF'], $allowed_urls) == false) {
header('Location: ' . current($allowed_urls));
exit();
}
} else {
if ($member['mb_level'] < 3 && $_SERVER['PHP_SELF'] != $subroot . '/bbs/logout.php') {
echo 'Access Denied';
echo '<p><a href="' . $subroot . '/bbs/logout.php">logout</a></p>';
exit();
}
}
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
1년 전
질문이 너무 ㅋㅋ
1. 게시판 설정에서 레벨을 3으로 변경
2. 매뉴자체에서 레벨3 한테만 처리하려면 아래와 같이 if 문 추가
Copy
if($member['mb_level']>="3") { echo "내용"; }
3. 아미나 or 나리야 사용시 나리야 매뉴설정에서 출력 레벨 수정
4. 게시판이 아닌 자체 페이지일 경우 아래 코드 추가
Copy
if($member['mb_level']>="3") { alert("레벨 3 이상만 접근 가능", '주소'); exit; }
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인