kboard list와 editor를 한 화면에 넣고 싶습니다.

1. 정확한 제품 또는 플러그인 이름

kboard

 

2. 상세 내용

고생이 많으십니다 ^^

항상 좋은 답변 감사합니다 ~!

kboard의 editor화면과 리스트 화면이 한 화면에 나오도록 하고싶습니다.

editor화면이 상위에 있고 리스트화면이아래로 배치되었으면 좋겠어서

kboard 리스트 안에 editor에 있는 php를 복사해서 넣어보았는데

화면에는 정상적으로 나오지만

글을 쓰고 저장할때 "권한이 없습니다."

라고 뜨고 있습니다.

editor와 list를 한화면에 나오게 하는 방법이 있을까요?

 

3. 확인 가능한 상세 페이지 주소

 

 

4. 수정한 코드 내역 (있다면)

<div id="kboard-contactboard-editor">
    <form class="kboard-form" method="post" action="<?php echo esc_url($url->getContentEditorExecute())?>" enctype="multipart/form-data" onsubmit="return kboard_editor_execute(this);">
        <?php $skin->editorHeader($content, $board)?>        <?php foreach($board->fields()->getSkinFields() as $key=>$field):?>
            <?php echo $board->fields()->getTemplate($field, $content, $boardBuilder)?>
        <?php endforeach?>        <div class="kboard-control">
            <div class="left">
                <?php if($content->uid):?>
                <a href="<?php echo esc_url($url->getDocumentURLWithUID($content->uid))?>" class="kboard-contactboard-button-small"><?php echo __('Back', 'kboard')?></a>
                <a href="<?php echo esc_url($url->getBoardList())?>" class="kboard-contactboard-button-small"><?php echo __('List', 'kboard')?></a>
                <?php else:?>
                <a href="<?php echo esc_url($url->getBoardList())?>" class="kboard-contactboard-button-small"><?php echo __('Back', 'kboard')?></a>
                <?php endif?>
            </div>
            <div class="right">
                <?php if($board->isWriter()):?>
                <button type="submit" class="kboard-contactboard-button-small"><?php echo __('Save', 'kboard')?></button>
                <?php endif?>
            </div>
        </div>
    </form>
