This topic has 29 replies, 12 voices, and was last updated 10 years by abidjan-loves.
-
Author
-
November 27, 2013 at 18:53 #7376hughmParticipant
I would like to hide member profiles that have not uploaded an avatar from the member directory. I have tried BP Registration Options but it has a lot of problems. Any idea how to keep a clean Member Directory without the blank avatar profiles showing?
November 28, 2013 at 09:35 #7416IamJAXParticipantSimilar question
https://archived.seventhqueen.com/forums/topic/only-show-members-with-avatars
This is not something that can be done easily since WP does not store Avatar on DB.
I am also looking for similar functionality since the carousels on this theme on home page looks better by showing users only with avatar.
November 28, 2013 at 16:47 #7425IamJAXParticipantThis filters the members carousels under search box. But does not remove the users without avatar from the top member section showing recent, popular etc.
Would be nice to have this feature buiilt into theme. Hope it will be addded to a future update.
November 28, 2013 at 19:35 #7428hughmParticipantThanks a lot. Looks great. I will test it out today.
November 29, 2013 at 01:32 #7438SQadminKeymasterThanks @IamJAX for sharing
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 30, 2013 at 06:27 #8902dentwoParticipanti tried the above code … but it didn’t work for me 🙁
any other solution?
also, if anyone knows of any plugin which allows anyone (not restricted to user only) to review the members?
thanks so much
December 31, 2013 at 20:30 #8957AbeKeymasterYou can try http://wordpress.org/plugins/bp-registration-options/
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 3, 2014 at 13:19 #9024mpitkaParticipant@IamJAX This code does not work. I get an error: Parse error: syntax error, unexpected T_STRING in /homez.755/boorntdk/www/wp-content/themes/sweetdate-child/functions.php on line 261
ideas? 🙂
January 4, 2014 at 23:37 #9119AbeKeymasterI updated @IamJAX code. now it should be fine
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 5, 2014 at 12:11 #9147mpitkaParticipantThank you @Abe
I understood this code wrong. I thought that it will remove only these profile pics from “latest registered members” -carousel from frontpage. Is there an easy way to modify it so?
January 6, 2014 at 10:40 #9195AbeKeymasterHi, not so easy.. you need to modify the default shortcode in a way to include only members with avatar
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 6, 2014 at 13:11 #9225mpitkaParticipantHi!
Okay, It just does not look so attractive when there’s so many profiles without avatar. Hope there’s coming fix soon!
🙂
March 5, 2014 at 09:00 #11945gcarlos8377ParticipantThis code causes an issue with the activity feed page. No updates are reflected on the activity feed once this code is used. This happend to me. Hopefully this info helps someone in this forum.
March 13, 2014 at 12:21 #12633AbeKeymaster@frien337, it breaks your site because you have copied it or added it in a bad way
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 13, 2014 at 16:34 #12656frien337ParticipantThanks Abe. As Home Simpsonm says: “Doh!!!”. It works fine now but there is an issue with the activity wall. As gcarlos8377 mentioned, it stops it from showing any updates.
Does anyone know anything about this?
Thanks
March 16, 2014 at 11:13 #12780AbeKeymasterWe haven’t tested that
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.March 19, 2014 at 18:17 #12996frien337ParticipantNp’s Abe, by when do you guys reckon you’ll have it tested?
March 22, 2014 at 00:08 #13179AbeKeymasterWe will try next week, Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 3, 2014 at 14:59 #14246rudik2ParticipantWhy hide user profiles without photos? You thus lose customers.
Better display on the home page (carousel, newest, popular etc.) only profiles with photo thumbnails and in the search member results first profile with a photo.Users without a profile picture will be motivated to add a photo, because they notice that finding their profile will be difficult. The search results will be far.
Sorry for my english 🙂
April 3, 2014 at 16:26 #14252harryshapesParticipanti agree with rudik.. but also agree with the first question – theme would be great to have members profile pics shown first 🙂
btw does anyone know how to shut off the pop up login.. its stopped working for me and members cant log in.. can only login via the wp-admin set login page 🙁
April 3, 2014 at 22:46 #14270rudik2Participantsumma summarum members profile pics and newest first
April 4, 2014 at 16:56 #14337abidjan-lovesParticipantSTOP !!! Well This code causes an issue with the activity feed page.
when once this code is used , no updates are reflected on the activity page.
How can I solved this issue ? thxApril 9, 2014 at 14:20 #14658AbeKeymasterWe haven’t tested that code but we will do that and see if we come with a better solution
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 19, 2014 at 01:42 #15504AbeKeymasterThis code added to sweetdate-child/functions.php works. we will add this as an option in Sweetdate settings in future versions:
COPY CODE//Hide members without avatars add_action( 'bp_core_delete_existing_avatar', 'log_avatar_deleted' ); add_action( 'xprofile_avatar_uploaded', 'log_avatar_uploaded' ); //on new avatar upload, record it to user meta function log_avatar_uploaded(){ update_user_meta(bp_loggedin_user_id(), 'has_avatar', 1); } //on delete avatar, delete it from user meta function log_avatar_deleted($args){ if($args['object']!='user') return; //we are sure it was user avatar delete //remove the log from user meta delete_user_meta(bp_loggedin_user_id(), 'has_avatar'); } function modify_loop_and_pag($qs, $object=false) { global $wpdb; $include = ''; if( $object != 'members' )//hide for members only return $qs; $subscribers = $wpdb->get_results("SELECT user_id FROM {$wpdb->usermeta } WHERE meta_key='has_avatar'" , ARRAY_N ); foreach($subscribers as $subscriber){ $include = $include . "," . $subscriber[0]; } $args = wp_parse_args( $qs ); //check if we are listing friends?, do not apply in this case if( !empty( $args['include'] ) ) { $args['include'] = $args['include'] . ',' . $include; } else { $args['include'] = $include; } $qs = build_query($args); return $qs; } add_action( 'bp_ajax_querystring' , 'modify_loop_and_pag', 25, 2 ); function current_user_has_avatar($id) { global $bp; if ( bp_core_fetch_avatar( array( 'item_id' => $id, 'no_grav' => true,'html'=> false ) ) != bp_core_avatar_default( 'local' ) ) { return true; } return false; } // ATTENTION // This code should be deleted after first site load with the code // function init_avatar_meta(){ global $wpdb; $ids=$wpdb->get_col("SELECT ID FROM $wpdb->users");//we don't need to check for meta value anyway foreach( $ids as $id ){ if( current_user_has_avatar($id) ){ update_user_meta( $id, 'has_avatar', 1 ); } else { delete_user_meta( $id, 'has_avatar' ); } } } add_action('init', 'init_avatar_meta');
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 19, 2014 at 12:32 #15537ideasbydesignParticipantHi Abe,
Thanks for your reply.
I have added it to my functions.php file and the code is working fine!
I appreciate your help. Keep up the good work sweetdate is an excellent site.
Kind regards
Matt
April 19, 2014 at 13:05 #15538AbeKeymasterGlad to hear that.
Thank youHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.April 28, 2014 at 14:22 #16233frien337ParticipantThanks Abe, it works wonderfully 🙂 One good feature to have (for the future) would be to allow a user to choose to show all profiles regardless of there being a photo or not – it could be good for people who want to see more members in the members list area.
-
AuthorPosts
The topic ‘Hide Members Without Avatars’ is closed to new replies.