그누5에서 카테고리 선택시 공지 나타내기
본문
그누5에서는 팁을 찾아봐도 없네요.
카테고리 선택했을시 공지를 항상 상단에 출력하고 싶은데요..
bbs/list.php에서 어디를 조정하는 모양이던데, 초보라서 잘 모르겠네요......
답변 1
/bbs/list.php 파일에서
// 공지 처리
if (!$sca && !$stx) {
...
...
...
}
아랫줄에 추가하세요.
// 카테고리 공지 처리
else if ($sca && !$stx) {
$arr_notice = explode(',', trim($board['bo_notice']));
$from_notice_idx = ($page - 1) * $page_rows;
if($from_notice_idx < 0)
$from_notice_idx = 0;
$board_notice_count = count($arr_notice);
for ($k=0; $k<$board_notice_count; $k++) {
if (trim($arr_notice[$k]) == '') continue;
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$arr_notice[$k]}' ");
if (!$row['wr_id']) continue;
$notice_array[] = $row['wr_id'];
if($k < $from_notice_idx) continue;
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
$list[$i]['is_notice'] = true;
$i++;
$notice_count++;
if($notice_count >= $list_page_rows)
break;
}
}
답변을 작성하시기 전에 로그인 해주세요.