<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[파라미터로 검색 후 input value에 들어가 있는 값으로 kboard 리스트 나타내기]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/58718</link>
		<description><![CDATA[<p><strong>1. 정확한 제품 또는 플러그인 이름</strong></p>

<p>default</p>

<p> </p>

<p><strong>2. 상세 내용</strong></p>

<p>안녕하세요.</p>

<p>timetable 플러그인을 이용하여 요일, 시간, 레벨을 선택 해서 검색 후 event_id 값을 </p>

<p>input value안에 값을 넣어놨습니다.</p>

<p>input value안에 있는 event_id 값과 게시글 입력필드에 있는 tableid(input[type=text]) 에 있는 값과</p>

<p>동일한 것만 게시글을 나오게 하고 싶습니다.</p>

<p> </p>

<p><strong>1. 검색 한 event_id을 파라미터로 보낼 수 있나요?</strong></p>

<p><strong>2. kboard_list_where 훅을 이용하여 나오게 할 수 있는 방법이 있나요?</strong></p>

<p> </p>

<p><strong>3. 확인 가능한 상세 페이지 주소</strong></p>

<p>https://balletzip.com</p>

<p> </p>

<p><strong>4. 수정한 코드 내역 (있다면)</strong></p>

<pre>
<code class="language-php">&lt;?php
$timetablenum = 0;
foreach ($evnetid_Array as $key =&gt; $value) {
    // echo "&lt;p class='eventid' id='eventid". $timetablenum ."'&gt;".$value['event_id']."&lt;/p&gt;&lt;br&gt;";
    echo "&lt;input type='text' name='kboard_search_option[tableid][value]' id='eventid". $timetablenum ."'value='" .$value['event_id']. "'&gt;&lt;br&gt;";
    $timetablenum++;
}
?&gt;</code></pre>

<p> </p>

<p>event_id값은 foreach문으로 불러온 상태 입니다.</p>

<p> </p>

<p> </p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[커뮤니티 내에서 모든 문제를 해결해드리는 것은

현실적으로 어렵습니다.

 

추가로 정확한 상황을 알...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/59976</link>
			<description><![CDATA[<p>커뮤니티 내에서 모든 문제를 해결해드리는 것은</p>

<p>현실적으로 어렵습니다.</p>

<p> </p>

<p>추가로 정확한 상황을 알 수 없어</p>

<p>정확히 적용되는 코드의 안내도 어렵습니다.</p>

<p><br />
코드를 수정하는 것이 어려우시다면</p>

<p>프로젝트 의뢰에 자세한 내용을 남겨보시겠어요?</p>

<p><a href="https://www.cosmosfarm.com/project" target="_blank">https://www.cosmosfarm.com/project</a></p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Tue, 14 Jun 2022 06:28:07 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[주신 소스를 수정해서 적용했는데,

계층형 카테고리와 직접 짠 검색 폼이 같이 검색이 안됩니다.


add...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58972</link>
			<description><![CDATA[<p>주신 소스를 수정해서 적용했는데,</p>

<p>계층형 카테고리와 직접 짠 검색 폼이 같이 검색이 안됩니다.</p>

<pre>
<code class="language-php">add_filter('kboard_list_from', 'my_kboard_list_from', 10, 3);
function my_kboard_list_from($from, $board_id, $content_list){
    if($board_id == "2"){ // 실제 게시판 ID
        global $wpdb;
        
        $se_option = isset($_GET['kboard_search_option']) ? $_GET['kboard_search_option'] : '';

        $from = "`{$wpdb-&gt;prefix}kboard_board_content`";

        if(is_array($se_option)){
            // $tc = array();
            foreach($se_option as $key=&gt;$value){ 
                if(isset($value['value']) &amp;&amp; $value['value']){
                    $from .= " LEFT JOIN `{$wpdb-&gt;prefix}kboard_board_option` AS `option_{$key}` ON `{$wpdb-&gt;prefix}kboard_board_content`.`uid`=`option_{$key}`.`content_uid`";
                }
            }
        }
    }
    echo $from;
    return $from;
}</code></pre>

<p> </p>

<pre>
<code class="language-php">add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
    global $wpdb;

    //시간
    $start_date = isset($_GET['start_date']) ? sanitize_text_field($_GET['start_date']) : '';
    $date = date('Y-m-d', strtotime('-3 month', current_time('timestamp'))); 
    
    //쿠폰
    $chkcoupon_data = isset($_GET['chkcoupon']) ? sanitize_text_field($_GET['chkcoupon']) : '';


    $keyword = kboard_keyword();
    if(!kboard_target() &amp;&amp; $board_id == '2'){ // 실제 게시판 id로 적용해주세요.
        $content_uid_string = get_event_id();
        $chkcoupon_uid_string = get_chkcoupon_id();

        $where = "`board_id`='{$board_id}'";

        if($keyword){
            $where .=  " AND `title` LIKE '%{$keyword}%'";
        }

        if($start_date){
            $where .= " AND `date` &gt;= '{$date}'";
        }
        
        if($chkcoupon_data  != ""){
            $where .= " AND `uid` IN {$chkcoupon_uid_string}";
        }

        if($content_uid_string == "()"){
            $where .= " AND `uid` = -1";
        }

        if($content_uid_string != ""){
            $where .= " AND `uid` IN {$content_uid_string}";
        }

        //카테고리
        $se_option = isset($_GET['kboard_search_option']) ? $_GET['kboard_search_option'] : '';
        if(is_array($se_option)){
            foreach($se_option as $key=&gt;$value){
                if($value["value"] === ""){
                    continue;
                }
                $where .= " AND `option_{$key}`.`option_value` LIKE '{$value["value"]}'";
            }
        }
        
        $where .= " AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    }
    return $where;
    
}</code></pre>

<p> </p>

<p>검색 시 'uid'과 'option_value'가 충돌 나는거 같은데,</p>

<p>어떻게 해야댈까요?</p>

<p> </p>]]></description>
			<author>패치워크</author>
			<pubDate>Thu, 21 Apr 2022 07:48:10 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[내부 일정이 있어 늦어졌습니다.

아래 코드들을 활용해보시겠어요?

KBoard list의 쿼리문 전체를 수정...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58838</link>
			<description><![CDATA[<p>내부 일정이 있어 늦어졌습니다.</p>

<p>아래 코드들을 활용해보시겠어요?</p>

<p>KBoard list의 쿼리문 전체를 수정하는 코드입니다.</p>

<pre>
<code>add_filter('kboard_list_select', 'my_kboard_list_select', 10, 3);
function my_kboard_list_select($select, $board_id, $content_list){
	if($board_id == "1"){ // 실제 게시판 ID
		$select = ' * ';
	}
	
	return $select;
}

add_filter('kboard_list_from', 'my_kboard_list_from', 10, 3);
function my_kboard_list_from($from, $board_id, $content_list){
	if($board_id == 1){ // 실제 게시판 ID
		global $wpdb;
		
		$se_option = isset($_GET['kboard_search_option']) ? $_GET['kboard_search_option'] : '';
		if(is_array($se_option)){
			$tc = array();
			foreach($se_option as $key=&gt;$value){
				if(isset($value['value']) &amp;&amp; $value['value']){
					$tc[$key] = sanitize_text_field($value['value']);
				}
			}
		}
		
		$from = "`{$wpdb-&gt;prefix}kboard_board_content` AS `content` LEFT JOIN `{$wpdb-&gt;prefix}kboard_board_option` AS `option0` ON `content`.`uid`=`option0`.`content_uid`";
		if($tc){
			for($i=1; $i&lt;count($tc); $i++){
				$from .= " LEFT JOIN `{$wpdb-&gt;prefix}kboard_board_option` AS `option{$i}` ON `content`.`uid`=`option{$i}`.`content_uid`";
			}
		}
	}
	
	return $from;
}

add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
	if($board_id == 1){ // 실제 게시판 ID
		global $wpdb;
		
		//시간
		$start_date = isset($_GET['start_date']) ? sanitize_text_field($_GET['start_date']) : '';
		$date = date('Y-m-d', strtotime('-3 month', current_time('timestamp'))); 
		
		//쿠폰
		$chkcoupon_data = isset($_GET['chkcoupon']) ? sanitize_text_field($_GET['chkcoupon']) : '';
		
		$se_option = isset($_GET['kboard_search_option']) ? $_GET['kboard_search_option'] : '';
		if(is_array($se_option)){
			$tc = array();
			foreach($se_option as $key=&gt;$value){
				$tc[$key] = sanitize_text_field($value['value']);
			}
		}
		
		$keyword = kboard_keyword();
		if(!kboard_target()){
			// $content_uid_string = get_event_id();
			// $chkcoupon_uid_string = get_chkcoupon_id();
			// $tree_category_1_uid_string = get_category_1_id();
			
			$where = "`board_id`='{$board_id}'";
			
			if($keyword){
				$where .=  " AND `title` LIKE '%{$keyword}%'";
			}
			
			if($start_date){
				$where .= " AND `date` &gt;= '{$date}'";
			}
			
			if($chkcoupon_data  != ""){
				$where .= " AND `uid` IN {$chkcoupon_uid_string}";
			}
			
			if($content_uid_string == "()"){
				$where .= " AND `uid` = -1";
			}
			
			if($content_uid_string != ""){
				$where .= " AND `uid` IN {$content_uid_string}";
			}
			
			if($tc){
				$i = 0;
				foreach($tc as $key=&gt;$value){
					if($value){
						$where .= " AND `option{$i}`.`option_key` LIKE '{$key}'";
						$where .= " AND `option{$i}`.`option_value` LIKE '{$value}'";
						$i++;
					}
				}
			}
			
			$where .= " AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
		}
	}
	
	return $where;
}

add_filter('kboard_list_orderby', 'my_kboard_list_orderby', 10, 3);
function my_kboard_list_orderby($order, $board_id, $content_list){
	if($board_id == 1){ // 실제 게시판 ID
		$order = '`content`.`date` DESC';
	}
	
	return $order;
}</code></pre>

<p>임의로 주석처리된 함수들은 어떤 역할인지 알 수가 없어</p>

<p>주석처리 해두었습니다.</p>

<p> </p>

<p>정확한 상황을 알 수 없어 동작하지 않을 수도 있습니다.</p>

<p>홈페이지의 구성에 맞게 적절히 수정하여 사용해보시겠어요?</p>

<p><br />
위 필터들에 대한 가이드는 </p>

<p>아래 링크에서 확인해보실 수 있습니다.</p>

<p><a href="https://www.cosmosfarm.com/products/kboard/hooks" target="_blank">https://www.cosmosfarm.com/products/kboard/hooks</a></p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Wed, 13 Apr 2022 08:53:54 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[필터링 기능 가능합니다.

문제는 계층형 카테고리랑 검색이 연동이 안됩니다.

 


add_filter('kboard...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58771</link>
			<description><![CDATA[<p>필터링 기능 가능합니다.</p>

<p>문제는 계층형 카테고리랑 검색이 연동이 안됩니다.</p>

<p> </p>

<pre>
<code class="language-php">add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
    global $wpdb;
    
    //시간
    $start_date = isset($_GET['start_date']) ? sanitize_text_field($_GET['start_date']) : '';
    $date = date('Y-m-d', strtotime('-3 month', current_time('timestamp'))); 
    
    //쿠폰
    $chkcoupon_data = isset($_GET['chkcoupon']) ? sanitize_text_field($_GET['chkcoupon']) : '';
    
    $keyword = kboard_keyword();
    if(!kboard_target() &amp;&amp; $board_id == '2'){ // 실제 게시판 id로 적용해주세요.
        $content_uid_string = get_event_id();
        $chkcoupon_uid_string = get_chkcoupon_id();
        $tree_category_1_uid_string = get_category_1_id();

        $where = "`board_id`='{$board_id}'";

        if($keyword){
            $where .=  " AND `title` LIKE '%{$keyword}%'";
        }

        if($start_date){
            $where .= " AND `date` &gt;= '{$date}'";
        }
        
        if($chkcoupon_data  != ""){
            $where .= " AND `uid` IN {$chkcoupon_uid_string}";
        }

        if($content_uid_string == "()"){
            $where .= " AND `uid` = -1";
        }

        if($content_uid_string != ""){
            $where .= " AND `uid` IN {$content_uid_string}";
        }

        $where .= " AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    }

    return $where;
    
}
</code></pre>

<p>최종 소스 수정본이고, 여기서 계층형카테고리도 같이 검색되고 싶습니다.</p>

<p> </p>

<p> </p>

<p> </p>]]></description>
			<author>패치워크</author>
			<pubDate>Mon, 11 Apr 2022 01:30:02 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안내드린 코드와 작성된 형식이 달라

정확하게는 파악이 어렵지만

코드만 봤을 때는 원하셨던 목적과 ...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58768</link>
			<description><![CDATA[<p>안내드린 코드와 작성된 형식이 달라</p>

<p>정확하게는 파악이 어렵지만</p>

<p>코드만 봤을 때는 원하셨던 목적과 결과값이 일치할 듯 합니다.</p>

<p> </p>

<p>남겨주신 링크에 접속하여 확인해보니</p>

<p>필터링이 되는듯 한데 혹시 해결되셨나요?</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 11 Apr 2022 01:09:36 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[functions.php 파일에


function get_category_1_id(){
    if(!isset($_GET['kboard_search_option'][...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58747</link>
			<description><![CDATA[<p>functions.php 파일에</p>

<pre>
<code class="language-php">function get_category_1_id(){
    if(!isset($_GET['kboard_search_option']['tree_category_1']['value'])){
        return;
    }
    // if(!isset($_GET['tree_category_1'])){
    //     return;
    // }

    global $wpdb;
    $tree_category_1 = $_GET['kboard_search_option']['tree_category_1']['value'];
    // $tree_category_1 = $_GET['tree_category_1'];

    $sql = "SELECT DISTINCT content_uid FROM wp_kboard_board_option WHERE 0=0 
            AND `option_key`='tree_category_1' AND `option_value` = '$tree_category_1'";

    $tree_category_1_Array = $wpdb-&gt;get_results( 
        $wpdb-&gt;prepare($sql)
    );


    $tree_category_1_uid_Array_count = count($tree_category_1_Array);
    $tree_category_1_uid_string = "(";
    for($i = 0; $i &lt; $tree_category_1_uid_Array_count; $i++){
        if($i &gt; 0){
            $tree_category_1_uid_string .= ", ";
        }
        $tree_category_1_uid_string .= "'{$tree_category_1_Array[$i]-&gt;content_uid}'";
    }
    $tree_category_1_uid_string .= ")";

    // echo var_dump($tree_category_1_uid_string);
    return $tree_category_1_uid_string;

}</code></pre>

<p>이런식으로 함수를 만들어서</p>

<p> </p>

<p>kboard_list_where 훅으로 where절을 만들었습니다.</p>

<pre>
<code class="language-php">add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
    global $wpdb;
    
    // $eventid = isset($_GET['eventid']) ? $_GET['eventid'] : '';
    // echo var_dump($eventid); return

    //시간
    $start_date = isset($_GET['start_date']) ? sanitize_text_field($_GET['start_date']) : '';
    $date = date('Y-m-d', strtotime('-3 month', current_time('timestamp'))); 
    
    //쿠폰
    $chkcoupon_data = isset($_GET['chkcoupon']) ? sanitize_text_field($_GET['chkcoupon']) : '';
    
    $keyword = kboard_keyword();
    if(!kboard_target() &amp;&amp; $board_id == '2'){ // 실제 게시판 id로 적용해주세요.
        $content_uid_string = get_event_id();
        $chkcoupon_uid_string = get_chkcoupon_id();
        $tree_category_1_uid_string = get_category_1_id();

        $where = "`board_id`='{$board_id}'";

        if($keyword){
            $where .=  " AND `title` LIKE '%{$keyword}%'";
        }

        if($start_date){
            $where .= " AND `date` &gt;= '{$date}'";
        }
        
        if($chkcoupon_data == "()"){
            $where .= " AND `uid` = -1";
        }
        
        else if($chkcoupon_data  != ""){
            $where .= " AND `uid` IN {$chkcoupon_uid_string}";
        }

        if($tree_category_1_uid_string == "()"){
            $where .= " AND `uid` = -1";
        }

        else if($tree_category_1_uid_string != ""){
            $where .= " AND `uid` IN {$tree_category_1_uid_string}";
        }

        if($content_uid_string == "()"){
            $where .= " AND `uid` = -1";
        }

        else if($content_uid_string != ""){
            $where .= " AND `uid` IN {$content_uid_string}";
        }

        $where .= " AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    }
    // $where = "`uid` in {$content_uid_string}";
    // echo $sub_where;
    echo $where;
    return $where;
    
}</code></pre>

<p> </p>

<p>데이터베이스에서 조건문 확인 결과 잘 나오긴 하는데,</p>

<p>리스트로는 안뿌려지내요.</p>

<p> </p>

<p> </p>]]></description>
			<author>패치워크</author>
			<pubDate>Fri, 08 Apr 2022 02:48:34 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[뭔가 잘못된 듯 합니다.

입력하신 코드를 남겨주시면

어떤 부분이 문제인지 확인 도와드리겠습니다.

...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58743</link>
			<description><![CDATA[<p>뭔가 잘못된 듯 합니다.</p>

<p>입력하신 코드를 남겨주시면</p>

<p>어떤 부분이 문제인지 확인 도와드리겠습니다.</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Fri, 08 Apr 2022 01:28:03 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[보내주신 내용을 수정해서 검색 기능을 완성했는데,

계층형카테고리랑 같이 검색을 하려고 하니,

계층...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58740</link>
			<description><![CDATA[<p>보내주신 내용을 수정해서 검색 기능을 완성했는데,</p>

<p>계층형카테고리랑 같이 검색을 하려고 하니,</p>

<p>계층형 카테고리는 검색이 안되서</p>

<p>option_value 값을 뽑아서 게시글 uid 검색이 되게끔 했는데,</p>

<p>문법은 틀리지 않은거 같은데 검색이 안됩니다.</p>

<p>계층형 카테고리 a태그에 있는 onclick 때문에 안되는 걸까요??</p>

<p>위에 적어 놓은 url에 적용해 놓았습니다.</p>

<p> </p>]]></description>
			<author>패치워크</author>
			<pubDate>Fri, 08 Apr 2022 00:38:26 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

남겨주신 링크에 접속하여 확인해보니

start_date 등의 input 태그의 name이 get 형태...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/58728</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>남겨주신 링크에 접속하여 확인해보니</p>

<p>start_date 등의 input 태그의 name이 get 형태로 전달되는 것을</p>

<p>확인할 수 있었습니다.</p>

<p> </p>

<p>아래의 코드를 참고하여 적용해보시겠어요?</p>

<pre>
<code>add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
	global $wpdb;
	
	$start_date = isset($_GET['start_date']) ? sanitize_text_field($_GET['start_date']) : '';
	
	$keyword = kboard_keyword();
	if($keyword &amp;&amp; !kboard_target() &amp;&amp; $board_id == '1'){ // 실제 게시판 id로 적용해주세요.
		$where  = "`board_id`='{$board_id}' AND (`title` LIKE '%{$keyword}%' OR `content` LIKE '%{$keyword}%' OR";
		if($start_date){
			$where .= " (`{$wpdb-&gt;prefix}kboard_board_option`.`option_key`='start_date' AND `{$wpdb-&gt;prefix}kboard_board_option`.`option_value` = '{$start_date}'))";
		}
		//...
		$where .= " AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
	
	return $where;
}</code></pre>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Thu, 07 Apr 2022 02:11:30 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>