게시판 등급기능?? 정보
게시판 등급기능??본문
3등급 이상 회원이 글을 쓸 수 있습니다.
3등급은 본인 글만 확인하고 서로의 글은 확인 하지 못합니다.
4등급 회원 위로는 모든 글을 볼 수 있고 코멘트 쓸 수 있게 해야 합니다.
***************************
이런 게시판을 만들어야하는데요,
어떻게 설정해야하는지 좀 알려주세요,
팁이라두요,
감사합니다.
3등급은 본인 글만 확인하고 서로의 글은 확인 하지 못합니다.
4등급 회원 위로는 모든 글을 볼 수 있고 코멘트 쓸 수 있게 해야 합니다.
***************************
이런 게시판을 만들어야하는데요,
어떻게 설정해야하는지 좀 알려주세요,
팁이라두요,
감사합니다.
댓글 전체
3등급, 4등급의 글쓰기및 코멘트 권한은 게시판환경설정을 참고 바라구요.
3등급은 본인만 확인하게 하고 관리자는 통과 하려면..
list.skin.php 상단에 아래 소스를 삽입하세요... 저도 어디서 주워온 것입니다.ㅋㅋㅋ
//##########################################################################################
if($member[mb_level] =="3") { // 관리자가 아닐경우 자기가 작성한 글만 보이도록 한다.
// 분류 선택 또는 검색어가 있다면
if ($sca || $stx)
{
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);
// 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
$sql = " select MIN(wr_num) as min_wr_num from $write_table ";
$row = sql_fetch($sql);
$min_spt = $row[min_wr_num];
if (!$spt) $spt = $min_spt;
//$sql_search .= " and (wr_num between '".$spt."' and '".($spt + $config[cf_search_part])."') ";
$sql_search .= " and mb_id = '$member[mb_id]' and wr_is_comment = 0 and (wr_num between '".$spt."' and '".($spt + $config[cf_search_part])."') ";
// 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
$sql = " select distinct wr_parent from $write_table where $sql_search ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
}
else
{
$sql_search = "";
// 게시판의 글 수
//$sql = " select count(*) as cnt from $g4[write_prefix]$bo_table where wr_is_comment = 0 ";
$sql = " select count(*) as cnt from $g4[write_prefix]$bo_table where mb_id = '$member[mb_id]' and wr_is_comment = 0 ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
//$total_count = $board[bo_count_write];
}
$total_page = ceil($total_count / $board[bo_page_rows]); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $board[bo_page_rows]; // 시작 열을 구함
if ($board[bo_gallery_cols])
$td_width = (int)(100 / $board[bo_gallery_cols]);
// 정렬
if (!$sst)
{
$sst = "wr_num, wr_reply";
$sod = "";
}
$sql_order = " order by $sst $sod ";
if ($sca || $stx)
{
$sql = " select distinct wr_parent from $write_table where $sql_search $sql_order limit $from_record, $board[bo_page_rows] ";
}
else
{
//$sql = " select * from $write_table where wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
$sql = " select * from $write_table where mb_id = '$member[mb_id]' and wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
}
$result = sql_query($sql);
$list = array();
$i = 0;
if (!$sca && !$stx)
{
$arr_notice = split("\n", trim($board[bo_notice]));
for ($k=0; $k<count($arr_notice); $k++)
{
$row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' ");
if (!$row[wr_id])
continue;
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
$list[$i][is_notice] = true;
$i++;
}
}
$k = 0;
while ($row = sql_fetch_array($result))
{
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from $write_table where wr_id = '$row[wr_parent]' ");
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
if (strstr($sfl, "subject"))
$list[$i][subject] = search_font($stx, $list[$i][subject]);
$list[$i][is_notice] = false;
$list[$i][num] = number_format($total_count - ($page - 1) * $board[bo_page_rows] - $k);
$i++;
$k++;
}
$write_pages = get_paging($config[cf_write_pages], $page, $total_page, "./board.php?bo_table=$bo_table".$qstr."&page=");
} // if(!$is_admin) // 관리자가 아닐경우 자기가 작성한 글만 보이도록 한다.
//##########################################################################################
3등급은 본인만 확인하게 하고 관리자는 통과 하려면..
list.skin.php 상단에 아래 소스를 삽입하세요... 저도 어디서 주워온 것입니다.ㅋㅋㅋ
//##########################################################################################
if($member[mb_level] =="3") { // 관리자가 아닐경우 자기가 작성한 글만 보이도록 한다.
// 분류 선택 또는 검색어가 있다면
if ($sca || $stx)
{
$sql_search = get_sql_search($sca, $sfl, $stx, $sop);
// 가장 작은 번호를 얻어서 변수에 저장 (하단의 페이징에서 사용)
$sql = " select MIN(wr_num) as min_wr_num from $write_table ";
$row = sql_fetch($sql);
$min_spt = $row[min_wr_num];
if (!$spt) $spt = $min_spt;
//$sql_search .= " and (wr_num between '".$spt."' and '".($spt + $config[cf_search_part])."') ";
$sql_search .= " and mb_id = '$member[mb_id]' and wr_is_comment = 0 and (wr_num between '".$spt."' and '".($spt + $config[cf_search_part])."') ";
// 원글만 얻는다. (코멘트의 내용도 검색하기 위함)
$sql = " select distinct wr_parent from $write_table where $sql_search ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
}
else
{
$sql_search = "";
// 게시판의 글 수
//$sql = " select count(*) as cnt from $g4[write_prefix]$bo_table where wr_is_comment = 0 ";
$sql = " select count(*) as cnt from $g4[write_prefix]$bo_table where mb_id = '$member[mb_id]' and wr_is_comment = 0 ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
//$total_count = $board[bo_count_write];
}
$total_page = ceil($total_count / $board[bo_page_rows]); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $board[bo_page_rows]; // 시작 열을 구함
if ($board[bo_gallery_cols])
$td_width = (int)(100 / $board[bo_gallery_cols]);
// 정렬
if (!$sst)
{
$sst = "wr_num, wr_reply";
$sod = "";
}
$sql_order = " order by $sst $sod ";
if ($sca || $stx)
{
$sql = " select distinct wr_parent from $write_table where $sql_search $sql_order limit $from_record, $board[bo_page_rows] ";
}
else
{
//$sql = " select * from $write_table where wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
$sql = " select * from $write_table where mb_id = '$member[mb_id]' and wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
}
$result = sql_query($sql);
$list = array();
$i = 0;
if (!$sca && !$stx)
{
$arr_notice = split("\n", trim($board[bo_notice]));
for ($k=0; $k<count($arr_notice); $k++)
{
$row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' ");
if (!$row[wr_id])
continue;
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
$list[$i][is_notice] = true;
$i++;
}
}
$k = 0;
while ($row = sql_fetch_array($result))
{
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from $write_table where wr_id = '$row[wr_parent]' ");
$list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
if (strstr($sfl, "subject"))
$list[$i][subject] = search_font($stx, $list[$i][subject]);
$list[$i][is_notice] = false;
$list[$i][num] = number_format($total_count - ($page - 1) * $board[bo_page_rows] - $k);
$i++;
$k++;
}
$write_pages = get_paging($config[cf_write_pages], $page, $total_page, "./board.php?bo_table=$bo_table".$qstr."&page=");
} // if(!$is_admin) // 관리자가 아닐경우 자기가 작성한 글만 보이도록 한다.
//##########################################################################################
완벽합니다.