test_interface('header'); // set in wphone.php plugin if( !isset($this->context) || ( ($this->context != 'edit') && ($this->context != 'list') ) ) { $this->context = 'list'; } $fancy_text = ucfirst($this->context); if ( 'edit' == $this->context ) { // @note EDIT FORM (lists in else) $comment_ID = (int) $_GET['c']; if ( !$comment = get_comment($comment_ID) ) wp_die( __('Oops, no comment with this ID.') ); // Good enough $this->check_user_permissions('edit_post', $comment->comment_post_ID); if ( file_exists( ABSPATH . 'wp-admin/includes/admin.php' ) ) require_once( ABSPATH . 'wp-admin/includes/admin.php' ); else require_once( ABSPATH . 'wp-admin/admin-functions.php' ); $comment = get_comment_to_edit($comment_ID); $heading - sprintf(__('Editing Comment # %s'), $comment->comment_ID); // @note: "referredby" is a cheat of sorts so we head to the comments list rather than edit.php or whatever ?>

comment_ID); ?>

comment_author_email ) : ?>
comment_author_url && ('http://' != $comment->comment_author_url) ) : ?>


panel_button('submit', 'submit', __('Edit Comment »')); $question = __("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete."); $url = wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID); $this->panel_delete_button(sprintf( __('Delete this comment'), $fancy_type), $question, $url ); ?>
\n"; } else { $this->check_user_permissions('moderate_comments'); // @note COMMENT LISTINGS $all_com_head = __('Edit Comments'); $mod_com_head = __('Awaiting Moderation', 'wphone'); $spam_com_head = __('Spam Comments', 'wphone'); $approved_sql = "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date DESC"; $moderation_sql = "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'"; $spam_sql = "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam'"; $target_script = 'edit-comments.php'; if ( isset($_GET['type']) ) { $offset = (int) $_GET['offset']; $limit = 5; // Note: Getting $limit + 1 to know if we do need a next button. $query_limit = ($limit + 1); $previous_caption = __('« Previous Comments', 'wphone'); $next_caption = __('Next Comments »', 'wphone'); $more_caption = __('More Comments', 'wphone'); switch ($_GET['type']) { case 'moderation': $type = $_GET['type']; $header = $mod_com_head; $comments = $wpdb->get_results( $moderation_sql . " LIMIT $query_limit OFFSET $offset" ); break; case 'spam': $type = $_GET['type']; $header = $spam_com_head; $comments = $wpdb->get_results( $spam_sql . " LIMIT $query_limit OFFSET $offset" ); break; default: $type = 'approved'; $header = $all_com_head; $comments = $wpdb->get_results( $approved_sql . " LIMIT $query_limit OFFSET $offset" ); } $comments_count = count($comments); if ( !$this->iscompat ) echo '

' . $header . "

\n"; if ( ( !$this->iscompat ) || ( $offset < $limit ) ) echo '\n"; } else { $count_info = array(); $approved_comments = $wpdb->get_results( $approved_sql ); $count_info[10] = $wpdb->get_var( "SELECT FOUND_ROWS()" ); $moderation_comments = $wpdb->get_results( $moderation_sql ); $count_info[20] = count( $moderation_comments ); $count_info[30] = ( function_exists('akismet_spam_count') ) ? akismet_spam_count() : count( $wpdb->get_results( $spam_sql ) ); // Allows plugin developers to add or overwrite the count info $count_info = apply_filters( 'wphone_commentsmenu_countlist', $count_info ); if ( !$this->iscompat ) echo '

' . __('Comments') . "

\n"; echo '\n"; } } $this->test_interface('footer'); ?>