테스트 사이트 - 개발 중인 베타 버전입니다

리스트에서 레벨 5 회원의 게시물만 불러오게 하려면 어떻게해야 될까요? 채택완료

리스트에서 레벨 5 회원의 게시물만 불러오게 하려면 어떻게해야 될까요?

도움 부탁 드려요. 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

게시판 리스트라면..

list.php 

 

if ($sca || $stx) {

    $sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";

} else {

    $sql = " select * from {$write_table} where wr_is_comment = 0 {$sql_apms_where} ";

    if(!$is_notice_list && $notice_count)

        $sql .= " and wr_id not in (".implode(', ', $arr_notice).") ";

    $sql .= " {$sql_order} limit {$from_record}, $page_rows ";

}

 

이부분에   

 

echo $sql; 넣으면 게시판에 

보통 

select * from g5_write_my_pa where wr_is_comment = 0 order by wr_num, wr_reply limit 0, 15 

이러한 문구가 보인다

그럼 여기서 레벨 5 회원의 게시물만 불러오게?

======/lib/common.lib.php 에보면 

function get_member($mb_id, $fields='*')

{

    global $g5;

    return sql_fetch(" select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ");

}

이러한 것이 있다  =======

즉 데이타베이스의 http://uj64-015.cafe24.com/WebMysql/tbl_structure.php?db=eagleowm1226&table=g5_member&token=87791c7810cf67816bd835ab43ce6905" class="item" style="text-decoration: none; color: rgb(0, 0, 255); white-space: nowrap; font-family: sans-serif; font-size: 13.12px; font-weight: bold; background-color: rgb(245, 245, 245);">g5_member 의 필드중에 http://uj64-015.cafe24.com/WebMysql/sql.php?db=eagleowm1226&table=g5_member&token=87791c7810cf67816bd835ab43ce6905&sql_query=SELECT+%2A+FROM+%60g5_member%60+ORDER+BY+%60g5_member%60.%60mb_level%60+ASC" title="정렬" style="text-decoration: none; color: rgb(0, 0, 255); font-family: sans-serif; font-size: 13.12px; font-weight: bold; text-align: center;">mb_level 것이 회원레벨을 저장 하는 것이다

그러므로 위소스로 회원의 아이디 레벨값을 구하고 그나온 값으로 

즉 select * from g5_write_my_pa where wr_is_comment = 0 and mb_id='아이디 ' order by wr_num, wr_reply limit 0, 15  

이런식으로 해야하지만

 

위방법은 많은 화경 변수와 게시판의 리스트의 여러가지 수정 개발 이 필요하므로 

 

필자는 다른 방법을 추천한다

 

1 게시판스킨중에 글쓰기 소스에 

          로그인을 하면 자동으로 글쓴이의 레벨 값을 브러오는 소스를 만들어서 

                  게시판의 여분필중에 회원 레벨을 저장 하고

 select * from g5_write_my_pa where wr_is_comment = 0 and wr_1=5 order by wr_num, wr_reply limit 0, 15 

 

이런식으로 변경 하면 좀더 쉽다

 

하지만 이방 법도 bbs/list.php 의 사단에 페이징을 위한 커리문 부터 다 수정 개발을 해야 한다

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

전체 질문 목록

🐛 버그신고