Beispiel #1
0
function kkb_loop_column_title($content, $entry, $entry_id, $cnt)
{
    $entry_type = '';
    $entry_type = get_kingkong_board_meta_value($entry_id, 'type');
    $entry_attachment = get_post_meta($entry_id, 'kingkongboard_attached', true);
    $entry_secret = get_post_meta($entry_id, 'kingkongboard_secret', true);
    isset($_GET['view']) ? $view = sanitize_text_field($_GET['view']) : ($view = null);
    $view == 'read' && $entry_id == $_GET['id'] ? $view_style = 'font-weight:bold' : ($view_style = null);
    $board_sections = get_post_meta(get_board_id_by_entry_id($entry_id), 'board_sections', true);
    if (isset($_GET['pageid'])) {
        $pageid = sanitize_text_field($_GET['pageid']);
    } else {
        $pageid = null;
    }
    if (!$pageid) {
        $pageid = 1;
    }
    $thumbnail_id = get_post_thumbnail_id($entry_id);
    $thumbnail_image = wp_get_attachment_image_src($thumbnail_id, array(22, 22), true);
    //$thumbnail_image = get_the_post_thumbnail( $entry_id, array(22,22) );
    $thumbnail_html = '<image src="' . $thumbnail_image[0] . '" style="width:22px; height:22px">';
    if ($thumbnail_id) {
        $board_id = get_board_id_by_entry_id($entry_id);
        $board_thumbnail_dp = get_post_meta($board_id, 'kingkongboard_thumbnail_dp', true);
        if ($board_thumbnail_dp == "display") {
            $thumbnail = '<div class="entry_thumbnail_image" style="display:inline-block; vertical-align:middle; margin-right:5px">' . apply_filters('kkb_list_thumbnail', $thumbnail_html, $entry_id) . '</div>';
        } else {
            $thumbnail = "";
        }
    } else {
        $thumbnail = "";
    }
    $args = array('post_id' => $entry_id, 'status' => 'approve', 'count' => true);
    $comments = new kkbComment();
    $comments_count = $comments->kkb_get_comment_count($entry_id);
    if ($comments_count > 0) {
        $comments_count = apply_filters('kkb_list_comment_count', " <span class='entry_comment_count'>" . $comments_count . "</span>", $comments_count, $entry_id);
    } else {
        $comments_count = null;
    }
    if ($entry_attachment) {
        $entry_attach_text = apply_filters('kkb_list_icon_attach_outer', '<span class="kkb-list-icon kkblc-attach"></span>', $entry_id);
    } else {
        $entry_attach_text = "";
    }
    if ($entry_secret) {
        $entry_secret_icon = apply_filters('kkb_list_icon_secret_outer', '<span class="kkb-list-icon kkblc-secret"></span>', $entry_id);
    } else {
        $entry_secret_icon = '';
    }
    $controller = new kkbController();
    $parent = $controller->getMeta($entry_id, 'parent');
    $entry_depth = $controller->getMeta($entry_id, 'depth');
    $guid = $controller->getMeta($entry_id, 'guid');
    $board_id = $controller->getMeta($entry_id, 'board_id');
    if ($entry_depth > 1) {
        $padding = 5 * $entry_depth;
        $reply_padding = apply_filters('kkb_list_reply_padding', ' padding-left:' . $padding . 'px;', $entry_id, $padding);
        $reply_icon = apply_filters('kkb_list_icon_reply', '<img src="' . KINGKONGBOARD_PLUGINS_URL . '/assets/images/icon-reply.gif" style="width:25px; height:auto; position:relative; top:0px; margin-right:5px; display:inline-block; line-height:0; vertical-align:middle">', $entry_id);
        $parent_id = '&prnt=' . $parent;
    } else {
        $reply_padding = '';
        $reply_icon = '';
        $parent_id = '';
    }
    $writer = $controller->getMeta($entry_id, 'writer');
    $writer = kingkongboard_text_cut($writer, 6, "...");
    $hit = get_post_meta($entry_id, 'kingkongboard_hits', true);
    $mobile_writer_info = "<div class='mobile-writer-info'>";
    $mobile_writer_info .= "<ul>";
    $mobile_writer_info .= "<li>" . __('작성자', 'kingkongboard') . " : " . $writer . "</li>";
    $mobile_writer_info .= "<li>" . __('작성일', 'kingkongboard') . " : " . get_the_date('Y.m.d', $entry_id) . "</li>";
    $mobile_writer_info .= "<li>" . __('조회수', 'kingkongboard') . " : " . $hit . "</li>";
    $mobile_writer_info .= "</ul>";
    $mobile_writer_info .= "</div>";
    $mobile_writer_info = apply_filters('kkb_list_mobile_writer_info', $mobile_writer_info, $entry_id);
    $extra_priority = apply_filters('kkb_loop_extra_priority', $entry_secret_icon . $entry_attach_text . $comments_count, $entry_secret_icon, $entry_attach_text, $comments_count, $entry_id);
    $read_array = array('pageid' => $pageid, 'view' => 'read', 'id' => $entry_id . $parent_id);
    $read_array = apply_filters('kkb_read_arg_after', $read_array, $board_id);
    $read_path = add_query_arg($read_array, get_the_permalink($guid));
    $title = get_the_title($entry_id);
    $title = str_replace('비공개: ', '', $title);
    $title = str_replace('Private: ', '', $title);
    $link = "<a href='" . $read_path . "'>" . apply_filters('kkb_loop_title_value', $reply_icon . $thumbnail . $title . $extra_priority, $entry_id) . "</a>" . $mobile_writer_info;
    $content = "<td style='position:relative;" . $reply_padding . " " . $view_style . "' class='kingkongboard-list-" . $entry['value'] . "'>" . $link . "</td>";
    return $content;
}
 public function prev_version_comment_migration()
 {
     global $wpdb;
     $args = array('status' => 'approve', 'number' => '');
     $comments = get_comments($args);
     $comment_meta_table = $wpdb->prefix . "kingkongboard_comment_meta";
     foreach ($comments as $comment) {
         $result = $wpdb->get_row("SELECT * FROM " . $comment_meta_table . " WHERE eid = " . $comment->comment_post_ID . " AND cid = " . $comment->comment_ID);
         if (!$result) {
             $kkb_comment = new kkbComment();
             if ($comment->comment_parent) {
                 $origin = $comment->comment_parent;
                 $parent = $comment->comment_parent;
                 $depth = 1;
             } else {
                 $origin = $comment->comment_ID;
                 $parent = 0;
                 $depth = 1;
             }
             $input_meta = array('lnumber' => 1, 'eid' => $comment->comment_post_ID, 'cid' => $comment->comment_ID, 'origin' => $origin, 'parent' => $parent, 'depth' => $depth);
             if (!$comment->comment_parent) {
                 $kkb_comment->kkb_update_comment_meta($input_meta);
             }
         }
     }
 }
