답변 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;
}
}
}
아래와 같이 고칩니다.
</p><p>// 공지 처리</p><p> </p><p> $from_notice_idx = ($page - 1) * $page_rows;</p><p> if($from_notice_idx < 0)</p><p> $from_notice_idx = 0;</p><p> </p><p> if( !empty($board['bo_notice']) ){ //공지가 있다면</p><p> </p><p> $arr_notice = explode(',', trim($board['bo_notice']));</p><p> $board_notice_count = count($arr_notice);</p><p> $wr_ids = join(',' , $arr_notice);</p><p> </p><p> if( !$wr_ids ) break;</p><p> $sql = "select * from {$write_table} where wr_id in ( $wr_ids ) order by wr_num";</p><p> $notice_list = $wpdb->get_results($sql, ARRAY_A);</p><p> </p><p> foreach( $notice_list as &$row ){</p><p> if (!$row['wr_id']) continue;</p><p> $notice_array[] = $row['wr_id'];</p><p> if($k < $from_notice_idx) continue;</p><p> </p><p> $row = $this->get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len'], $default_href);</p><p> $row['is_notice'] = true;</p><p> $notice_count++;</p><p> $k++;</p><p> </p><p> if($notice_count >= $list_page_rows)</p><p> break;</p><p> }</p><p> }</p><p>
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);
아래와 같이 고칩니다.
</p><p>if ($sca || $stx || count($search_tag)) {</p><p> </p><p> if(!empty($notice_array))</p><p> $sql_search .= " and wr_id not in (".implode(', ', $notice_array).") ";</p><p> </p><p> $sql = $wpdb->prepare(" select SQL_CALC_FOUND_ROWS * from {$write_table} where {$sql_search} {$sql_order} limit %d, %d ", $from_record, $page_rows);</p><p>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인