Skip to content

Commit

Permalink
공지사항 리스트 반환하는 DB쿼리문(select, from, where) 필터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lchcosmosfarm committed Oct 27, 2021
1 parent ca9389b commit bfb2801
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion plugins/kboard/class/KBContentList.class.php
Expand Up @@ -898,9 +898,12 @@ public function getNoticeList(){
$where[] = $get_list_status_query;
}

$select = apply_filters('kboard_notice_list_select', '*', $this->board_id, $this);
$from = apply_filters('kboard_notice_list_from', "`{$wpdb->prefix}kboard_board_content`", $this->board_id, $this);
$where = apply_filters('kboard_notice_list_where', implode(' AND ', $where), $this->board_id, $this);
$orderby = apply_filters('kboard_notice_list_orderby', "`{$this->sort}` {$this->order}", $this->board_id, $this);

$this->resource_notice = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}kboard_board_content` WHERE " . implode(' AND ', $where) . " ORDER BY {$orderby}");
$this->resource_notice = $wpdb->get_results("SELECT {$select} FROM {$from} WHERE {$where} ORDER BY {$orderby}");
$wpdb->flush();

return $this->resource_notice;
Expand Down
5 changes: 4 additions & 1 deletion plugins/kboard/history.md
Expand Up @@ -16,7 +16,10 @@
9. kboard_init_category1_list 필터 추가
10. kboard_init_category2_list 필터 추가
11. kboard_xssfilter 설정 변경(font 태그 color 속성 추가)
12. 버그 수정
12. kboard_notice_list_select 필터 추가
13. kboard_notice_list_from 필터 추가
14. kboard_notice_list_where 필터 추가
15. 버그 수정


6.0
Expand Down

0 comments on commit bfb2801

Please sign in to comment.