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 ?>
\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 '
'; echo ''. $comment->comment_date; echo '
"' . $comment_excerpt . '"'; echo "