Forum Replies Created
-
In reply to: Redirect for members re entering a community
the way that I have the site at the moment if the user wants to click out of the community to other parts of my site there is no way back in unless they log out first
This isn’t standard behaviour. Does this happen when you’re using the default theme?
To redirect logged in users away from community page, try adding this snippet to your theme’s functions.php file.
function bp_redirect_community_page() { global $bp; if ( is_page( 'community' ) && is_user_logged_in() ) { wp_redirect( $bp->loggedin_user->domain ); exit(); } } add_action( 'template_redirect', 'bp_redirect_community_page' );With reference to the rest of the problems you’re facing, I’d suggest opening a new thread for each different problem.
@gyan-gaurav I navigated around for about 2 minutes and didn’t come across page not found at all.
In reply to: Redirect for members re entering a communitySo let me see if I understand what you’re trying to do.
If a user is logged in and visits your community page
http://www.thedogsclub.com/testing/community/you would like them to be redirected to the member’s activity pagehttp://www.thedogsclub.com/members/username/activityIf a logged out user visits the community page then do nothing. Let them stay and click the login link (if they wish to).
Is that right?
In reply to: Restricting User Group ProfilesAh, you want profile group not profile field. Sorry. But it shows you the general way PHP can be used
In reply to: Restricting User Group ProfilesWell first you’d need to write some code
// find the user's role $user = new WP_User( bp_displayed_user_id() ); $role = $user->roles[0]; // find the profile field value you want $location = bp_get_profile_field_data( 'field=Location' ); // perform a conditional check making sure the user has a specific role and has completed the profile field before displaying the value if ( ( $role == 'Blah' ) && ( $location ) ) echo $location;Notes:
- replace Blah with the role you want
- replace Location with the name of the profile field you want
- I have assumed all of your users have just one role assigned
In reply to: Restricting User Group ProfilesThe way to do this would be to wrap info fields in conditional statements like this
if member type is X then // display info fieldIn reply to: Activation emailWelcome pack by Paul Gibbs will allow you to customise the text in all emails that get sent out via BuddyPress
https://wordpress.org/plugins/welcome-pack/With reference to the emails not getting through to users, perhaps try reverting to the default theme, deactivate all plugins (aside from BP) and see if the problem is still happening.
In reply to: Hide Profiles Without AvatarsThere is a plugin by BuddyDev which might help. It allows members to add an avatar on sign up
In reply to: Member loginYou might want to provide more details of the problem. Which version of WP, BP, plugins activated? Which theme are you using?
In reply to: @-mentions in comments and blog post textThanks for helping to test @mercime
Trac ticket:
https://buddypress.trac.wordpress.org/ticket/5230In reply to: Add a variable in bp_has_membersI’m not very familiar with the groups loop (never had groups enabled) but, yes, in theory there is nothing to stop copying functions you need from the BP core, modifying them for your purpose then adding them to your theme’s functions.php file for your own custom use.
In reply to: Add a variable in bp_has_membersFor the groups loop, you need to use
bp_group_has_members()instead ofbp_has_members()In reply to: Add a variable in bp_has_membersbp_loggedin_user_id()will hold the exact same value as$the_user_idanyway.In reply to: Link to a private messagearticle?
In reply to: Add a variable in bp_has_membersI noticed in your code these lines aren’t being used:
global $bp; $the_user_id = $bp->loggedin_user->userdata->ID; $the_user_login = $bp->loggedin_user->userdata->user_login;Unless you’re using
$the_user_loginor$the_user_idit should be safe to remove them.In reply to: Link to a private messageThe user ID of the admin is usually 1. That assumes you have just one administrator and that was the first user created when you set up BP. The thread ID is the ID of the private message. You can get this from the URL. It’ll end something like /view/86. It is the digit that you want.
In reply to: Link to a private messageYou’ll need the
$user_idand$thread_id;for the link to work.In reply to: Link to a private message@l-tic unless the person clicking the link is involved in the conversation, linking to a private message will surely result in a 404?
<a href="/<?php echo bp_core_get_username( $user_id ); ?>/messages/view/<?php echo $thread_id; ?>/" title="Message">Message</a>In reply to: Members Directory sort function not working@tayenewm just a thought – do you know if the developer made any customisations to the BuddyPress core? This is quite bad practice but it is a possibility. If that has happened then there are 3 options…
- live with a broken sort feature
- try to get in contact with the developer to see what changes have been made
- reinstall WP and BP
Considering point 1 is unappealing and point 2 doesn’t look possible then I’d try point 3.
In reply to: Members Directory sort function not working@tayenewm there is a good chance this is down to your theme so reinstalling BuddyPress is most probably unnecessary.
If the developer has modified any of the markup in members-loop.php then there is a good chance the modifications are what has broken the sort feature. The sort feature is dependent on certain page elements so if any class names or IDs have been changed or removed then that will be the source of your problem.
As @hnla said, the way to resolve the issue is to revert to the default theme and work backwards, eliminating each customisation the developer has made as the source of the problem.
In reply to: Ability to dismiss template noticesOK so perhaps it hasn’t been. I decided on using this solution if anyone else ever needs it:
<script> $(document).mouseup(function (e) { var notice = $(".bp-template-notice"); if (!notice.is(e.target) && notice.has(e.target).length === 0) { notice.hide(); } }); </script>This will dismiss the template notice if the user clicks anywhere else on the page. i.e outside of the template notice’s containing div.
In reply to: Private messages outside /member/messagesThis will help:
In reply to: [Resolved] Link to authors posts in members_headerWhen viewing a member’s profile page, you can use
bp_displayed_user_id()to get the ID of the member. This will then let you display a list of their posts or their latest post. e.g.$my_query = new WP_Query( 'author=' . bp_displayed_user_id() ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); echo '<li>' . get_the_title() . '</li>'; } } else { // no posts found } wp_reset_postdata();But then note, when you navigate away from the member’s profile page, posts will no longer be displayed due to
bp_displayed_user_id()no longer holding a value. To me, this would make sense as if you were viewing the Privacy Policy or About Us pages (for example) you wouldn’t want a member’s posts to show up.In reply to: User Reputation/Kudos Plugin??Do you mean something like Achievements by Paul Gibbs?
In reply to: Can't figure out how to override parent css@poetrybyjade no problem. Might be worth trying again at some point though. I just tested and it works for me.