function kingkong_board_comment($attr) { $entry_id = $attr['id']; $board_id = get_board_id_by_entry_id($entry_id); $board_skin = get_post_meta($board_id, 'board_skin', true); $skin_path = get_kingkongboard_skin_path('board', $board_skin); ob_start(); require_once KINGKONGBOARD_ABSPATH . 'includes/view.read.comment.php'; $cmContent = ob_get_contents(); ob_end_clean(); return apply_filters('kkb_comment_list_after', $cmContent, $attr); }
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 kkb_comment_display($entry_id, $comments) { $board_id = get_board_id_by_entry_id($entry_id); $comment_options = get_post_meta($board_id, 'kingkongboard_comment_options', true); $comment_options = maybe_unserialize($comment_options); $comment_result = null; $depth_padding = null; ob_start(); require_once KINGKONGBOARD_ABSPATH . '/includes/view.read.comment.loop.php'; $comment_result = ob_get_contents(); ob_end_clean(); /* apply_filters('kingkongboard_comment_list_before', $board_id, $comment); if($comment->comment_approved == 1){ $comment_result .= '<div id="comment-'.$comment->comment_ID.'" class="each-comment comment-'.$comment->comment_ID.'" style="'.$depth_padding.'">'; $comment_result .= $depth_div; $comment_result .= '<div>'; $comment_result .= '<div class="each-comment-author">'; $comment_result .= '<table class="comment-author-table">'; $comment_result .= '<tr>'; if($comment_options['thumbnail'] == "T"){ $comment_result .= '<td>'; $comment_result .= get_avatar($comment->comment_author_email, '20'); $comment_result .= '</td>'; } $comment_result .= '<td style="font-weight:'.$comment_options['writer']['font_weight'].'; font-size:'.$comment_options['writer']['font_size'].'; color:'.$comment_options['writer']['color'].'">'; $comment_result .= $comment->comment_author; $comment_result .= '</td>'; $comment_result .= '<td class="comment-author-date" style="color:'.$comment_options['date']['color'].'">'; $comment_result .= get_comment_date( $comment_options['date']['format'], $comment->comment_ID); $comment_result .= '</td>'; $comment_result .= '<td style="position:relative">'; $comment_result .= '<a class="comment-reply-button" data-origin="'.$cmmt->origin.'" data="'.$comment->comment_ID.'">'.__('답글', 'kingkongboard').'</a> '; if(is_user_logged_in()){ global $current_user; $user_id = $current_user->ID; if($comment->user_id == $user_id || current_user_can('manage_options')){ $comment_result .= '<a class="comment-delete-button" data-entry="'.$entry_id.'" data="'.$comment->comment_ID.'" message="'.__('삭제하시겠습니까?', 'kingkongboard').'">'.__('삭제', 'kingkongboard').'</a>'; } } $comment_result .= '</td>'; $comment_result .= '</tr>'; $comment_result .= '</table>'; $comment_result .= '</div>'; $comment_content_before = apply_filters('kingkongboard_comment_content_before', $entry_id, $comment->comment_ID); if($comment_content_before != $entry_id){ $comment_result .= $comment_content_before; } $comment_result .= '<div class="each-comment-content" style="color:'.$comment_options['content']['color'].'">'; $comment_result .= nl2br($comment->comment_content)."<br>"; $comment_result .= '</div>'; $comment_result .= '</div>'; $comment_after = apply_filters('kingkongboard_comment_after', $board_id, $entry_id, $comment->comment_ID ); if($comment_after != $board_id){ $comment_result .= $comment_after; } $comment_result .= '</div>'; } */ return apply_filters('kkb_comment_display_after', $comment_result, $entry_id, $comments); }