<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[최신글 기간에 대해서]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/23913</link>
		<description><![CDATA[<p>안녕하세요 항상 답변 친절하게 달아주셔서 감사합니다.</p>

<p>add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);<br />
function my_kboard_list_where($where, $board_id, $content_list){<br />
    if($content_list-&gt;is_latest &amp;&amp; in_array($board_id, array('4', '7', '8'))){<br />
        $where .= "AND `vote` &gt;= 3";<br />
    }<br />
    return $where;<br />
}</p>

<p>제가 일반 게시글 같은 경우는 위에 처럼 최신글을 추천3이상만 나타나게 할 수 있는데 이걸</p>

<p>https://www.cosmosfarm.com/threads/document/23803</p>

<p>에서 답변 달아주신거처럼 최신글 모아보기 id로 할려면 어떻게 해야되죠?</p>

<p> </p>

<p>최신글모아보기<strong> '추천3이상'</strong> <strong>'기간은 3일 안에 쓰여진 거만'</strong> 이렇게 나타내고 싶습니다.</p>

<p> </p>

<p> </p>

<p>2. 저번에 https://www.cosmosfarm.com/threads/document/23803  2번째 질문에서 알려주신대로</p>

<p>날짜 관련 지워도 작동이 안되네요  https://www.cosmosfarm.com/threads/document/21414에서 알려준 코드가 작동이 안되요..</p>

<p>일반 게시판에서는 되는데 전체게시판 코드만 적용이 안되요</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요.

아래의 코드는 어떤 이유로 추가하셨는지요?

테마의 functions.php 파일에서 아래의 코드...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/23948</link>
			<description><![CDATA[<p>안녕하세요.</p>

<p>아래의 코드는 어떤 이유로 추가하셨는지요?</p>

<p>테마의 functions.php 파일에서 아래의 코드를 지우고 확인해보시겠어요?</p>

<pre>
<code class="language-php">add_filter('kboard_list_where', 'week_best_kboard_list_where', 10, 3);
function week_best_kboard_list_where($where, $board_id, $content_list){
	
	if($board_id == '118'){ // 실제 적용될 게시판의 ID값으로 변경해주세요.
		$where = "`parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
	
	return $where;
}</code></pre>

<p> </p>

<p>1번에서 알려드린 코드에서 id부분은 최신글 모아보기 id가 아닌</p>

<p>실제 게시판 id로 적용하신 후에 확인해보시겠어요?</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Wed, 27 Jun 2018 01:08:56 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[우선 답변감사합니다.

2. 일반 게시판에서는 https://www.cosmosfarm.com/threads/document/21414  코...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/23934</link>
			<description><![CDATA[<p>우선 답변감사합니다.</p>

<p>2. 일반 게시판에서는 https://www.cosmosfarm.com/threads/document/21414  코드가 작동이 되고요</p>

<p> </p>

<p> </p>

<pre>
<code class="language-php">add_filter('kboard_list_where', 'week_best_kboard_list_where', 10, 3);
function week_best_kboard_list_where($where, $board_id, $content_list){
	
	if($board_id == '118'){ // 실제 적용될 게시판의 ID값으로 변경해주세요.
		$where = "`parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
	
	return $where;
}</code></pre>

<p> </p>

<p>처럼 위에 코드가 적용된 id 188번인 게시판에서는</p>

<p> </p>

<p> </p>

<pre>
<code class="language-php">add_filter('kboard_list_date_range', 'my_kboard_list_date_range', 10, 3);
function my_kboard_list_date_range($date, $board, $content_list){
	$sort_date = isset($_GET['my_kboard_list_sort'])?$_GET['my_kboard_list_sort']:'';
	
	if($sort_date == 'week'){
		$date['start_date'] = date("YmdHis", strtotime("-1 week", current_time('timestamp')));
	}
	else if($sort_date == 'month'){
		$date['start_date'] = date("YmdHis", strtotime("-1 month", current_time('timestamp')));
	}
	else{
		$date['start_date'] = date("YmdHis", strtotime("-1 year", current_time('timestamp')));
	}
	
	$date['end_date'] = date("YmdHis", strtotime("now", current_time('timestamp')));

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

<p>위에 코드인 1년, 1개월, 1주일 이 작동을 안합니다.</p>

<p> </p>

<p>--------------------------------------------------------------------------------</p>

<p>1번에서 알려주신 코드 적용 해 본 결과 제가 한 페이지에 최신글 모아보기 id5랑 id6이 있는데 6,7,8적용했더니</p>

<p>이상하게 5만 적용되고 6에는 적용이 안되더라고요 왜 그런거죠?..,</p>

<p> </p>]]></description>
			<author>도도도</author>
			<pubDate>Tue, 26 Jun 2018 09:46:55 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

1. 아래의 코드를 활용해보시겠어요?


add_filter('kboard_list_where', 'my_kboard_li...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/23921</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>1. 아래의 코드를 활용해보시겠어요?</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){
	if($content_list-&gt;is_latest &amp;&amp; is_array($board_id)){
		foreach($board_id as $item){
			if(in_array($item, array('4', '7', '8'))){
				$where .= " AND `vote` &gt;= 3 AND `date` &gt;= date_add(now(), interval -3 day)";
			}
		}
		
	}

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

<p> </p>

<p>2. 아래 링크의 코드는 별개의 문제인지요?</p>

<p><a href="http://https//www.cosmosfarm.com/threads/document/21414" target="_blank"> https://www.cosmosfarm.com/threads/document/21414</a></p>

<p>좀 더 자세하게 설명해주시겠어요?</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Tue, 26 Jun 2018 08:59:48 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>