*
*

is_singular = true; // admin data $authordata = get_userdata(1); // comment author username if (isset($_COOKIE['comment_author_'.COOKIEHASH])) { $comment_author = apply_filters('pre_comment_author_name', $_COOKIE['comment_author_'.COOKIEHASH]); $comment_author = stripslashes($comment_author); $comment_author = attribute_escape($comment_author); } // comment author email if (isset($_COOKIE['comment_author_email_'.COOKIEHASH])) { $comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]); $comment_author_email = stripslashes($comment_author_email); $comment_author_email = attribute_escape($comment_author_email); } // comments if ($user_ID) { $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND (comment_approved = '1' OR ( user_id = %d AND comment_approved = '0' ) ) ORDER BY comment_date", $post_id, $user_ID)); } else if ( empty($comment_author) ) { $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date", $post_id)); } else { $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND ( comment_approved = '1' OR ( comment_author = %s AND comment_author_email = %s AND comment_approved = '0' ) ) ORDER BY comment_date", $post_id, $comment_author, $comment_author_email)); } // base url of page links $baseLink = ''; if ($wp_rewrite->using_permalinks()) { $baseLink = '&base=' . user_trailingslashit(get_permalink($post_id) . 'comment-page-%#%', 'commentpaged'); } // response wp_list_comments('callback=' . $callback . '&page=' . $page_id . '&per_page=' . get_option('comments_per_page') . $type, $comments); echo ''; echo '' . $post_id . ''; paginate_comments_links('current=' . $page_id . $baseLink); die(); } } add_action('init', 'cpage_ajax'); /** add to WordPress */ function commentpager_head() { $options = get_option('ajax_comment_pager_options'); if (!(is_single() || is_page() || $withcomments) || !get_option('page_comments') || !$options['comments_id'] || !$options['callback']) { return; } $css_url = get_bloginfo("wpurl") . '/wp-content/plugins/ajax-comment-pager/ajax-comment-pager.css'; if ( file_exists(TEMPLATEPATH . "/ajax-comment-pager.css") ){ $css_url = get_bloginfo("template_url") . "/ajax-comment-pager.css"; } echo "\n" . ''; echo "\n" . ''; echo "\n" . ''; echo "\n" . ''; echo "\n" . '' . "\n"; } add_action('wp_head', 'commentpager_head'); ?>