function dp_recent_comments($num, $pre = '<li>', $suf = '</li>') { global $wpdb, $post; $querystr = "SELECT {$wpdb->comments}.comment_ID, {$wpdb->comments}.comment_post_ID, {$wpdb->comments}.comment_author, {$wpdb->comments}.comment_content, {$wpdb->comments}.comment_author_email FROM {$wpdb->comments} WHERE {$wpdb->comments}.comment_approved=1 ORDER BY {$wpdb->comments}.comment_date DESC LIMIT {$num}"; $recentcomments = $wpdb->get_results($querystr, OBJECT); foreach ($recentcomments as $rc) { $post = get_post($rc->comment_post_ID); echo $pre; dp_gravatar(52, 'alt="' . $rc->comment_author . '"', $rc->comment_author_email); ?> <a href="<?php the_permalink(); ?> #comment-<?php echo $rc->comment_ID; ?> "><?php echo dp_clean($rc->comment_content, 38); ?> </a><?php echo $suf; } }
<?php } ?> <p class="commentdate"><?php comment_date('F jS, Y'); ?> at <?php comment_time(); ?> <?php edit_comment_link('Edit Comment', '', ''); ?> </p> </div> <?php dp_gravatar(); ?> <br class="break" /> <?php comment_text(); ?> </div> <?php } /* end for each comment */ } ?> <h2 id="respond">d</h2> <?php if ('open' == $post->comment_status) { ?>