답변 1개
직접 수정해야 되므로 추천하지 않습니다만,
하실려면 아래와 같이 직접 수정해야 합니다.
gnupress/bbs/list.php
에서 113 번째 줄쯤
// 공지 처리
if (!$sca && !$stx && !count($search_tag)) {
$from_notice_idx = ($page - 1) * $page_rows;
if($from_notice_idx < 0)
$from_notice_idx = 0;
if( !empty($board['bo_notice']) ){ //공지가 있다면
$arr_notice = explode(',', trim($board['bo_notice']));
$board_notice_count = count($arr_notice);
$wr_ids = join(',' , $arr_notice);
if( !$wr_ids ) break;
$sql = "select * from {$write_table} where wr_id in ( $wr_ids ) order by wr_num";
$notice_list = $wpdb->get_results($sql, ARRAY_A);
foreach( $notice_list as &$row ){
if (!$row['wr_id']) continue;
$notice_array[] = $row['wr_id'];
if($k < $from_notice_idx) continue;
$row = $this->get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len'], $default_href);
$row['is_notice'] = true;
$notice_count++;
$k++;
if($notice_count >= $list_page_rows)
break;
}
}
}
아래와 같이 고칩니다.
// 공지 처리 $from_notice_idx = ($page - 1) * $page_rows; if($from_notice_idx < 0) $from_notice_idx = 0; if( !empty($board['bo_notice']) ){ //공지가 있다면 $arr_notice = explode(',', trim($board['bo_notice'])); $board_notice_count = count($arr_notice); $wr_ids = join(',' , $arr_notice); if( !$wr_ids ) break; $sql = "select * from {$write_table} where wr_id in ( $wr_ids ) order by wr_num"; $notice_list = $wpdb->get_results($sql, ARRAY_A); foreach( $notice_list as &$row ){ if (!$row['wr_id']) continue; $notice_array[] = $row['wr_id']; if($k < $from_notice_idx) continue; $row = $this->get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len'], $default_href); $row['is_notice'] = true; $notice_count++; $k++; if($notice_count >= $list_page_rows) break; } }
197번째 줄 이렇게 되어 있을것을
if ($sca || $stx || count($search_tag)) {
$sql = $wpdb->prepare(" select SQL_CALC_FOUND_ROWS * from {$write_table} where {$sql_search} {$sql_order} limit %d, %d ", $from_record, $page_rows);
아래와 같이 고칩니다.
if ($sca || $stx || count($search_tag)) { if(!empty($notice_array)) $sql_search .= " and wr_id not in (".implode(', ', $notice_array).") "; $sql = $wpdb->prepare(" select SQL_CALC_FOUND_ROWS * from {$write_table} where {$sql_search} {$sql_order} limit %d, %d ", $from_record, $page_rows);
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인