Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Installation & Updates › Required Plugins Installation and Updates › If the logged-in user is a male or a female.
- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by
Themosaurusrex.
-
AuthorPosts
-
CarstenParticipant@privatedanish
- 8 Topics
- 39 Posts
Hi support.
This code finds out, if the logged-in user is a male or a female.
The problem is, that it doesn’t work in the widget area. Like who’s online, recently active members, NEWEST – ACTIVE – POPULAR…….etcSo I was wondering, if there is anyone, who knows how to modify or change this code, so i works everywhere?
Here is the snippert——>
add_filter (‘bp_ajax_querystring’, ‘modify_members_loop’, 20, 2);
function modify_members_loop ($qs=false, $object=false)
{
global $wpdb;
if ($object != ‘members’) return $qs;// figure out if the logged-in user is male or female
$gender = xprofile_get_field_data (3, bp_loggedin_user_id ());if ($gender == ‘Male’)
$query = “SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 3 AND value = ‘Female'”;
else
$query = “SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 3 AND value = ‘Male'”;$custom_ids = $wpdb->get_col ($query);
$args = wp_parse_args ($qs);
$args[‘include’] = implode (‘,’, $custom_ids);
$qs = build_query ($args);return $qs;
}Best regards Carsten.
October 3, 2019 at 18:18 #7942@themosaurusrex- 0 Topics
- 2048 Posts
Hi @privatedanish,
We think that this feature requires custom development work.
For one, we recommend you try to reach MeshPros and request a customization quote:These guys are the author of Match me for BuddyPress, a plugin that recommended to provide the matchmaking feature to your website. You might be already using it. They’ve quite a lot of experience with WordPress and BuddyPress development and might be better suited to help you.
If you’re on a tight budget, we recommend you to require the services from Envato Studio freelancers (https://studio.envato.com/explore/websites-programming). This web platform gives you access to developers who have already experience with theme customizations, and for very competitive prices.
Best,
October 4, 2019 at 17:09 #7954CarstenParticipant@privatedanish- 8 Topics
- 39 Posts
Hi Support.
Thanks for the info and yes, I could pay to make that happen, but I rather not. 😉 But you promote this theme as a Dating theme and as far as I know. A dating site is where you meet and date the opposite sex. The above snippet, works in the (members/-directory). But I found out, that there is another directory, the (members-list) The BuddyPress widgets and the members-list page, is associated with this members-list and somehow, it’s also related to the Paid membership pro plugin, that uses this members-list to sort members! I’m not an expert in coding. But maybe someone you know, knows how to implant or edit this snippet, so it work everywhere?
NOTE: If you sign up as a member and do not log in, at least one time, you will be registered in the members-list. But as soon as you have logged in ones, then you will be moved and registered in the members-directory! So now the member, is registered in 2 lists…Why
Best regards Carsten. 🙂
October 16, 2019 at 17:40 #8044@themosaurusrex- 0 Topics
- 2048 Posts
Hi @privatedanish,
I see your point. However, please note that for various reasons, Gwangi is not advertised as a dating-only theme anymore. (Please see attached.)
It’s totally possible that features might be missing to make it exactly as you view your ideal dating website. The best way to make it tick the way that you wish is to require customization or custom development work.Also, please note that the Members Lists page is a widgetized page that can be edited from the Customizer. You can remove it if you wish to display only one directory. Otherwise, you can also choose to edit the Grimlock for Author Avatars widget to query different members. The settings are nearly the same as the other Grimlock section widgets. However, you can also query for users and display the results on your homepage.
This widget is best used in the Customizer as it allow you to preview your changes. To edit your widgets in the Customizer, please navigate to “Customize > Widgets”.
For more on a very similar topic, please read the following post:Best,
Customize-Members-lists-•-Gwangi-Dating-1
Gwangi-PRO-Multi-Purpose-Membership-Social-Network-BuddyPress-Community-Theme-by-themosaurus
October 17, 2019 at 14:47 #8069 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘If the logged-in user is a male or a female.’ is closed to new replies.