Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Popular Features › Member Profile › Error of member
- This topic has 3 replies, 2 voices, and was last updated 3 years, 6 months ago by Manathan.
-
AuthorPosts
-
@themodactyl
- 0 Topics
- 6297 Posts
Hi @satisfyu,
My best guess is that your issue might probably caused by some conflicting third party plugin or some extra code snippet as we don’t encounter this issue with our demos.
Could you deactivate all plugins that have not been installed with your theme during its setup and all existing custom PHP code snippets please? And then, could you confirm me that the issue is still persisting please?
Please also make sure that you have the latest theme version and that all recommended plugins are up-to-date. Finally, you could also consider clearing all activated caching system as well as your browser cache before investigating any further.
I’m waiting for your feedback.
Thank you.
October 6, 2020 at 10:11 #23970MiguelParticipant@satisfyu- 44 Topics
- 90 Posts
I have found the problem, the problem is in the code that I put so that the administrator does not appear in the widgets on the right of the profile, that code you told me and it is important so that the administrator’s profile does not appear in the widgets, Can you see to fix it and send me a code that works and does not harm the members of the web?
Here below I send you the code:
// Exclude Admins from Directories and BP Widgets
add_filter( ‘bp_after_has_members_parse_args’, ‘buddydev_exclude_users’ );function buddydev_exclude_users( $args ) {
//do not exclude in admin
if( is_admin() && ! defined( ‘DOING_AJAX’ ) ) {
return $args;
}$excluded = isset( $args[‘exclude’] )? $args[‘exclude’] : array();
if( !is_array( $excluded ) ) {
$excluded = explode(‘,’, $excluded );
}$user_ids = array( 1, ); // enter user ids here
$excluded = array_merge( $excluded, $user_ids );
$args[‘exclude’] = $excluded;
return $args;
}// Deny access to admins profile. User is redirected to the homepage
function bpfr_hide_admins_profile() {
global $bp;
if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
wp_redirect( home_url() );
exit;
endif;
}
add_action( ‘wp’, ‘bpfr_hide_admins_profile’, 1 );// Hide admin’s activities from all activity feeds
function bpfr_hide_admin_activity( $a, $activities ) {// … but allow admin to see his activities!
if ( is_site_admin() )
return $activities;foreach ( $activities->activities as $key => $activity ) {
// ID’s to exclude, separated by commas. ID 1 is always the superadmin
if ( $activity->user_id == 1 ) {unset( $activities->activities[$key] );
$activities->activity_count = $activities->activity_count-1;
$activities->total_activity_count = $activities->total_activity_count-1;
$activities->pag_num = $activities->pag_num -1;
}
}// Renumber the array keys to account for missing items
$activities_new = array_values( $activities->activities );
$activities->activities = $activities_new;return $activities;
}
add_action( ‘bp_has_activities’, ‘bpfr_hide_admin_activity’, 10, 2 );October 6, 2020 at 19:56 #24012@themodactyl- 0 Topics
- 6297 Posts
Hi @satisfyu,
Unfortunately, this feature is not available with BuddyPress and to our knowledge, there is no plugin that you could install to add this feature to your website. This feature requires custom development work. In consequence, our recommendation is to hire a freelancer to this job for 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.
As this issue is related with BuddyPress, perhaps it’s best if you try to reach the plugin authors. They will be more informed and better suited to help you.
To go further, we invite you to post your request on their support forums:
https://buddypress.org/support/We remain available for all support requests related with the use of your theme.
Best,
October 8, 2020 at 09:18 #24081 -
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 ‘Error of member’ is closed to new replies.