Search Results for 'private'
-
AuthorSearch Results
-
August 29, 2013 at 1:30 pm #170618
In 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:28 pm #170614In reply to: Reply to private message is sent twice
them8z
ParticipantI disabled the plugin “simple chat” and it worked again!
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 28, 2013 at 7:22 am #170541koomak
ParticipantIs there anyone to help on this ?
August 25, 2013 at 8:51 pm #170404In reply to: Private Message Button Label Change
funmi omoba
Participantthanks for your reply I thought as much but I think it get wiped during the plugin update.
Thanks for your input anyways.
Best Regards
August 25, 2013 at 8:41 pm #170403In reply to: Private Message Button Label Change
shanebp
ModeratorOpen the plugin file, find the text, replace the text
August 25, 2013 at 7:48 pm #170400In reply to: Private Message Button Label Change
funmi omoba
ParticipantThanks for your snippet which works great with standard buddypress message system but did not work if using BP Profile Message UX plugin, is there anyway to make it work please
https://wordpress.org/plugins/bp-profile-message-ux/
tahnks
August 25, 2013 at 5:03 pm #170393In reply to: Hide/restrict access to Private Messaging
August 25, 2013 at 5:00 pm #170392In reply to: Private Message Button Label Change
Henry
Member@shanebp good point about using the bp_send_private_message_link approach. Although you would avoid double buttons by using a translation file.
August 25, 2013 at 4:44 pm #170389In reply to: Private Message Button Label Change
shanebp
Moderator@henrywright-1
And how would you avoid double buttons due to this call in member-header.php?
do_action( ‘bp_member_header_actions’ );
@tayenewm
Use the provided apply_filters:function tweak_button_label ( $args ) { $args[link_text] = 'Something'; return $args; } add_filter( 'bp_get_send_message_button_args', 'tweak_button_label', 1, 1 );August 25, 2013 at 4:33 pm #170388In reply to: Hide/restrict access to Private Messaging
shanebp
Moderator@henrywright-1
Don’t include the global if you aren’t going to use it.August 25, 2013 at 4:28 pm #170387In reply to: Private Message Button Label Change
Henry
Memberactually you could make use of the
bp_send_private_message_linkfunction and do it like this:<a href="<?php bp_send_private_message_link() ?>" title="Private Message">Private Message</a>You can change the “Private Message” text to whatever you like. You’d just paste the code into your theme where ever you’d like the button to appear
August 25, 2013 at 4:20 pm #170386In reply to: Private Message Button Label Change
Henry
MemberYou could do it like that but each time you update BuddyPress you’ll lose the changes you’ve made to bp-messages-template.php. I’d try to avoid making changes to the plugin core.
August 25, 2013 at 4:18 pm #170385In reply to: Private Message Button Label Change
tayenewm
ParticipantThat process seems beyond me and very long (and I cannot find the /plugins/buddypress/bp-languages folder) I just want to change the “Private Message” button label. Can I access/change it quickly like this:
1. access buddypress/bp-messages/bp-messages-template.php
2. change the ‘link text’ to the new label name in this block of code?function bp_get_send_message_button() {
// Note: ‘bp_get_send_message_button’ is a legacy filter. Use
// ‘bp_get_send_message_button_args’ instead. See #4536
return apply_filters( ‘bp_get_send_message_button’,
bp_get_button( apply_filters( ‘bp_get_send_message_button_args’, array(
‘id’ => ‘private_message’,
‘component’ => ‘messages’,
‘must_be_logged_in’ => true,
‘block_self’ => true,
‘wrapper_id’ => ‘send-private-message’,
‘link_href’ => bp_get_send_private_message_link(),
‘link_title’ => __( ‘Send a private message to this user.’, ‘buddypress’ ),
‘link_text’ => __( ‘Private Message’, ‘buddypress’ ),
‘link_class’ => ‘send-message’,
) ) )August 25, 2013 at 4:15 pm #170384In reply to: Hide/restrict access to Private Messaging
Henry
Memberyou would add something like this to your theme’s functions.php
function bp_disable_messaging() { global $bp; if ( USER_TO_DISALLOW && bp_is_current_component('messages') ) { wp_redirect( home_url() ); exit(); } } add_action('wp','bp_disable_messaging');Note: USER_TO_DISALLOW would be your unpaid WooCommerce users. You would need to get whatever this was from WooCommerce as I’m not familiar with the plugin. Once you’ve added that bit in the code should work.
August 25, 2013 at 1:58 pm #170380In reply to: Private Message Button Label Change
Henry
MemberThis will help you. It shows you how to change most of the text labels and messages outputted by BuddyPress:
https://codex.buddypress.org/developer/customizing/customizing-labels-messages-and-urls/
August 23, 2013 at 3:30 pm #170297Peter Hardy-vanDoorn
ParticipantWill there ever be a resolution to this problem? BP 1.8 with bbPress 2.3.2 on WP 3.6 still sees forum posts in Private groups appearing in non-group members’ activity streams!
August 19, 2013 at 2:47 pm #170052shanebp
ModeratorYou’ll need to know the user_id for the teacher.
Then check the array for that id. If it’s found, remove it.
And tell the student why, something like:
bp_core_add_message( __( 'You cannot send a private message to the teacher.', 'buddypress' ), 'error' );August 19, 2013 at 2:26 pm #170051Artisantopia
Participantthank you @shanebp.
I only know enough about filters to get myself into trouble! I’ve just had a look at that one. Are you suggesting that I remove the teacher from the array so they don’t show in the list of members to send to? Is that how that works?
How would that work from the member/student perspective?
I really appreciate any guidance you can give me.
Thank you.
August 19, 2013 at 2:02 pm #170049shanebp
ModeratorDo you know how to use filters?
Take a look at function send() in
\buddypress\bp-messages\bp-messages-classes.phpIt has lots of filters.
I’d use the do_action_ref_arrayAugust 15, 2013 at 9:22 pm #169911Rachel Biel
ParticipantA related issue is how forum post links show up elsewhere. For example, we have a private group on facebook and I am directing them to the various forum topics that I am creating. All of the links show up as TAFA Forum Group. It gets really confusing if you post a lot of them. I would think this also has to do with how the permalinks and feeds show up. I don’t know if this is a buddypress or bbpress issue, but I hope it’s addressed in future updates. Social media is a part of our world now and buddypress needs to be able to function just as wordpress does if content can have viral potential.
August 12, 2013 at 8:36 am #169733Hugo Ashmore
ParticipantClosing thread.
@whitewolf1988 Please avoid name calling, even in jest. People have the right to monetize their work if they so wish, it’s a common plugin model to have free version and premium, why do think people should work for no return? -
AuthorSearch Results