Search Results for 'buddypress'
-
AuthorSearch Results
-
August 29, 2013 at 2:43 pm #170628
In reply to: Private Portal with BuddyPress
shanebp
ModeratorPerhaps a simpler way, given that she wants to check for both admin and editor, is to test against a cap that both admin and editor have.
Something like: `function bp_my_restrict() {
if ( !current_user_can(‘edit_posts’) ) {
if ( bp_is_current_component(‘members’) || bp_is_current_component(‘activity’) ) {
bp_core_redirect( home_url() );
}
}
}
add_action(‘wp’,’bp_my_restrict’);`August 29, 2013 at 2:16 pm #170624In reply to: Private Portal with BuddyPress
Henry
MemberHi @mossyoak
I’ve run a few tests and made some slight changes to that code. Try this
function bp_my_restrict() { $user_id = bp_loggedin_user_id(); $user = new WP_User( $user_id ); if ( ( $user->roles[0] != 'administrator' ) ) { if ( bp_is_current_component('members') || bp_is_current_component('activity') ) { wp_redirect( home_url() ); exit(); } } } add_action('wp','bp_my_restrict');August 29, 2013 at 2:07 pm #170623In reply to: Private Portal with BuddyPress
Squirrel
ParticipantHi
Thanks for your help again
I tried your functionfunction bp_my_restrict() { global $bp; $user_id = bp_loggedin_user_id(); $user = new WP_User( $user_id ); if ( bp_is_current_component('members') || bp_is_current_component('activity') ) { if ( ( $user->roles[0] != 'administrator' ) ) { wp_redirect( $bp->loggedin_user->domain ); exit(); } } } add_action('wp','bp_my_restrict');But it gave a redirect loop error- I think it is because these conditionals are stopping the profile page being accessed for users lower than admin so trying to redirect to it is just looping.
I changed the redirect to the home page which stopped the constant loop- but users who are not admin can still not access the profile page- these conditionals are stopping that which is a bit odd.
// BuddyPress restrict activity and members page function bp_my_restrict() { global $bp; $user_id = bp_loggedin_user_id(); $user = new WP_User( $user_id ); if ( bp_is_current_component('members') || bp_is_current_component('activity') ) { if ( ( $user->roles[0] != 'administrator' ) ) { wp_redirect( home_url() ); exit; } } } add_action('wp','bp_my_restrict');Thank you for your help.
August 29, 2013 at 2:00 pm #170620In reply to: Added a new tab but link doesn't work
shanebp
Moderator@eflouret
>Do you think that moving the templates to the main theme is wrong?No, it’s what you should do when you want to customize templates.
I thought you did it solely as part of your attempt to get the new nav item working.If you want, you can add new templates to that dir.
And call a template from your show_content function:function show_content() { locate_template( array( 'buddypress/members/single/my-trips.php' ), true ); }August 29, 2013 at 1:30 pm #170618In reply to: Private Portal with BuddyPress
Henry
MemberJust read through your original question. The code snippet you’d want to add to your theme’s functions.php is something like this:
function bp_my_restrict() { global $bp; $user_id = bp_loggedin_user_id(); $user = new WP_User( $user_id ); if ( bp_is_current_component('members') || bp_is_current_component('activity') ) { if ( ( $user->roles[0] != 'administrator' ) ) { wp_redirect( $bp->loggedin_user->domain ); exit(); } } } add_action('wp','bp_my_restrict');August 29, 2013 at 1:19 pm #170617In reply to: Private Portal with BuddyPress
Henry
MemberTry this
<?php $user_id = bp_loggedin_user_id(); $user = new WP_User( $user_id ); if ( $user->roles[0] != 'administrator' ) { // your code } ?>August 29, 2013 at 12:33 pm #170615In reply to: Private Portal with BuddyPress
Squirrel
ParticipantThere is still a problem though in that if I do this it stops any member who is not an admin level user accessing their profile page. Not sure why it should affect that- tried with just the activity conditional and it stops profile page access as well.
elseif (bp_is_current_component( 'members' ) || bp_is_current_component( 'activity' )) : get_header('restrict');I’m using a header-restrict.php which redirects them with this redirect at the very top of it:
<?php if(!current_user_can('delete_others_pages')) { wp_redirect( home_url() ); exit; } ?>Any ideas?
August 29, 2013 at 12:20 pm #170613In reply to: Private Portal with BuddyPress
Squirrel
ParticipantThanks for your help Henry- I tried the is_page conditional but it does not work with the BuddyPress Pages.
So I tried bp_is_Page which worked, but was depecated.
Then I tried
bp_is_current_component( 'activity' ) || bp_is_current_component( 'members' )
and they work for what I want.Thanks for your feedback it helped a lot 🙂
Chris
August 29, 2013 at 10:05 am #170611In reply to: Private Portal with BuddyPress
Henry
MemberYou could use the WordPress conditional
is_page()to check if the user is on the activity or members page:if ( is_page('members') || is_page('activity') ) { } else { }Note: I’m assuming you haven’t changed the default slugs
August 29, 2013 at 2:43 am #170594In reply to: Added a new tab but link doesn't work
eflouret
ParticipantThanks! It worked! I can´t believe that I spent almost four hours trying to figure this out and all I needed was to set the parent slug and url.
I moved the Buddypress member templates to my theme, inside a directory named Buddypress just because I needed to do some heavy tweaking. This way the templates stay with the main theme and since I uploaded BuddyPress from WordPress control panel, I don´t have permissions to make changes to the templates. I can use the internal wordpress plugin editor, but that would drive me crazy.
Do you think that moving the templates to the main theme is wrong? Is there a better way to make changes to the templates code? Buddypress template system is like ancient chinese to me.
Thanks again!
Enrique
August 28, 2013 at 9:34 pm #170583In reply to: Show members with certain role
Henry
MemberIt is easily done. You’d need to create a new page template:
https://codex.wordpress.org/Page_Templates
You can then use a modified members loop inside the page template you create:
August 28, 2013 at 8:59 pm #170577In reply to: How to hide bp profile tabs from non profile owners?
Roger Coathup
ParticipantDuplicate of other thread: https://buddypress.org/support/topic/hide-the-followingfollowers-tabs-from-non-profile-owners/
August 28, 2013 at 8:26 pm #170570In reply to: Registration Process
Henry
MemberYour theme’s functions.php file wouldn’t get overwritten with each update. The changes you make to this file will be safe going forward.
A great place to hire a BuddyPress developer would be the BP Jobs Board:
August 28, 2013 at 8:14 pm #170568In reply to: Registration Process
tayenewm
ParticipantBut wouldn’t I run into the same problem with every theme update? I don’t know code and don’t like diddling in it. Maybe I need to just hire a developer to resolve all my little issues. Does BuddyPress offer dev services? Where do I go to sign up? thanks
August 28, 2013 at 5:25 pm #170556In reply to: [Resolved] Charge visitors to upload files
bp-help
ParticipantPlease do not make duplicate topics that regards the same subject matter as it clutters the forum. @mercime and @modemlooper has already responded on the first topic here:
https://buddypress.org/support/topic/charge-a-fee-to-upload-media/
If their suggestions doesn’t work the only options you have is build this functionality yourself or hire a developer to do it for you. You may want to post on the jobs board:
or here:
http://jobs.wordpress.net/
Good luck!August 28, 2013 at 10:48 am #170545In reply to: Toolbar buddypress menu on iPhone and iPad
studiopeter
ParticipantI’m having the same issue.
Is there a solution yet ??Regards,
PeterAugust 27, 2013 at 6:20 pm #170526In reply to: New great plugin, buddypress-wall by @megainfo
August 27, 2013 at 4:50 pm #170519In reply to: Is bp-friends-template.php editable?
terraling
ParticipantSorry @funmi-omoba, I didn’t quite get your question, but here is the code I added to my functions.php based on earlier answers:
function my_add_friend_link_text($button) { switch ( $button['id'] ) { case 'pending' : $button['link_text'] = 'x Pending'; $button['link_title'] = 'Cancel friend request'; $button['link_class'] .= ' btn btn-xs btn-warning'; break; case 'is_friend' : $button['link_text'] = '- Unfriend'; $button['link_class'] .= ' btn btn-xs btn-danger'; break; default: $button['link_text'] = '+ Friend'; $button['link_title'] = 'Send friend request'; $button['link_class'] .= ' btn btn-xs btn-success'; } return $button; } add_filter('bp_get_add_friend_button', 'my_add_friend_link_text');I’m changing the link text, changing the title, and adding additional classes (I’m using bootstrap and wanted the buttons styled the same as elsewhere, though that means deleting the generic button styling from buddypress.css)
Hope that helps.
August 27, 2013 at 4:15 pm #170516In reply to: Media Plugin for Buddypress
AnywhereButHollywood
ParticipantrtMedia is a huge, massive cluster of bugs. Awful. I have installed and uninstalled it at least 7 times in the last month, trying to give it just one more chance…. Every time I do, I discover a new bug.
Give BuddyDev’s Gallery plugin a shot. It’s premium ($30 for a 3-month “club” membership), but it’s got actual (if spotty) support – and without the attitude you get from rtMedia’s developers.
Also – and this is big for me – it includes the ability to embed media, rather than hosting. I really don’t want to be in the video hosting business at this point.
August 27, 2013 at 3:26 pm #170510jaemaz
ParticipantActually, this functionality is controlled by the BuddyPress Group Email Subscription plugin, but still… anybody? 🙂
August 27, 2013 at 2:39 pm #170505In reply to: New great plugin, buddypress-wall by @megainfo
meg@info
ParticipantOf course if your try the plugin in buddypress child theme other than the default will not work fine beceause the plugin use the default buddypress template !
the plugin work with all wordpress themes if the theme use legacy buddypress theme,
if it is child theme, in this case you must customize the plugin templates by modifying the template files. Just copy buddypress-wall\includes\templates\bp-default folder to your theme and edit the templates.A lot of Buddypress plugins present a template and suggest a customisation if the theme is buddypress child themes.
August 27, 2013 at 1:17 pm #170498In reply to: New great plugin, buddypress-wall by @megainfo
bp-help
ParticipantAugust 27, 2013 at 9:52 am #170495In reply to: New great plugin, buddypress-wall by @megainfo
Nexus66
ParticipantWill give it try..
August 27, 2013 at 9:36 am #170493In reply to: How to make Avatar a requirement?
Henry
MemberWhich premium plugin did you find?
To make uploading an avatar a requirement you’d have to have an upload form on the registration page. This used to happen in BuddyPress. Some discussion on it in this thread:
https://wordpress.org/support/topic/plugin-buddypress-avatar-upload-in-registration-formAugust 27, 2013 at 1:40 am #170487In reply to: two page home page?
-
AuthorSearch Results