</div><?php wp_enqueue_script('kboard-contactboard-script', "{$skin_path}/script.js", array(), KBOARD_VERSION, true)?><div id="kboard-contactboard-list">    <!-- 게시판 정보 시작 -->
    <div class="kboard-list-header">
        <?php if(!$board->isPrivate()):?>
            <div class="kboard-total-count">
                <?php echo __('Total', 'kboard')?> <?php echo number_format($board->getListTotal())?>
            </div>
        <?php endif?>        <div class="kboard-sort">
            <form id="kboard-sort-form-<?php echo $board->id?>" method="get" action="<?php echo esc_url($url->toString())?>">
                <?php echo $url->set('pageid', '1')->set('category1', '')->set('category2', '')->set('target', '')->set('keyword', '')->set('mod', 'list')->set('kboard_list_sort_remember', $board->id)->toInput()?>                <select name="kboard_list_sort" onchange="jQuery('#kboard-sort-form-<?php echo $board->id?>').submit();">
                    <option value="newest"<?php if($list->getSorting() == 'newest'):?> selected<?php endif?>><?php echo __('Newest', 'kboard')?></option>
                    <option value="best"<?php if($list->getSorting() == 'best'):?> selected<?php endif?>><?php echo __('Best', 'kboard')?></option>
                    <option value="viewed"<?php if($list->getSorting() == 'viewed'):?> selected<?php endif?>><?php echo __('Viewed', 'kboard')?></option>
                    <option value="updated"<?php if($list->getSorting() == 'updated'):?> selected<?php endif?>><?php echo __('Updated', 'kboard')?></option>
                </select>
            </form>
        </div>
    </div>
    <!-- 게시판 정보 끝 -->    <!-- 카테고리 시작 -->
    <?php
    if($board->use_category == 'yes'){
        if($board->isTreeCategoryActive()){
            $category_type = 'tree-select';
        }
        else{
            $category_type = 'contactboard';
        }
        $category_type = apply_filters('kboard_skin_category_type', $category_type, $board, $boardBuilder);
        echo $skin->load($board->skin, "list-category-{$category_type}.php", $vars);
    }
    ?>
    <!-- 카테고리 끝 -->    <!-- 리스트 시작 -->
    <div class="kboard-list">
        <table>
            <thead>
                <tr>
                    <td class="kboard-list-uid"><?php echo __('Number', 'kboard')?></td>
                    <td class="kboard-list-title"><?php echo __('Title', 'kboard')?></td>
                    <td class="kboard-list-user"><?php echo __('Author', 'kboard')?></td>
                    <td class="kboard-list-date"><?php echo __('Date', 'kboard')?></td>
                    <td class="kboard-list-vote"><?php echo __('Votes', 'kboard')?></td>
                    <td class="kboard-list-view"><?php echo __('Views', 'kboard')?></td>
                </tr>
            </thead>
            <tbody>
                <?php while($content = $list->hasNextNotice()):?>
                <tr class="kboard-list-notice<?php if($content->uid == kboard_uid()):?> kboard-list-selected<?php endif?>">
                    <td class="kboard-list-uid"><?php echo __('Notice', 'kboard')?></td>
                    <td class="kboard-list-title">
                        <a href="<?php echo esc_url($url->getDocumentURLWithUID($content->uid))?>">
                            <div class="kboard-contactboard-cut-strings">
                                <?php if($content->isNew()):?><span class="kboard-contactboard-new-notify">New</span><?php endif?>
                                <?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
                                <?php echo $content->title?>
                                <span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
                            </div>
                        </a>
                        <div class="kboard-mobile-contents">
                            <span class="contents-item kboard-user"><?php echo $content->getUserDisplay()?></span>
                            <span class="contents-separator kboard-date">|</span>
                            <span class="contents-item kboard-date"><?php echo $content->getDate()?></span>
                            <span class="contents-separator kboard-vote">|</span>
                            <span class="contents-item kboard-vote"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
                            <span class="contents-separator kboard-view">|</span>
                            <span class="contents-item kboard-view"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
                        </div>
                    </td>
                    <td class="kboard-list-user"><?php echo $content->getUserDisplay()?></td>
                    <td class="kboard-list-date"><?php echo $content->getDate()?></td>
                    <td class="kboard-list-vote"><?php echo $content->vote?></td>
                    <td class="kboard-list-view"><?php echo $content->view?></td>
                </tr>
                <?php endwhile?>
                <?php while($content = $list->hasNext()):?>
                <tr class="<?php if($content->uid == kboard_uid()):?>kboard-list-selected<?php endif?>">
                    <td class="kboard-list-uid"><?php echo $list->index()?></td>
                    <td class="kboard-list-title">
                        <a href="<?php echo esc_url($url->getDocumentURLWithUID($content->uid))?>">
                            <div class="kboard-contactboard-cut-strings">
                                <?php if($content->isNew()):?><span class="kboard-contactboard-new-notify">New</span><?php endif?>
                                <?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
                                <?php echo $content->title?>
                                <span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
                            </div>
                        </a>
                        <div class="kboard-mobile-contents">
                            <span class="contents-item kboard-user"><?php echo $content->getUserDisplay()?></span>
                            <span class="contents-separator kboard-date">|</span>
                            <span class="contents-item kboard-date"><?php echo $content->getDate()?></span>
                            <span class="contents-separator kboard-vote">|</span>
                            <span class="contents-item kboard-vote"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
                            <span class="contents-separator kboard-view">|</span>
                            <span class="contents-item kboard-view"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
                        </div>
                    </td>
                    <td class="kboard-list-user"><?php echo $content->getUserDisplay()?></td>
                    <td class="kboard-list-date"><?php echo $content->getDate()?></td>
                    <td class="kboard-list-vote"><?php echo $content->vote?></td>
                    <td class="kboard-list-view"><?php echo $content->view?></td>
                </tr>
                <?php $boardBuilder->builderReply($content->uid)?>
                <?php endwhile?>
            </tbody>
        </table>
    </div>
    <!-- 리스트 끝 -->    <!-- 페이징 시작 -->
    <div class="kboard-pagination">
        <ul class="kboard-pagination-pages">
            <?php echo kboard_pagination($list->page, $list->total, $list->rpp)?>
        </ul>
    </div>
    <!-- 페이징 끝 -->    <!-- 검색폼 시작 -->
    <div class="kboard-search">
        <form id="kboard-search-form-<?php echo $board->id?>" method="get" action="<?php echo esc_url($url->toString())?>">
            <?php echo $url->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>            <select name="target">
                <option value=""><?php echo __('All', 'kboard')?></option>
                <option value="title"<?php if(kboard_target() == 'title'):?> selected<?php endif?>><?php echo __('Title', 'kboard')?></option>
                <option value="content"<?php if(kboard_target() == 'content'):?> selected<?php endif?>><?php echo __('Content', 'kboard')?></option>
                <option value="member_display"<?php if(kboard_target() == 'member_display'):?> selected<?php endif?>><?php echo __('Author', 'kboard')?></option>
            </select>
            <input type="text" name="keyword" value="<?php echo esc_attr(kboard_keyword())?>">
            <button type="submit" class="kboard-contactboard-button-small"><?php echo __('Search', 'kboard')?></button>
        </form>
    </div>
    <!-- 검색폼 끝 -->    <?php if($board->isWriter()):?>
    <!-- 버튼 시작 -->
    <div class="kboard-control">
        <a href="<?php echo esc_url($url->getContentEditor())?>" class="kboard-contactboard-button-small"><?php echo __('New', 'kboard')?></a>
    </div>
    <!-- 버튼 끝 -->
    <?php endif?>    <?php if($board->contribution()):?>
    <div class="kboard-contactboard-poweredby">
        <a href="https://www.cosmosfarm.com/products/kboard" onclick="window.open(this.href);return false;" title="<?php echo __('KBoard is the best community software available for WordPress', 'kboard')?>">Powered by KBoard</a>
    </div>
    <?php endif?>
