screationz
Apr 26th 2009, 4:25 am
On my blog. On the sidebar where my "RECENT COMMENTS" part is I have created a simple script that besicly shows gravatars of my commentors. This script in my sidebar.php. Now what I need is the script to continue doing the same thing but just exclude my comments (blog owner) from showing. I am not sure how to achieve this. Below is the script;
$oldquery = "SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, comment_content, comment_author_email, comment_date FROM $wpdb->comments WHERE comment_approved = '1' AND comment_type = '' ORDER BY comment_date_gmt DESC LIMIT 5";
I have also tried this with no luck;
$newquery = "SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, comment_content, comment_author_email, comment_date FROM $wpdb->comments WHERE comment_approved = '1' AND comment_type = '' AND user_id NOT IN (select user_id from $wpdb->usermeta where meta_key = 'wp_user_level' and meta_value = 10) ORDER BY comment_date_gmt DESC LIMIT 5";
Can someone please help me?
Thanks for your help, appreciated.
$oldquery = "SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, comment_content, comment_author_email, comment_date FROM $wpdb->comments WHERE comment_approved = '1' AND comment_type = '' ORDER BY comment_date_gmt DESC LIMIT 5";
I have also tried this with no luck;
$newquery = "SELECT comment_author, comment_author_url, comment_ID, comment_post_ID, comment_content, comment_author_email, comment_date FROM $wpdb->comments WHERE comment_approved = '1' AND comment_type = '' AND user_id NOT IN (select user_id from $wpdb->usermeta where meta_key = 'wp_user_level' and meta_value = 10) ORDER BY comment_date_gmt DESC LIMIT 5";
Can someone please help me?
Thanks for your help, appreciated.