How can I get list of emails of users who commented on a post?

global $wpdb, $post; $query = sprintf(“SELECT comment_author_email FROM {$wpdb->comments} JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID WHERE comment_post_ID = %d AND comment_approved = ‘1’”, $post->ID); $emails = $wpdb->get_col($query); $emails = array_unique($emails); // your e-mails print_r($emails); You can also use the built-in WP_Comment_Query (or get_comments), but it’s going to be a little slower…

“operation successful” message

WordPress makes use of add_settings_error() and related function to setup notifications to display. Using them is not very straightforward, so easier way might be to make use of hooks like admin_notices or all_admin_notices to output your own message and style it in same way as WP does.

Enabling users to control custom loop’s query

User meta is the way to go friend! When you register the user via whatever you’re using, save this preference as user meta for this user. Then when you render the template, get the current user id, and get this user meta before the loop and use it in the loop.

Problem with custom user meta field

if ($authorgender = “male”) { Needs to be if ($authorgender == “male”) { == is a comparison operator http://www.php.net/manual/en/language.operators.comparison.php = assigns the value to the variable http://www.php.net/manual/en/language.variables.basics.php

Separate Out Real Users

If you install the following plugin and leave that one running for a while… you can see who logged in since using that plugin: http://wordpress.org/extend/plugins/wp-last-login/ That seems to do what you need. As far as I quickly can see it runs on $this->hook( ‘wp_login’ ) and does: $user = get_user_by( ‘login’, $user_login ); update_user_meta( $user->ID, … Read more

How can i display movies in profile page, added by an user?

how can i retrive all the movies, i retrive only the amount set in Administrtor setings. How can i retrive the pages too Assuming that $current_user->ID is now correct, and it seems from your comment that it is. $recentPosts = new WP_Query(); $recentPosts->query( array( ‘author’ => $current_user->ID, ‘post_type’ => array(‘post’,’trailers’), // pull both posts and … Read more