</div>

 

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
  • 안녕하세요~^^

    코드를 작성해주시는 경우에는

    반드시 코드스니펫으로 코드를 삽입해주세요.

     

    KBoard는 list와 editor가 분리되어 있는 것이 기본 구조입니다.

    단순히 editor에 있는 코드를 복사한다고 하여 list 페이지에서

    동작하지 않습니다.

     

    새로운 아래 코드와 같이 form 태그로 직접 form을 만드신 다음

    <form class="kboard-form-main" method="post" action="<?php echo get_permalink()?>" enctype="multipart/form-data" target="_top">
        <!-- 필요한 필드 입력 -->
    </form>

     

    KBContent 클래스의 insertContent 함수를 사용하여

    받아온 post 데이터를 게시글로 등록할 수 있습니다.

    insertContent의 사용 방법은 아래 코드를 확인해보시겠어요?

    <?php
    $data = array();
    $data['board_id'] = '1';
    $data['parent_uid'] = '';
    $data['member_uid'] = '1';
    $data['member_display'] = '글쓴이';
    $data['title'] = '제목';
    $data['content'] = '내용';
    $data['date'] = date('YmdHis', current_time('timestamp'));
    $data['update'] = date('YmdHis', current_time('timestamp'));
    $data['view'] = 0;
    $data['comment'] = 0;
    $data['like'] = 0;
    $data['unlike'] = 0;
    $data['vote'] = 0;
    $data['category1'] = '';
    $data['category2'] = '';
    $data['secret'] = '';
    $data['notice'] = '';
    $data['search'] = '1';
    $data['thumbnail_file'] = '';
    $data['thumbnail_name'] = '';
    $data['status'] = '';
    $data['password'] = '';
    
    
    $content = new KBContent();
    $content->insertContent($data);
    ?>

     

    코드를 직접 작성하기 어려우시다면

    프로젝트 의뢰에 자세한 내용을 작성해보세요.

    https://www.cosmosfarm.com/project

    고맙습니다.

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기