<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[첨부파일 다운로드시 글 작성자에게 포인트 지급]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/26952</link>
		<description><![CDATA[안녕하세요^^<br />
<br />
첨부파일 다운로드 시 글 작성자에게 일부 포인트를 지급하고 싶은데 가능할까요?<br />
<br />
예를들어<br />
파일을 첨부하여 글 작성 시<br />
다운로드 하는사람은 포인트 -10감소(이건 게시판 설정에서 가능한데)<br />
글 작성자에게는 포인트 +2증가<br />
<br />
이런식으로 하고 싶습니다.]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요~^^

KBaord 플러그인에서 첨부파일 다운로드 감소 포인트를 설정했을 때

글 작성자의 포인...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/26953</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>KBaord 플러그인에서 첨부파일 다운로드 감소 포인트를 설정했을 때</p>

<p>글 작성자의 포인트를 2 증가하게 하시려면</p>

<p>워드프레스 관리자 -&gt; 외모 -&gt; 테마 편집기 페이지에서 functions.php 파일 하단에</p>

<p>아래의 코드를 추가해보시겠어요?</p>

<pre>
<code class="language-php">add_action('kboard_file_download', 'my_kboard_file_download', 10, 4);
function my_kboard_file_download($file_info, $content, $board, $comment){
	if($board-&gt;id == '1' &amp;&amp; $board-&gt;meta-&gt;attachment_download_down_point){
		if(function_exists('mycred_add')){
			if(!is_user_logged_in()){
				do_action('kboard_cannot_download_file', 'go_back', wp_get_referer(), $content, $board, $comment);
				exit;
			}
			else if($content-&gt;member_uid != get_current_user_id()){
				$log_args['user_id'] = get_current_user_id();
				$log_args['ref'] = 'attachment_download_down_point';
				$log_args['ref_id'] = $content-&gt;uid;
				$log = new myCRED_Query_Log($log_args);
				
				if(!$log-&gt;have_entries()){
					$balance = mycred_get_users_balance(get_current_user_id());
					if($board-&gt;meta-&gt;attachment_download_down_point &gt; $balance){
						do_action('kboard_cannot_download_file', 'not_enough_points', wp_get_referer(), $content, $board, $comment);
						exit;
					}
					else{
						$point = intval(get_user_meta($content-&gt;member_uid, 'kboard_document_mycred_point', true));
						update_user_meta($content-&gt;member_uid, 'kboard_document_mycred_point', $point + 2);
						
						mycred_add('attachment_download_up_point', $content-&gt;member_uid, 2, '첨부파일 다운로드 증가 포인트', $content-&gt;uid);
					}
				}
			}
		}
	}
}</code></pre>

<p>위의 코드에서 $board-&gt;id == '1' 부분은 실제 게시판 id로 적용해보세요.</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Thu, 18 Oct 2018 00:42:06 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>