Skip to content

Commit

Permalink
답글 리스트 가져오는 DB쿼리문 필터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lchcosmosfarm committed Nov 19, 2019
1 parent 98a6ca4 commit a902cbd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
9 changes: 8 additions & 1 deletion plugins/kboard/class/KBContentList.class.php
Expand Up @@ -840,12 +840,19 @@ public function hasNextNotice(){
public function getReplyList($parent_uid){
global $wpdb;

$from[] = "`{$wpdb->prefix}kboard_board_content`";

$where[] = "`parent_uid`='$parent_uid'";

// 휴지통에 없는 게시글만 불러온다.
$where[] = "(`status`='' OR `status` IS NULL OR `status`='pending_approval')";

$this->resource_reply = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}kboard_board_content` WHERE " . implode(' AND ', $where) . " ORDER BY `date` ASC");
$select = apply_filters('kboard_reply_list_select', '*', $this->board_id, $this);
$from = apply_filters('kboard_reply_list_from', implode(' ', $from), $this->board_id, $this);
$where = apply_filters('kboard_reply_list_where', implode(' AND ', $where), $this->board_id, $this);
$orderby = apply_filters('kboard_reply_list_orderby', "`date` ASC", $this->board_id, $this);

$this->resource_reply = $wpdb->get_results("SELECT {$select} FROM {$from} WHERE {$where} ORDER BY {$orderby}");
$wpdb->flush();

return $this->resource_reply;
Expand Down
2 changes: 1 addition & 1 deletion plugins/kboard/class/KBoardBuilder.class.php
Expand Up @@ -344,7 +344,7 @@ public function builderList(){
* @param int $parent_uid
*/
public function builderReply($parent_uid, $depth=0){
$list = new KBContentList();
$list = new KBContentList($this->board_id);
$list->getReplyList($parent_uid);

$order = new KBOrder();
Expand Down
9 changes: 9 additions & 0 deletions plugins/kboard/history.md
Expand Up @@ -2,6 +2,15 @@

[homepage](https://www.cosmosfarm.com/products/kboard)

5.5.1
----------------------------------

1. kboard_reply_list_select 필터 추가
2. kboard_reply_list_from 필터 추가
3. kboard_reply_list_where 필터 추가
4. kboard_reply_list_orderby 필터 추가
5. 버그 수정

5.5
----------------------------------

Expand Down
4 changes: 2 additions & 2 deletions plugins/kboard/index.php
Expand Up @@ -3,15 +3,15 @@
Plugin Name: KBoard : 게시판
Plugin URI: https://www.cosmosfarm.com/products/kboard
Description: 워드프레스 KBoard 게시판 플러그인 입니다.
Version: 5.5
Version: 5.5.1
Author: 코스모스팜 - Cosmosfarm
Author URI: https://www.cosmosfarm.com/
*/

if(!defined('ABSPATH')) exit;
if(!session_id()) session_start();

define('KBOARD_VERSION', '5.5');
define('KBOARD_VERSION', '5.5.1');
define('KBOARD_PAGE_TITLE', __('KBoard : 게시판', 'kboard'));
define('KBOARD_WORDPRESS_ROOT', substr(ABSPATH, 0, -1));
define('KBOARD_WORDPRESS_APP_ID', '083d136637c09572c3039778d8667b27');
Expand Down

0 comments on commit a902cbd

Please sign in to comment.