コード例 #1
0
ファイル: latest.php プロジェクト: ksw2342/kau_webstudio_12
function kingkong_board_latest($attr)
{
    do_action('kingkongboard_latest_display_before', $attr);
    $title = $attr['title'];
    $skin = $attr['skin'];
    $number = $attr['number'];
    $length = $attr['length'];
    $board_id = $attr['board_id'];
    $kingkongboard = new kkbLatest($board_id);
    $latests = $kingkongboard->kkb_get_latest_list($number);
    $summary = apply_filters('kkb_latest_summary', sprintf(__('%s 게시판의 제목과 날짜를 제공하는 최신글 표', 'kingkongboard'), get_the_title($board_id)), $board_id);
    $latest_priority = apply_filters('kingkongboard_latest_priority', array('title', 'date'), $attr);
    ob_start();
    include_once kkb_template_path("view.latest.php");
    $latest_content = ob_get_contents();
    ob_get_clean();
    return apply_filters('kingkongboard_latest_after', $latest_content, $latests, $attr);
}
コード例 #2
0
 public function view($view)
 {
     global $post;
     switch ($view) {
         case 'list':
             ob_start();
             require_once KINGKONGBOARD_ABSPATH . "includes/view.list.php";
             $content = ob_get_contents();
             ob_end_clean();
             break;
         case 'read':
             $entry_type = parent::getMeta($this->entry_id, 'type');
             if ($this->entry_id && parent::actionPermission($this->board_id, $this->entry_id, 'read') == true && $entry_type <= 1) {
                 switch (parent::checkSecret($this->board_id, $this->entry_id)) {
                     case 0:
                         // 열람가능
                         ob_start();
                         require_once kkb_template_path("view.read.php");
                         $content = ob_get_contents();
                         ob_end_clean();
                         break;
                     case 1:
                         ob_start();
                         require_once kkb_template_path("view.read.check.php");
                         $content = ob_get_contents();
                         ob_end_clean();
                         break;
                     case 2:
                         // 회원, 본인글이 아니므로 열람 불가하다.
                         return apply_filters('kkb_read_secret_denied', __('비밀글 입니다. 작성자 본인과 관리자만 열람할 수 있습니다.', 'kingkongboard'), $this->board_id);
                         break;
                 }
             } else {
                 $content = apply_filters('kkb_loop_read_denied_message', __('권한이 없거나 게시글이 존재하지 않습니다.', 'kingkongboard'), $this->board_id);
             }
             break;
         case 'write':
             if (parent::actionPermission($this->board_id, null, 'write') == true) {
                 ob_start();
                 require_once kkb_template_path("view.write.php");
                 $content = ob_get_contents();
                 ob_end_clean();
             } else {
                 $content = apply_filters('kkb_loop_write_denied_message', __('글 쓰기 권한이 없습니다.', 'kingkongboard'), $this->board_id);
             }
             break;
         case 'modify':
             if (parent::actionPermission($this->board_id, $this->entry_id, 'modify') == true) {
                 ob_start();
                 require_once kkb_template_path("view.modify.php");
                 $content = ob_get_contents();
                 ob_end_clean();
             } else {
                 $content = apply_filters('kkb_loop_modify_denied_message', __('글수정 권한이 없습니다.', 'kingkongboard'), $this->board_id);
             }
             break;
         case 'reply':
             $parent_type = parent::getMeta($this->entry_id, 'type');
             if (parent::actionPermission($this->board_id, $this->entry_id, 'reply') == true && $parent_type != 1) {
                 ob_start();
                 require_once kkb_template_path("view.reply.php");
                 $content = ob_get_contents();
                 ob_end_clean();
             } else {
                 $content = apply_filters('kkb_loop_reply_denied_message', __('답글쓰기가 허용되지 않습니다.', 'kingkongboard'), $this->board_id);
             }
             break;
         case 'delete':
             if (parent::actionPermission($this->board_id, $this->entry_id, 'delete') == true) {
                 ob_start();
                 require_once kkb_template_path("view.delete.php");
                 $content = ob_get_contents();
                 ob_end_clean();
             } else {
                 $content = apply_filters('kkb_loop_delete_denied_message', __('글 삭제 권한이 없습니다.', 'kingkongboard'), $this->board_id);
             }
             break;
         case 'cmtcheck':
             if (isset($_GET['mod']) && isset($_GET['cid'])) {
                 $cid = sanitize_text_field($_GET['cid']);
                 $mod = sanitize_text_field($_GET['mod']);
                 $exists = get_comment($cid);
                 if (isset($exists->comment_ID)) {
                     if (parent::actionCommentPermission($this->board_id, $cid, $mod) == true) {
                         ob_start();
                         require_once KINGKONGBOARD_ABSPATH . "includes/view.read.comment.check.php";
                         $content = ob_get_contents();
                         ob_end_clean();
                     } else {
                         $content = apply_filters('kkb_comment_permission_denied_message', __('권한이 없습니다.', 'kingkongboard'), $this->board_id);
                     }
                 } else {
                     $content = apply_filters('kkb_comment_noexists_message', __('존재하지 않는 댓글 입니다.', 'kingkongboard'), $this->board_id);
                 }
             } else {
                 $content = apply_filters('kkb_comment_action_denied_message', __('잘못된 접근 입니다.', 'kingkongboard'), $this->board_id);
             }
             break;
     }
     return $content;
 }
コード例 #3
0
require_once kkb_template_path('view.list.search.php');
$searchContent = ob_get_contents();
$searchContent = apply_filters('kkb_list_search_content', $searchContent, $board_id);
ob_end_clean();
ob_start();
require_once kkb_template_path('view.list.section.php');
$sectionContent = ob_get_contents();
$sectionContent = apply_filters('kkb_list_top_sections', $sectionContent, $board_id);
ob_end_clean();
ob_start();
require_once kkb_template_path('view.list.loop.php');
$loopContent = ob_get_contents();
$loopContent = apply_filters('kkb_list_loop', $loopContent, $board_id);
ob_end_clean();
ob_start();
require_once kkb_template_path('view.list.pagenation.php');
$pageContent = ob_get_contents();
$pageContent = apply_filters('kkb_list_pagenation', $pageContent, $board_id);
ob_end_clean();
$loopContent = apply_filters('kkb_loop_after', $loopContent, $board_id, $nResults, $bResults);
$controllerClass = apply_filters('kkb_loop_controller_extra_class', null, $board_id);
$controllerContent = '<div class="kingkongboard-controller ' . $controllerClass . '">';
$controller = new kkbController();
if ($controller->actionPermission($board_id, null, 'write') == true) {
    $write_args = apply_filters('kkb_read_arg_after', array('view' => 'write'), $board_id);
    $write_path = add_query_arg($write_args, get_the_permalink($post->ID));
    $controllerContent .= $searchContent;
    $controllerContent .= '<a href="' . $write_path . '" class="' . kkb_button_classer($board_id) . ' write-button"><span class="kkb-list-icon kkblc-write" style="margin-right:5px"></span><span style="vertical-align:middle">' . kkb_button_text($board_id, 'write') . '</span></a>';
}
$controllerContent .= '</div>';
$copyContent = '<div class="kingkongboard-copyrights"><a href="http://superrocket.io" target="_blank">Powered by Kingkong Board</a></div>';