Forum Replies Created
-
In reply to: Exclude self from members directory
Thanks for confirming. I’ll just filter out the logged in user. Probably also do it for the follow pages (I’m using the BP follow plugin too)
If you want to display the active member count which will exclude people who have completed the registration form but not yet activated their account, then use this
<?php echo bp_core_get_active_member_count(); ?>If you want everyone including people who have not yet activated then use this
<?php global $wpdb; $sql = "SELECT COUNT(*) FROM " . $wpdb->prefix . "users"; $totalusers = $wpdb->get_var($sql); echo $totalusers; ?>In reply to: Get xprofile field value in functions.phpDidn’t see your last post…
Brilliant! Glad you got it working :}
In reply to: Get xprofile field value in functions.phpTry putting everything except the
add_action( 'init', 'my_em_setup_nav' );inside themy_em_setup_nav()function. Sofunction my_em_setup_nav(){ global $bp; $args = array( 'field' => 'Role', 'user_id' => bp_loggedin_user_id() ); $role = bp_get_profile_field_data($args); if( $role == 'Role1' ) { bp_core_remove_subnav_item('events','my-events'); bp_core_remove_subnav_item('events','my-locations'); bp_core_remove_subnav_item('events','my-bookings'); } } add_action( 'init', 'my_em_setup_nav' );In reply to: Get xprofile field value in functions.phptry adding this to the first line of your function in functions.php
global $bp;In reply to: Get xprofile field value in functions.php$args = array( 'field' => 'Role', 'user_id' => bp_loggedin_user_id() ); $role = bp_get_profile_field_data( $args );…should be what you’re after.
In reply to: [Resolved] Activity stream accessible to everyone@ghera74 you can see the sitewide activity stream (without being a registered member) by going to yoursite.com/activity
I think I’ve come across this myself. I themed my activity pages so assumed the issue was caused by something I had introduced. I suggest you raise the issue at BuddyPress Trac where the developers can pick it up and confirm if it is a bug.
In reply to: Complete list of all BuddyPress pagesHey @bphelp, nice plugin idea! I think lots of companies would want to use something like that as a kind of intranet for staff only.
So far i’ve come up with:
Registration and login
Register
Activate
Login
Lost password
Reset passwordLanding pages
MembersMessaging component
Inbox
Sentbox
Compose
Single messageProfile component
Public
Edit
Change avatarSettings component
General
Notifications
Delete accountCan you spot any I have missed?
I haven’t got to the activity or friends components yet as these are currently disabled on my install.
In reply to: child theme integrationBuilding a child theme and then switching shouldn’t be a problem. For a tutorial on how to create a child theme see the Codex
https://codex.buddypress.org/legacy/building-a-buddypress-child-theme/In reply to: redirect to profile page?Trying changing
wp_redirect( get_option('siteurl') . '/profile' );to
wp_redirect( '/members/' . bp_core_get_username( bp_loggedin_user_id() ) );In reply to: Duplicate profile field namesThanks for the feedback guys. I have quite a few field names that could easily be duplicates. My current workaround is exactly what you’ve suggested (naming them all differently “Work email” “Home email” and so on). I was hoping there was some easy approach I was overlooking
In reply to: Duplicate profile field namesI may be wrong but
echo bp_get_profile_field_data( 'field=Email' )won’t necessarily echo the “Email” field in profile group 2. Allif ( bp_has_profile('profile_group_id=2') )does is check if profile group 2 exists.In reply to: Members directory sorting not working@cyber49 the ajax functionality when searching, filtering or using the pagination is heavily reliant on the HTML markup in members/member-loop.php and members/index.php
If any of the page elements have been modified or deleted then you’ll hit problems. If you have customised any of these two files then perhaps try starting with a fresh install and add in your customisations gradually to see where the problem is introduced. This approach is laborious but it worked for me.
@hahvensa glad you resolved your issue.
You could have the login form use username/password. That way, there is no need for multiple email addresses. The username and password could then be handed out to trusted people.
In reply to: How to check if member has avatar ?Make sure you have this inside your
<head> </head>in your header.php file<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>jQuery doesn’t work without it.
In reply to: How to check if member has avatar ?You sure can use jQuery. To hide the alert after the user has clicked on close
<script> $(".close").click(function(){ $(".no-pic").hide(); }); </script>In reply to: How to check if member has avatar ?So it will look something like this
<?php if ( current_user_has_avatar() ) { //do something for people who have uploaded an avatar } else { //do something for people who haven't } ?>In reply to: How to check if member has avatar ?If you want to use the function you put in your functions.php then you should use
current_user_has_avatar()instead ofbp_get_user_has_avatar()In reply to: Private message from non-membersWhen non-members are browsing through member profiles, the default behaviour is for them to be able to see each member’s avatar. The
bp_displayed_user_avatar()function takes care of that.If this isn’t happening then I suggest you check there isn’t a
is_user_logged_in()check which is used to display content to only logged-in (registered members) users.With reference to the non-member messaging, this would be far more complex to achieve and would require lots of custom code.
In reply to: Private message from non-membersNot out-of-the-box. In order to send a private message the sender will need to be registered and logged in.
In reply to: How to check if member has avatar ?Humm.. this always seems to return true for me @megainfo
Update: issue resolved. i was defining a custom default avatar hence why the check always trued true e.g
define ( 'BP_AVATAR_DEFAULT', get_stylesheet_directory_uri() .'/img/avatar.png' );In reply to: Complete list of all BuddyPress pagesAh right, and i never knew that! i’ll try to make my list a little more comprehensive before I create a new codex page, i’m sure i’m still missing one or two important site pages
Thanks again :}
In reply to: Complete list of all BuddyPress pagesThanks @hnla
i’ve been through the directory structure with a toothpick and have come up with a good list. It would be great if you could feed back to the documentation team that a full list published somewhere in the codex would be greatly appreciated :}
In reply to: Change avatar template notice bug – Tester needed