스

게시판 글에 공지 체크하면 하나만 나오게 하려면 어떻게 해야하나요?

글에 공지 체크하면 두개가생성되고,하나를 지우면 다 같이 없어지네요? 공지체크하면 하나만 나오게 하려면 어떻게 하나요?

댓글 3개

/bbs/list.php 에서 아래의 부분을

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] ";
}
$result = sql_query($sql);

// 년도 2자리
$today2 = $g4[time_ymd];

$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++;
}
}


///////////////////////////////////////////////////////////////////
아래와 같이 수정하시면 됩니다.

$list = array();
$i = 0;

if (!$sca && !$stx)
{
$arr_notice = split("\n", trim($board[bo_notice]));
for ($k=0 , $ck = count($arr_notice); $k < $ck; $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;

$notice_order .= " and wr_id != '$arr_notice[$k]'";

$i++;
}
}

// if(!$board[bo_1]) $notice_order = ''; //게시판 설정에서 공지 재출력 유무를 조정할 경우

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 $notice_order $sql_order limit $from_record, $board[bo_page_rows] ";
}
$result = sql_query($sql);

// 년도 2자리
$today2 = $g4[time_ymd];


활용팁에 kail님께서 올려놓으신 내용입니다.
저도 이대로 변경하니 잘 적용되더군요.
정말 감사합니다.. 잘 되네요
공지 체크 두개가 생성될때, 하나만 나오게 하는 방법
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
07-12-10 조회 1,592
07-12-10 조회 1,582
07-12-10 조회 1,521
07-12-10 조회 1,705
07-12-09 조회 1,632
07-12-09 조회 1,384
07-12-09 조회 1,640
07-12-09 조회 1,748
07-12-09 조회 1,673
07-12-09 조회 1,515
07-12-09 조회 1,368
07-12-09 조회 1,602
07-12-09 조회 1,715
07-12-08 조회 1,618
07-12-08 조회 1,588
07-12-08 조회 1,623
07-12-08 조회 1,566
07-12-08 조회 1,720
07-12-08 조회 1,613
07-12-08 조회 1,596