<?php

if (is_user_logged_in()) {
    $user_status = 1;
} else {
    $user_status = 0;
}
$args = array('post_id' => $entry_id, 'status' => 'approve', 'count' => true);
$comments = new kkbComment();
$comment_count = $comments->kkb_get_comment_count($entry_id);
$comments_array = $comments->kkb_get_comment_list($entry_id);
$comment_list = $comments->kkb_comment_display($entry_id, $comments_array);
$comment_options = get_post_meta($board_id, 'kingkongboard_comment_options', true);
if ($comment_options) {
    $comment_options = maybe_unserialize($comment_options);
}
$comment_sorting = apply_filters('kingkongboard_comment_sorting', $entry_id);
if ($comment_sorting != $entry_id) {
    $sorting_content = $comment_sorting;
} else {
    $sorting_content = null;
}
$comment_class = apply_filters('kkb_comment_wrapper_class', 'kingkongboard-comment-wrapper', $board_id, $entry_id);
$user = wp_get_current_user();
$user_avatar = get_avatar($user->ID, 50);
preg_match("/src='(.*?)'/i", $user_avatar, $matches);
if (isset($matches[1])) {
    $user_avatar = $matches[1];
}
if ($user->user_login == null) {
    $user_alt = __("비회원 프로필 이미지", "kingkongboard");
<?php

list($path) = explode(DIRECTORY_SEPARATOR . 'wp-content', dirname(__FILE__) . DIRECTORY_SEPARATOR);
include $path . DIRECTORY_SEPARATOR . 'wp-load.php';
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
if (!stristr($referer, $host)) {
    wp_die('KINGKONG BOARD : ' . __('지금 페이지는 외부 접근이 차단되어 있습니다.', 'kingkongboard'));
}
if (!isset($_POST)) {
    wp_die('KINGKONG BOARD : ' . __('잘못된 접근 입니다.', 'kingkongboard'));
}
include_once ABSPATH . 'wp-includes/pluggable.php';
$kkb_comment = new kkbComment();
$kkb_comment->kkb_comment_save($_POST);
$controller = new kkbController();
$post_id = $controller->getMeta($_POST['entry_id'], 'guid');
$board_id = $controller->getMeta($_POST['entry_id'], 'board_id');
$iframe_use = get_post_meta($board_id, 'kkb_iframe_use', true);
$return_args = array('view' => 'read', 'id' => $_POST['entry_id']);
if ($iframe_use == 'T') {
    $return_args['kkb_mod'] = 'iframe';
}
$return_path = add_query_arg($return_args, get_the_permalink($post_id));
header("Location: " . $return_path);
<?php

list($path) = explode(DIRECTORY_SEPARATOR . 'wp-content', dirname(__FILE__) . DIRECTORY_SEPARATOR);
include $path . DIRECTORY_SEPARATOR . 'wp-load.php';
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
if (!stristr($referer, $host)) {
    wp_die('KINGKONG BOARD : ' . __('지금 페이지는 외부 접근이 차단되어 있습니다.', 'kingkongboard'));
}
if (!isset($_POST)) {
    wp_die('KINGKONG BOARD : ' . __('잘못된 접근 입니다.', 'kingkongboard'));
}
include_once ABSPATH . 'wp-includes/pluggable.php';
$kkb_comment = new kkbComment();
$kkb_comment->kkb_comment_modify($_POST);
$controller = new kkbController();
$post_id = $controller->getMeta($_POST['entry_id'], 'guid');
$board_id = $controller->getMeta($_POST['entry_id'], 'board_id');
$iframe_use = get_post_meta($board_id, 'kkb_iframe_use', true);
$return_args = array('view' => 'read', 'id' => $_POST['entry_id']);
if ($iframe_use == 'T') {
    $return_args['kkb_mod'] = 'iframe';
}
$return_path = add_query_arg($return_args, get_the_permalink($post_id));
header("Location: " . $return_path);