예제 #1
0
function kingkongboard_comment_list()
{
    $entry_id = sanitize_text_field($_POST['entry_id']);
    $board_id = get_board_id_by_entry_id($entry_id);
    $board_comment = get_post_meta($board_id, 'board_comment', true);
    do_action('kingkongboard_comment_list_before', $board_id, $entry_id);
    if ($board_comment == "T") {
        $kkb_comment = new kkbComment();
        $comments = $kkb_comment->kkb_get_comment_list($entry_id);
        $comments_display = $kkb_comment->kkb_comment_display($entry_id, $comments);
    } else {
        $comments_display = false;
    }
    echo $comments_display;
    do_action('kingkongboard_comment_list_after', $board_id, $entry_id);
    exit;
}
<?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");