base = $base; $this->admin = $base->admin; global $action; wp_reset_vars(array('action')); switch($action) { case 'post': $this->post_reply(); break; default: if (isset($_GET['replytocom'])) { $this->show_form(); } break; } } // ================================================== private function show_form($errors = array()) { global $user_ID, $title, $comment, $id; $comment = intval($_GET['replytocom']); if (! $comment = get_comment($comment)) { $this->base->ks_die(__('Oops, no comment with this ID.')); } $title = __('Comment Reply', 'ktai_style'); include dirname(__FILE__) . '/admin-header.php'; $id = $comment->comment_post_ID; echo '
', array_map('wp_specialchars', $errors)); ?>
base->ks_die(__('You are not allowed to edit comments on this post.')); } global $wpdb; $status = $wpdb->get_var( $wpdb->prepare("SELECT post_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); if ( empty($status) ) { $this->base->ks_die(__('No target for your post.', 'ktai_style')); exit; } elseif ( in_array($status, array('draft', 'pending')) ) { $this->base->ks_die( __('Error: you are replying to a comment on a draft post.', 'ktai_style') ); exit; } $user = wp_get_current_user(); if ( $user->ID ) { $comment_author = $wpdb->escape($user->display_name); $comment_author_email = $wpdb->escape($user->user_email); $comment_author_url = $wpdb->escape($user->user_url); $comment_content = trim($_POST['content']); if ( current_user_can('unfiltered_html') ) { if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { kses_remove_filters(); // start with a clean slate kses_init_filters(); // set up the filters } } } else { $this->base->ks_die( __('Sorry, you must be logged in to reply to a comment.') ); } $charset = $this->base->detect_encoding(isset($_POST['charset_detect']) ? $_POST['charset_detect'] : ''); if ($this->base->similar_encoding($charset, $this->base->get('charset'))) { $comment_content = $this->base->ktai->pickup_pics(stripslashes($comment_content)); if (! $this->base->get_option('ks_allow_pictograms')) { $comment_content = preg_replace('!