[php]
if(get_query_var(‘author_name’)) :
$curauth = get_userdatabylogin(get_query_var(‘author_name’));
else :
$curauth = get_userdata(get_query_var(‘author’));
endif;
$querystr = ”
SELECT comment_ID, comment_post_ID, post_title, comment_content
FROM $wpdb->comments, $wpdb->posts
WHERE user_id = $curauth->ID
AND comment_post_id = ID
AND comment_approved = 1
ORDER BY comment_ID DESC
“;
$comments_array = $wpdb->get_results($querystr, OBJECT);
if ($comments_array): [/php]
<h2>Recent Comments </h2>
<ul>
foreach ($comments_array as $comment):
setup_postdata($comment);
echo ”
- url’) .”/?p=”.$comment->comment_post_ID.”‘>Comment on “. $comment->post_title. “
“. $comment->comment_content . “
“;
endforeach; ?>
</ul>
endif; [/php]
This content is published under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported license.