<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[KBcontent 클래스 첨부파일 문의]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/37072</link>
		<description><![CDATA[<p>안녕하세요. </p>

<p>먼저 케이보드 및 회원관리 플러그인 잘 사용중이며 감사 말씀 전해드립니다. </p>

<p> </p>

<p>특정 상황에서 케이보드 게시판에 자동 글쓰기 기능을 만들어보고 있는데 첨부파일 전달이 잘 안되어 질문 남겨드립니다. </p>

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

<p>// add the action <br />
add_action( 'wpcf7_before_send_mail', 'action_wpcf7_before_send_mail', 10, 3 ); </p>

<p>// define the wpcf7_before_send_mail callback <br />
function action_wpcf7_before_send_mail( $contact_form ) { <br />
    // make action magic happen here... <br />
    $data=array();<br />
    //$add_option=array();<br />
    $title = $contact_form-&gt;title;<br />
    $submission = WPCF7_Submission::get_instance();</p>

<p>    if ( $submission ) {<br />
        $posted_data = $submission-&gt;get_posted_data();<br />
        $attach_file_url = implode($submission-&gt;uploaded_files());<br />
        for($str_len_temp = strlen($attach_file_url);$str_len_temp&gt;=0;$str_len_temp--) if($attach_file_url[$str_len_temp]=='/') break;<br />
        $attach_file = substr($attach_file_url,$str_len_temp+1);<br />
        $attach_file_url = str_replace($attach_file,'',$attach_file_url);<br />
        //$attach_file_url = str_replace('/', DIRECTORY_SEPARATOR, attach_file_url);<br />
    }<br />
    <br />
    if($title == '양식001'){<br />
        $data['board_id'] = '1';<br />
        $data['parent_uid'] = '';<br />
        $data['member_uid'] = $posted_data['your_login'];<br />
        $data['member_display'] = $posted_data['your_name'];<br />
        $data['title'] = $posted_data['your_title'];<br />
        $data['content'] = "| 내용 | \n\n";<br />
        $data['date'] = date('YmdHis', current_time('timestamp'));<br />
        $data['update'] = date('YmdHis', current_time('timestamp'));<br />
        $data['view'] = 0;<br />
        $data['comment'] = 0;<br />
        $data['like'] = 0;<br />
        $data['unlike'] = 0;<br />
        $data['vote'] = 0;<br />
        $data['category1'] = '';<br />
        $data['category2'] = '읽지않음';<br />
        $data['secret'] = '';<br />
        $data['notice'] = '';<br />
        $data['search'] = '1';<br />
        $data['file_path'] = $attach_file_url;<br />
        $data['file_name'] = $attach_file;<br />
        //$data['thumbnail_file'] = $attach_file_url;<br />
        //$data['thumbnail_name'] = $attach_file;<br />
        $data['status'] = '';<br />
            <br />
        $content = new KBContent();<br />
        //$content-&gt;setBoardID(1);</p>

<p>        $content-&gt;insertContent($data);<br />
    }<br />
}; </p>

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

<p>전달 받은 컨택트폼 클래스에서 데이터 경로와 파일명을 얻는데까지는 성공했는데 </p>

<p>KBcontent 클래스인 $content에 전달이 잘 안되네요..</p>

<p>클래스 열어서 보긴했는데 PHP는 첨이라 잘 이해가 안되기도 해서 팁이 될만한게 있을까하여 문의글 남겨봅니다.</p>

<p>:)</p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요~^^

KBoard 게시글을 작성할 때 첨부파일은

KBContent 클래스의 initUploadAttachFiles() ...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/37086</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>KBoard 게시글을 작성할 때 첨부파일은</p>

<p>KBContent 클래스의 initUploadAttachFiles() 함수와 updateAttach() 함수로 처리하고 있습니다.</p>

<p>해당 함수들을 살펴봐보시겠어요?</p>

<p>타 플러그인에서 첨부파일 등록 시 첨부파일을 가져올 수 있는지 확인을 해보셔야 할 듯합니다.</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Fri, 20 Sep 2019 00:57:07 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>