My Comments

[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 ”

“;

endforeach; ?>

</ul>

endif; [/php]

Comments (0)

Submit a comment... (Minimum 25 characters)