<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[답변글에 대한 알림 설정 문의드립니다.]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/25192</link>
		<description><![CDATA[<p>댓글을 쓰면 글 게시자에게 댓글 알림이 메일로 갑니다. <br />
댓글을 단 A라는 사람 글에 B글게시자, 관리자가 답글을 남기면 A댓글분에게 메일로 답글에 대한 알림이 갔으면 좋겠습니다.<br />
두분 다 회원입니다. </p>

<p>검색하다 아래 코드를 functions.php에 넣었습니다.   표시되는 오류들입니다..<br />
.에러로그 &gt; PHP Notice: Undefined index: product_type in /wp-content/plugins/mangboard/plugins/widgets/commerce_gallery/commerce_gallery.php on line 156<br />
.워드프레스 &gt; 외모&gt; 테마편집기에서 수정하며....<br />
&gt;&gt; 오류글:  치명적인 에러를 점검하기 위해 사이트와 통신할 수 업습니다. 따라서 PHP 변경사항이 원래의 것으로 복구됐습니다. PHP 파일 변경사항을 SFTP와 같은 다른 수단을 통해 업로드 해야 합니다.</p>

<p>(https://www.cosmosfarm.com/threads/document/12637)<br />
add_action('kboard_comments_insert', 'my_kboard_comments_insert', 10, 2);<br />
function my_kboard_comments_insert($comment_uid, $content_uid){<br />
    $comment = new KBComment();<br />
    $comment-&gt;initWithUID($comment_uid);<br />
    $document = new KBContent();<br />
    $document-&gt;initWithUID($content_uid);<br />
    <br />
    if($comment-&gt;parent_uid){<br />
        $parent = new KBComment();<br />
        $parent-&gt;initWithUID($comment-&gt;parent_uid);<br />
        <br />
        if($parent-&gt;user_uid){<br />
            $user = new WP_User($parent-&gt;user_uid);<br />
        <br />
            if($user-&gt;user_email &amp;&amp; $user-&gt;id != get_current_user_id()){<br />
                if(!class_exists('KBMail')){<br />
                    include_once KBOARD_DIR_PATH . '/class/KBMail.class.php';<br />
                }<br />
                $url = new KBUrl();<br />
                $mail = new KBMail();<br />
                $mail-&gt;to = $user-&gt;user_email;<br />
                $mail-&gt;title = "답글이 등록 되었습니다.";<br />
                $mail-&gt;content = $comment-&gt;content;<br />
                $mail-&gt;url = $url-&gt;getDocumentRedirect($document-&gt;uid);<br />
                $mail-&gt;send();<br />
            }<br />
        }<br />
        else if($parent-&gt;option-&gt;email){<br />
            if(!class_exists('KBMail')){<br />
                include_once KBOARD_DIR_PATH . '/class/KBMail.class.php';<br />
            }<br />
            $url = new KBUrl();<br />
            $mail = new KBMail();<br />
            $mail-&gt;to = $parent-&gt;option-&gt;email;<br />
            $mail-&gt;title = "답글이 등록 되었습니다.";<br />
            $mail-&gt;content = $comment-&gt;content;<br />
            $mail-&gt;url = $url-&gt;getDocumentRedirect($document-&gt;uid);<br />
            $mail-&gt;send();<br />
        }<br />
    }<br />
}</p>

<p> </p>

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

<p>현재 &gt;&gt; </p>

<h2>테마 함수 (functions.php)에 적용된 추가 코드입니다.</h2>

<p>add_action('kboard_comments_insert', 'my_kboard_comments_insert', 10, 2);<br />
function my_kboard_comments_insert($insert_id, $content_uid){<br />
    $comment = new KBComment();<br />
    $comment-&gt;initWithUID($insert_id);<br />
    $document = new KBContent();<br />
    $document-&gt;initWithUID($content_uid);<br />
    <br />
    if($document-&gt;member_uid){<br />
        $user = new WP_User($document-&gt;member_uid);<br />
        <br />
        if($user-&gt;user_email &amp;&amp; $user-&gt;ID != get_current_user_id()){<br />
            if(!class_exists('KBMail')){<br />
                include_once KBOARD_DIR_PATH . '/class/KBMail.class.php';<br />
            }<br />
            <br />
            $url = new KBUrl();<br />
            $mail = new KBMail();<br />
            $mail-&gt;to = $user-&gt;user_email;<br />
            $mail-&gt;title = "[댓글알림] {$document-&gt;title}";<br />
            $mail-&gt;content = $comment-&gt;content;<br />
            $mail-&gt;url = $url-&gt;getDocumentRedirect($document-&gt;uid);<br />
            $mail-&gt;url_name = __('Go to Homepage', 'kboard');<br />
            $mail-&gt;send();<br />
        }<br />
    }<br />
}<br />
add_action('kboard_comments_insert', 'my_kboard_comments_insert', 10, 2);<br />
function my_kboard_comments_insert($comment_uid, $content_uid){<br />
    $comment = new KBComment();<br />
    $comment-&gt;initWithUID($comment_uid);<br />
    $document = new KBContent();<br />
    $document-&gt;initWithUID($content_uid);<br />
    <br />
    if($comment-&gt;parent_uid){<br />
        $parent = new KBComment();<br />
        $parent-&gt;initWithUID($comment-&gt;parent_uid);<br />
        <br />
        if($parent-&gt;user_uid){<br />
            $user = new WP_User($parent-&gt;user_uid);<br />
        <br />
            if($user-&gt;user_email &amp;&amp; $user-&gt;id != get_current_user_id()){<br />
                if(!class_exists('KBMail')){<br />
                    include_once KBOARD_DIR_PATH . '/class/KBMail.class.php';<br />
                }<br />
                $url = new KBUrl();<br />
                $mail = new KBMail();<br />
                $mail-&gt;to = $user-&gt;user_email;<br />
                $mail-&gt;title = "답글이 등록 되었습니다.";<br />
                $mail-&gt;content = $comment-&gt;content;<br />
                $mail-&gt;url = $url-&gt;getDocumentRedirect($document-&gt;uid);<br />
                $mail-&gt;send();<br />
            }<br />
        }<br />
        else if($parent-&gt;option-&gt;email){<br />
            if(!class_exists('KBMail')){<br />
                include_once KBOARD_DIR_PATH . '/class/KBMail.class.php';<br />
            }<br />
            $url = new KBUrl();<br />
            $mail = new KBMail();<br />
            $mail-&gt;to = $parent-&gt;option-&gt;email;<br />
            $mail-&gt;title = "답글이 등록 되었습니다.";<br />
            $mail-&gt;content = $comment-&gt;content;<br />
            $mail-&gt;url = $url-&gt;getDocumentRedirect($document-&gt;uid);<br />
            $mail-&gt;send();<br />
        }<br />
    }<br />
}</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[해결했습니다. 정말 감사합니다!!!]]></title>
			<link>https://www.cosmosfarm.com/threads/document/25217</link>
			<description><![CDATA[<p>해결했습니다. 정말 감사합니다!!!</p>]]></description>
			<author>new</author>
			<pubDate>Wed, 01 Aug 2018 06:33:19 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

PHP Notice: Undefined index: product_type in /wp-content/plugins/mangboard/plugins...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/25194</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>PHP Notice: Undefined index: product_type in /wp-content/plugins/mangboard/plugins/widgets/commerce_gallery/commerce_gallery.php on line 156</p>

<p>메시지는 KBoard 플러그인이 아닌 망보드 쪽에서 표시하는 듯합니다.</p>

<p>해당 제작자에게 문의해보시겠어요?</p>

<p> </p>

<p>워드프레스 관리자 페이지에서 테마의 functions.php 파일을 수정할 수 없다면</p>

<p>모든 플러그인을 비활성화하신 후에 다시 수정해보시겠어요?</p>

<p>그래도 같은 문제가 발생한다면 호스팅 업체에 문의를 해보셔야 할 듯합니다.</p>

<p>또는 FTP로 접속해서 /wp-content/themes/사용중인테마/functions.php 파일에 직접 추가해주셔도 됩니다.</p>

<p> </p>

<p>워드프레스의 액션은 여러 개 등록할 수 있지만</p>

<p>PHP 함수는 같은 이름을 중복해서 사용할 수 없습니다.</p>

<p>올려주신 기존의 코드를 아래처럼 변경해보시겠어요?</p>

<pre>
<code class="language-php">add_action('kboard_comments_insert', 'my_kboard_comments_insert', 10, 2);
function my_kboard_comments_insert($insert_id, $content_uid){
	// 생략...
}
add_action('kboard_comments_insert', 'my_kboard_comments_insert1', 10, 2);
function my_kboard_comments_insert1($comment_uid, $content_uid){
	// 생략...
}</code></pre>

<p>my_kboard_comments_insert, my_kboard_comments_insert1 이런 식으로 동일한 함수명 대신 다르게 해주셔야 합니다.</p>

<p> </p>

<p>워드프레스 액션에 대한 설명은 아래의 링크를 참고해보시겠어요?</p>

<p><a href="https://developer.wordpress.org/reference/functions/add_action" target="_blank">https://developer.wordpress.org/reference/functions/add_action</a></p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Tue, 31 Jul 2018 07:03:03 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>