<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[카테고리별 베스트게시물 기준 및 추천시 획득 포인트 변화]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/39740</link>
		<description><![CDATA[<p>예를 들어서 1게시판에서 debate을 선택하면 추천 10이 기준이고, news를 선택하면 추천 20이 기준이되고, meme을 선택하면 추천 30이 기준이 되게 하려 합니다.</p>

<p>일단 이것 저것 보면서 코드를 짜보려고 했지만 모르겠는게 있어서 올립니다. 일단 functions.php를 이렇게 바꿀 예정입니다.</p>

<p>추가적으로 작성자들이 카테고리를 설정하면 자동으로 카테고리를 인식해서 기준에따라 베스트를 나누어야할텐데 editor나 document를 바꿔야하는건가요? 카테고리를 코드를 뭐라고 넣어야하나요? 넣어야하는듯 한데 어떻게 하나요?</p>

<pre>
<code>&lt;?php

function theme_enqueue_styles() {
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'avada-stylesheet' ) );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

function avada_lang_setup() {
	$lang = get_stylesheet_directory() . '/languages';
	load_child_theme_textdomain( 'Avada', $lang );
}
add_action( 'after_setup_theme', 'avada_lang_setup' );

add_filter('kboard_list_where', 'my_kboard_list_where', 10, 3);
function my_kboard_list_where($where, $board_id, $content_list){
	if($board_id == '8'){
		$vote1 = '10';
    $vote2 = '20';//기존에서 이렇게 추가하였습니다.
    $vote1 = '30';
		$where = "`vote`&gt;='{$vote1}' AND `board_id` IN ('3') AND `category`='debate' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    $where = "`vote`&gt;='{$vote2}' AND `board_id` IN ('3') AND `category`='news' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    $where = "`vote`&gt;='{$vote3}' AND `board_id` IN ('3') AND `category`='meme' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
  if($board_id == '9'){
    $vote = '10';
    $where = "`vote`&gt;='{$vote1}' AND `board_id` IN ('2') AND `category`='debate' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    $where = "`vote`&gt;='{$vote2}' AND `board_id` IN ('2') AND `category`='news' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    $where = "`vote`&gt;='{$vote3}' AND `board_id` IN ('2') AND `category`='meme' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
  if($board_id == '10'){
    $vote = '10';
    $where = "`vote`&gt;='{$vote1}' AND `board_id` IN ('6') AND `category`='debate' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    $where = "`vote`&gt;='{$vote2}' AND `board_id` IN ('6') AND `category`='news' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
    $where = "`vote`&gt;='{$vote3}' AND `board_id` IN ('6') AND `category`='meme' AND `parent_uid`='0' AND `notice`='' AND (`status`='' OR `status` IS NULL OR `status`='pending_approval')";
	}
	return $where;
}

add_filter('kboard_list_orderby', 'today_best_kboard_list_orderby', 10, 3);
function today_best_kboard_list_orderby($orderby, $board_id, $content_list){
	if(in_array($board_id, array('8','9','10'))){
		$orderby = "(`vote`) DESC, `date` DESC";
	}
	return $orderby;
}

add_filter('kboard_allowed_board_id', 'my_kboard_allowed_board_id', 10, 2);
function my_kboard_allowed_board_id($allowed_board_id, $board_id){
	if($allowed_board_id == '8'){
		$allowed_board_id = array('8', '3');
	}
  elseif ($allowed_board_id == '9') {
    $allowed_board_id = array('9', '2');
	}
  elseif ($allowed_board_id == '10') {
    $allowed_board_id = array('10', '6');
  }
	return $allowed_board_id;
}
</code></pre>

<p>두번째로 카테고리에 따라 추천받을시 획득하는 포인트를 다르게 하고자합니다.</p>

<p> </p>

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

<p>을 참고하여 해결하고자 하나 추가적 조건으로 카테고리에 따라 포인트 증가를 바꿀경우</p>

<pre>
<code>add_action('kboard_content_like', 'my_kboard_content_like', 10, 2);
function my_kboard_content_like($content, $board){
	if($content-&gt;member_uid){
		mycred_add('kboard_content_like', $content-&gt;member_uid, 1, 'KBoard 좋아요 포인트', $content-&gt;uid);
	}
}</code></pre>

<p>에서 카테고리에 대한 조건을 어디에 넣어야하나요...?</p>

<p> </p>

<p>언제나 친절하게 답변해주셔서 감사합니다. ㅠㅠ</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요~^^

category 컬럼은 기본적으로 KBoard(케이보드)에는 없는 컬럼인데 직접 추가하신 건지요...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/39759</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>category 컬럼은 기본적으로 KBoard(케이보드)에는 없는 컬럼인데 직접 추가하신 건지요?</p>

<p>컬럼이 있다고 가정하고 코드를 만들어보자면 아래와 같습니다.</p>

<pre>
<code class="language-php">add_action('kboard_content_like', 'my_kboard_content_like_20191223', 10, 2);
function my_kboard_content_like_20191223($content, $board){
	if($content-&gt;member_uid){
		if($content-&gt;category == 'debate'){ // 저장된 값 체크
			mycred_add('kboard_content_like', $content-&gt;member_uid, 10, 'KBoard 좋아요 포인트', $content-&gt;uid);
		}
		if($content-&gt;category == 'news'){ // 저장된 값 체크
			mycred_add('kboard_content_like', $content-&gt;member_uid, 20, 'KBoard 좋아요 포인트', $content-&gt;uid);
		}
	}
}</code></pre>

<p>테마의 functions.php 파일에 코드를 추가해서 확인해보시겠어요?</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Mon, 23 Dec 2019 03:32:10 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>