Wordpress Themes - Reference 2007 - Debt Consolidation - Web Hosting - Debt Consolidation

PDA

View Full Version : A script help please


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.

screationz
Apr 26th 2009, 5:36 am
anyone? :cool:

shadowgold
Apr 26th 2009, 5:45 am
anyone? :cool:
buddy that's what dp is for
:-)

why don't u chane that usermeta sql to exclude ur userid??

screationz
Apr 26th 2009, 6:11 am
shadowgold thanks for your reply. I am bit all new to this, could you please explain bit more of what you mean or how to go about it?

again thanks!

screationz
Apr 26th 2009, 4:56 pm
got it sorted :)

ghprod
Apr 27th 2009, 12:48 am
got it sorted :)
have u fix this??

u can try to

if(comment_author == admin){
//do nothing
}

just rough code ... u must define output for ur query first :)

regards

screationz
Apr 29th 2009, 9:35 am
Hi there,

Yes i was able to fix it, thanks for your help!

have u fix this??

u can try to

if(comment_author == admin){
//do nothing
}

just rough code ... u must define output for ur query first :)

regards