wr_level 문제

wr_level 문제

QA

wr_level 문제

사용 PHP 버전

8.1

본문

그누보드5 basic 스킨을 적용했는데요.

 

관리자 모드로 접속하면 글 리스트가 정상적으로 보이는데, guest로 들어가면 글 리스트가 안 보이네요.

 

그런데 guest 모드로 들어 갔을 때 글 리스트는 안 보이는데 위쪽에 Total Count에는 정상적인 글 개수가 보입니다. 

 

읽기 권한 문제는 확인했고, 제미나이는 혹시 게시판 sql에 wr_level 문제일 수 있다고 하는데, 게시판 글 sql을 보니 아예 wr_level column이 없습니다. 

 

그럼 혹시 뭐가 문제인 걸까요? 비슷한 문제 경험해 보신 분 계시면 조언 부탁드립니다!!

 

CREATE TABLE `g5_write_essay` (

`wr_id` int NOT NULL AUTO_INCREMENT,

`wr_num` int NOT NULL DEFAULT '0',

`wr_reply` varchar(10) NOT NULL,

`wr_parent` int NOT NULL DEFAULT '0',

`wr_is_comment` tinyint NOT NULL DEFAULT '0',

`wr_comment` int NOT NULL DEFAULT '0',

`wr_comment_reply` varchar(5) NOT NULL,

`ca_name` varchar(255) NOT NULL,

`wr_option` set('html1','html2','secret','mail') NOT NULL,

`wr_subject` varchar(255) NOT NULL,

`wr_content` text NOT NULL,

`wr_seo_title` varchar(255) NOT NULL DEFAULT '',

`wr_link1` text NOT NULL,

`wr_link2` text NOT NULL,

`wr_link1_hit` int NOT NULL DEFAULT '0',

`wr_link2_hit` int NOT NULL DEFAULT '0',

`wr_hit` int NOT NULL DEFAULT '0',

`wr_good` int NOT NULL DEFAULT '0',

`wr_nogood` int NOT NULL DEFAULT '0',

`mb_id` varchar(20) NOT NULL,

`wr_password` varchar(255) NOT NULL,

`wr_name` varchar(255) NOT NULL,

`wr_email` varchar(255) NOT NULL,

`wr_homepage` varchar(255) NOT NULL,

`wr_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

`wr_file` tinyint NOT NULL DEFAULT '0',

`wr_last` varchar(19) NOT NULL,

`wr_ip` varchar(255) NOT NULL,

`wr_facebook_user` varchar(255) NOT NULL,

`wr_twitter_user` varchar(255) NOT NULL,

`wr_1` varchar(255) NOT NULL,

`wr_2` varchar(255) NOT NULL,

`wr_3` varchar(255) NOT NULL,

`wr_4` varchar(255) NOT NULL,

`wr_5` varchar(255) NOT NULL,

`wr_6` varchar(255) NOT NULL,

`wr_7` varchar(255) NOT NULL,

`wr_8` varchar(255) NOT NULL,

`wr_9` varchar(255) NOT NULL,

`wr_10` varchar(255) NOT NULL,

이 질문에 댓글 쓰기 :

답변 5

wr_level이란건은 특별하게 추가를 해야 존재하구요

 

사용자에게 존재하는 g5_member.mb_level 이 게시판에서 적용되게 하기위해서

 

게시판을 생성/수정할때 사용하는 g5_board 테이블에

리스트보기, 읽기, 쓰기, 답변, 댓글, 다운로드, html작성권한, 링크권한 등에 사용가능한 레벨을 설정하게 해두었습니다.

 

thumb-3743823042_1761899775.2272_730x670.png

 를 보시면 아실수있으실겁니다.

 

ERD를 보시고 싶으시면

https://sir.kr/g5_tip/5588

를 참고하세요

wr_level는 기본에서는 없는 필드가 맞습니다.

일단 커스텀으로 인해서 안보이시는거 같은데 소스를 보기 전에는 정확한 이유를 알기는 힘듭니다.

답변 감사합니다. 제가 사용하는 게시판 스킨 소스 코드에서는 회원 레벨과 관련한 부분을 찾지를 못했습니다.


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>

<!-- 게시판 목록 시작 { -->
<div id="bo_list" style="width:<?php echo $width; ?>">

    <!-- 게시판 카테고리 시작 { -->
    <?php if ($is_category) { ?>
    <nav id="bo_cate">
        <h2><?php echo $board['bo_subject'] ?> 카테고리</h2>
        <ul id="bo_cate_ul">
            <?php echo $category_option ?>
        </ul>
    </nav>
    <?php } ?>
    <!-- } 게시판 카테고리 끝 -->
    
    <form name="fboardlist" id="fboardlist" action="<?php echo G5_BBS_URL; ?>/board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
    
    <input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
    <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
    <input type="hidden" name="stx" value="<?php echo $stx ?>">
    <input type="hidden" name="spt" value="<?php echo $spt ?>">
    <input type="hidden" name="sca" value="<?php echo $sca ?>">
    <input type="hidden" name="sst" value="<?php echo $sst ?>">
    <input type="hidden" name="sod" value="<?php echo $sod ?>">
    <input type="hidden" name="page" value="<?php echo $page ?>">
    <input type="hidden" name="sw" value="">

    <!-- 게시판 페이지 정보 및 버튼 시작 { -->
    <div id="bo_btn_top">
        <div id="bo_list_total">
            <span>Total <?php echo number_format($total_count) ?>건 여기 보이나 테스트!!</span>
            <?php echo $page ?> 페이지
        </div>

        <ul class="btn_bo_user">
        	<?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn_admin btn" title="관리자"><i class="fa fa-cog fa-spin fa-fw"></i><span class="sound_only">관리자</span></a></li><?php } ?>
            <?php if ($rss_href) { ?><li><a href="<?php echo $rss_href ?>" class="btn_b01 btn" title="RSS"><i class="fa fa-rss" aria-hidden="true"></i><span class="sound_only">RSS</span></a></li><?php } ?>
            <li>
            	<button type="button" class="btn_bo_sch btn_b01 btn" title="게시판 검색"><i class="fa fa-search" aria-hidden="true"></i><span class="sound_only">게시판 검색</span></button>
            </li>
            <?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b01 btn" title="글쓰기"><i class="fa fa-pencil" aria-hidden="true"></i><span class="sound_only">글쓰기</span></a></li><?php } ?>
        	<?php if ($is_admin == 'super' || $is_auth) {  ?>
        	<li>
        		<button type="button" class="btn_more_opt is_list_btn btn_b01 btn" title="게시판 리스트 옵션"><i class="fa fa-ellipsis-v" aria-hidden="true"></i><span class="sound_only">게시판 리스트 옵션</span></button>
        		<?php if ($is_checkbox) { ?>	
		        <ul class="more_opt is_list_btn">  
		            <li><button type="submit" name="btn_submit" value="선택삭제" onclick="document.pressed=this.value"><i class="fa fa-trash-o" aria-hidden="true"></i> 선택삭제</button></li>
		            <li><button type="submit" name="btn_submit" value="선택복사" onclick="document.pressed=this.value"><i class="fa fa-files-o" aria-hidden="true"></i> 선택복사</button></li>
		            <li><button type="submit" name="btn_submit" value="선택이동" onclick="document.pressed=this.value"><i class="fa fa-arrows" aria-hidden="true"></i> 선택이동</button></li>
		        </ul>
		        <?php } ?>
        	</li>
        	<?php }  ?>
        </ul>
    </div>
    <!-- } 게시판 페이지 정보 및 버튼 끝 -->
        	
    <div class="tbl_head01 tbl_wrap">
        <table>
        <caption><?php echo $board['bo_subject'] ?> 목록</caption>
        <thead>
        <tr>
            <?php if ($is_checkbox) { ?>
            <th scope="col" class="all_chk chk_box">
            	<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);" class="selec_chk">
                <label for="chkall">
                	<span></span>
                	<b class="sound_only">현재 페이지 게시물  전체선택</b>
				</label>
            </th>
            <?php } ?>
            <th scope="col">번호</th>
            <th scope="col">제목</th>
            <th scope="col">글쓴이</th>
            <th scope="col"><?php echo subject_sort_link('wr_hit', $qstr2, 1) ?>조회 </a></th>
            <?php if ($is_good) { ?><th scope="col"><?php echo subject_sort_link('wr_good', $qstr2, 1) ?>추천 </a></th><?php } ?>
            <?php if ($is_nogood) { ?><th scope="col"><?php echo subject_sort_link('wr_nogood', $qstr2, 1) ?>비추천 </a></th><?php } ?>
            <th scope="col"><?php echo subject_sort_link('wr_datetime', $qstr2, 1) ?>날짜  </a></th>
        </tr>
        </thead>
        <tbody>
        <?php
        for ($i=0; $i<count($list); $i++) {
        	if ($i%2==0) $lt_class = "even";
        	else $lt_class = "";
		?>
        <tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice";

관리자 > 게시판 관리 > 해당 게시판 [수정]

> 권한 설정 > 글읽기 권한

을 '1' 로 설정해 주면 됩니다. ([확인])

코드를 조금씩 바꾸면서 확인해 보니, 전체 글 갯수는 $total_count로 잘 가져오는데, 글 목록을 보여 주려 할 때 for를 돌리는 $list가 0이라서 문제가 되는 것 같습니다. 그런데 $list를 어디서 가져오는 건지 알 수가 없네요. 

for를 돌리는 $list가 0이라서 문제가 되는 것 같습니다

<===스킨 상단에 print_r($list); 해보세요

 

$list를 어디서 가져오는 건지는 현재 수준으로서는 알 필요도 없습니다만

bbs/list.php에서 lib/common.lib.php의 get_list 함수를 호출해서 생성합니다

 

 

 

답변을 작성하시기 전에 로그인 해주세요.
전체 129,672 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT