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

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

댓글 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 질문답변

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

+
제목 글쓴이 날짜 조회
18년 전 조회 1,589
18년 전 조회 1,435
18년 전 조회 1,292
18년 전 조회 1,528
18년 전 조회 1,631
18년 전 조회 1,516
18년 전 조회 1,508
18년 전 조회 1,533
18년 전 조회 1,486
18년 전 조회 1,610
18년 전 조회 1,516
18년 전 조회 1,518
18년 전 조회 1,553
18년 전 조회 1,503
18년 전 조회 1,513
18년 전 조회 1,182
18년 전 조회 1,148
18년 전 조회 1,178
18년 전 조회 1,555
18년 전 조회 1,510
🐛 버그신고