<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[최신글 모아보기 id 체크에 대해 질문..]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/23803</link>
		<description><![CDATA[<p>워드프레스 게시판 KBoard(케이보드) 사용중입니다.</p>

<p>제가 일반 게시판은</p>

<p>&lt;?php if($board-&gt;id == '8'):?&gt;<br />
&lt;p&gt;게시판 1 출력 &lt;/p&gt;<br />
&lt;?php elseif($board-&gt;id == '7'):?&gt;<br />
&lt;p&gt;게시판 2 출력 &lt;/p&gt;<br />
&lt;?php endif?&gt;</p>

<p> </p>

<p>이런식으로 id에 따라 한  페이지에 다른 글씨를 출력할 수 있는데..</p>

<p>최신글모아보기 id는 어떻게 해야 할 수 있죠?</p>

<p> </p>

<p>&lt;?php if(<strong>$board-&gt;id</strong> == '8'):?&gt;<br />
&lt;p&gt;게시판 1 출력 &lt;/p&gt;<br />
&lt;?php elseif(<strong>$board-&gt;id</strong> == '7'):?&gt;<br />
&lt;p&gt;게시판 2 출력 &lt;/p&gt;<br />
&lt;?php endif?&gt;</p>

<p>굵게 표시한 부분을 어떻게 바꾸어야 할지..</p>

<p>최신글 id는 [kboard_latestview id=6] 이런거요..</p>

<p> </p>

<p> </p>

<p>+ 질문 한개만 더 드립니다. ㅎㅎ</p>

<p> </p>

<p>제가 전체게시판을 만들려고 블로그 참고해서</p>

<p>add_filter('kboard_list_where', 'week_best_kboard_list_where', 10, 3);<br />
function week_best_kboard_list_where($where, $board_id, $content_list){</p>

<p>    if($board_id == '118'){ // 실제 적용될 게시판의 ID값으로 변경해주세요.</p>

<p><br />
        $where = "`date`&gt;='{$date}' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";<br />
    }</p>

<p>    return $where;<br />
}</p>

<p>으로 만들었는데요 이게 저번에 https://www.cosmosfarm.com/threads/document/21414 에서 알려주신</p>

<p>코드가 작동이 안되요 어떻게 해결하나요??..</p>

<p> </p>

<p> </p>

<p>+ 위젯 업데이트 후 '인기글', '추천글'의 주기를 3일로 바꾸려면 어떻게 해야되죠?</p>

<p>항상 고생많으시고 감사합니다.</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[전체 게시판 관련해서는

날짜(date)를 체크할 필요가 없다면 쿼리에서 제거를 해보세요.

아래 코드 참...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/23846</link>
			<description><![CDATA[<p>전체 게시판 관련해서는</p>

<p>날짜(date)를 체크할 필요가 없다면 쿼리에서 제거를 해보세요.</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>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 25 Jun 2018 07:17:35 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

최신글 모아보기에서 id값을 체크하시려면 (게시판의 id값이 아닌 최신글 모아보기의 id...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/23845</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>최신글 모아보기에서 id값을 체크하시려면 (게시판의 id값이 아닌 최신글 모아보기의 id값)</p>

<p>우선 파일을 수정해주셔야 합니다.</p>

<p>가급적 최신 버전의 KBoard(케이보드) 플러그인으로 업데이트해서 사용해주세요.</p>

<p>아래 내용은 최신 버전에 포함하도록 하겠습니다.</p>

<p> </p>

<p>1. /wp-content/plugins/kboard/index.php 파일을 편집해주세요.</p>

<p>아래 코드를 찾아주세요.</p>

<pre>
<code class="language-php">add_shortcode('kboard_latestview', 'kboard_latestview_shortcode');
function kboard_latestview_shortcode($args){
	if(!isset($args['id']) || !$args['id']) return 'KBoard 알림 :: id=null, 아이디값은 필수입니다.';
	
	$latestview = new KBLatestview($args['id']);
	if($latestview-&gt;uid){
		$board_builder = new KBoardBuilder($latestview-&gt;getLinkedBoard(), true);
		$board_builder-&gt;setSkin($latestview-&gt;skin);
		$board_builder-&gt;setRpp($latestview-&gt;rpp);
		$board_builder-&gt;setSorting($latestview-&gt;sort);
		$board_builder-&gt;category1 = '';
		$board_builder-&gt;category2 = '';
		
		$with_notice = true;
		if(isset($args['with_notice']) &amp;&amp; $args['with_notice'] == 'false'){
			$with_notice = false;
		}
		
		$latest = $board_builder-&gt;createLatest($with_notice);
		return $latest;
	}
	else{
		return 'KBoard 알림 :: id='.$args['id'].', 생성되지 않은 최신글 뷰 입니다.';
	}
}</code></pre>

<p>아래 코드로 교체해주세요.</p>

<pre>
<code class="language-php">add_shortcode('kboard_latestview', 'kboard_latestview_shortcode');
function kboard_latestview_shortcode($args){
	if(!isset($args['id']) || !$args['id']) return 'KBoard 알림 :: id=null, 아이디값은 필수입니다.';
	
	$latestview = new KBLatestview($args['id']);
	if($latestview-&gt;uid){
		$board_builder = new KBoardBuilder($latestview-&gt;getLinkedBoard(), true);
		$board_builder-&gt;setSkin($latestview-&gt;skin);
		$board_builder-&gt;setRpp($latestview-&gt;rpp);
		$board_builder-&gt;setSorting($latestview-&gt;sort);
		$board_builder-&gt;category1 = '';
		$board_builder-&gt;category2 = '';
		
		$with_notice = true;
		if(isset($args['with_notice']) &amp;&amp; $args['with_notice'] == 'false'){
			$with_notice = false;
		}
		
		$args['type'] = 'latestview';
		$latest = $board_builder-&gt;createLatest($with_notice, $args);
		return $latest;
	}
	else{
		return 'KBoard 알림 :: id='.$args['id'].', 생성되지 않은 최신글 뷰 입니다.';
	}
}</code></pre>

<p> </p>

<p> </p>

<p>2. /wp-content/plugins/kboard/class/KBoardBuilder.class.php 파일을 편집해주세요.</p>

<p>아래 코드를 찾아주세요.</p>

<pre>
<code class="language-php">public function createLatest($with_notice=true){
	ob_start();
	
	$list = new KBContentList($this-&gt;board_id);
	
	if(!is_array($this-&gt;board_id) &amp;&amp; $this-&gt;board-&gt;isPrivate()){
		if(is_user_logged_in()){
			$list-&gt;memberUID(get_current_user_id());
		}
		else{
			$list-&gt;stop = true;
		}
	}
	
	$list-&gt;is_latest = true;
	$list-&gt;category1($this-&gt;category1);
	$list-&gt;category2($this-&gt;category2);
	$list-&gt;setSorting($this-&gt;sort);
	$list-&gt;rpp($this-&gt;rpp);
	$list-&gt;setWithinDays($this-&gt;within_days);
	$list-&gt;getList('', '', $with_notice);
	
	$url = new KBUrl();
	$url-&gt;setBoard($this-&gt;board);
	
	$vars = array(
		'board_url' =&gt; $this-&gt;url,
		'list' =&gt; $list,
		'url' =&gt; $url,
		'skin' =&gt; $this-&gt;skin,
		'skin_path' =&gt; $this-&gt;skin-&gt;url($this-&gt;skin_name),
		'skin_dir' =&gt; $this-&gt;skin-&gt;dir($this-&gt;skin_name),
		'board' =&gt; $this-&gt;board,
		'boardBuilder' =&gt; $this,
	);
	
	echo $this-&gt;skin-&gt;load($this-&gt;skin_name, 'latest.php', $vars);
	
	return ob_get_clean();
}</code></pre>

<p>아래 코드로 교체해주세요.</p>

<pre>
<code class="language-php">public function createLatest($with_notice=true, $args=array()){
	ob_start();
	
	$list = new KBContentList($this-&gt;board_id);
	
	if(!is_array($this-&gt;board_id) &amp;&amp; $this-&gt;board-&gt;isPrivate()){
		if(is_user_logged_in()){
			$list-&gt;memberUID(get_current_user_id());
		}
		else{
			$list-&gt;stop = true;
		}
	}
	
	$list-&gt;is_latest = true;
	$list-&gt;category1($this-&gt;category1);
	$list-&gt;category2($this-&gt;category2);
	$list-&gt;setSorting($this-&gt;sort);
	$list-&gt;rpp($this-&gt;rpp);
	$list-&gt;setWithinDays($this-&gt;within_days);
	$list-&gt;getList('', '', $with_notice);
	
	$url = new KBUrl();
	$url-&gt;setBoard($this-&gt;board);
	
	$vars = array(
		'latest' =&gt; $args,
		'board_url' =&gt; $this-&gt;url,
		'list' =&gt; $list,
		'url' =&gt; $url,
		'skin' =&gt; $this-&gt;skin,
		'skin_path' =&gt; $this-&gt;skin-&gt;url($this-&gt;skin_name),
		'skin_dir' =&gt; $this-&gt;skin-&gt;dir($this-&gt;skin_name),
		'board' =&gt; $this-&gt;board,
		'boardBuilder' =&gt; $this,
	);
	
	echo $this-&gt;skin-&gt;load($this-&gt;skin_name, 'latest.php', $vars);
	
	return ob_get_clean();
}</code></pre>

<p> </p>

<p>3. 그다음 스킨의 latest.php 파일에서 아래 코드를 추가해서 확인해보시겠어요?</p>

<pre>
<code class="language-php">&lt;?php
if(isset($latest)){
	echo $latest['type']; // latestview 또는 latest
	echo $latest['id']; // 숏코드에 포함된 id값
}
?&gt;</code></pre>

<p>해당 값들을 if 문으로 체크해서 코드를 만들어보세요.</p>

<p> </p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 25 Jun 2018 07:13:18 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>