Search Results for 'private'
-
AuthorSearch Results
-
October 26, 2016 at 7:41 am #260364
ico33
ParticipantHello and thanks for the support, I tried the solution suggested, but after I created and then uploaded the file bp-custom in the plugins folder I got an error in every page of the website:
Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/mondolap/public_html/wp-content/plugins/bp-custom.php on line 2
This is my file bp-custom:
<? php function buddydev_hide_members_directory_from_all_except_admin() { if ( bp_is_members_directory() && ! is_super_admin() ) { //should we add a message too? //bp_core_add_message( 'Private page.', 'error' ); bp_core_redirect( site_url('/') ); } } add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_from_all_except_admin' ); ?>October 25, 2016 at 8:04 pm #260335In reply to: BuddyPress Privacy for Messages
livingflame
Participanthttps://la.wordpress.org/plugins/buddypress-private-message-for-friends-only/
Okey, very very partial solution.
Really solution: BuddyDev Message Privacy BUT native!
October 20, 2016 at 2:18 pm #260067In reply to: Very Important Features For BP
livingflame
ParticipantLinks Public. Please do not delete!
Bp links Menu with notify.
https://goo.gl/photos/X8wMQzUUAfVLD34o8Search Activities by Date –> https://goo.gl/photos/pG9KHUMdybAetBNF9
Message or Notifications Template. https://goo.gl/photos/ngAmNCHyRCWyd9fLA
Buddypress.org has some template like this for Notifications.
Feature #17. Private Messages for Friends Only but, Optional from User Menu.
With rtMedia plugin you can put your Posts or Photos: Only Me, Only Logged Users, Only Friends, Public. But, rtMedia does not work for Messages.October 19, 2016 at 1:10 pm #259994In reply to: Login page
Venutius
Moderatorhttps://wordpress.org/plugins/bp-simple-private/
This makes it so the only page you can view is the homepage, then make sure all you can see on the homepage is the login button? Either that or modify the above plugin so that it redirects to the login page.
October 14, 2016 at 12:39 am #259824Topic: BuddyPress Emails Not Sending
in forum How-to & Troubleshootingbcanr2d2
ParticipantMy install has stopped sending any emails out for new user activation.
I can receive emails sent by WordPress after a user is manually activated, and can receive any email from Postman SMTP, as these test emails work.I don’t use any other activity markers, but emails were not received when messages were sent either.
I have tried all of the listed troubleshooting steps that others have gone through before.
I have a custom function that creates a post for the user during the registration process. I have removed all custom functions and tried registering a user, and it still will not send any emails.
As BuddyPress uses it’s own PHP Mailer, I am not able to log them via any WP Mail logging tools, and want to see what might be going on here.
The problem reared its head around the time I upgraded to 2.6 (although the custom function during registration was also added at this time) as wellI have reset the emails multiple times, and I have not made any changes to them.
Could someone please provide assistance, or given me a suggestion on how to run the BP Email Debug code to get an email of any issues
Host is Bluehost
Here is my install, and plugin list
WordPress 4.5.4
BuddyPress 2.6.2
Advanced Custom Fields 4.4.10
Akismet 3.1.11 (inactive)
BackWPuP 3.3.4
BP Force Profile Photo 1.0.5
BP Member Type Manager 1.0.1 (inactive)
BP xProfile Location 1.2
BP XProfile WordPress User Sync 0.6.4
Broken Link Checker 1.11.2
Buddy Progress Bar 1.0.2
BuddyPress Conditional Field Groups 0.1.0
Buddypress Conditional Profile Field 2.0
Buddypress Geodirectory Integration 1.0.0 (inactive)
BuddyPress Member Type Generator 1.0.2
BuddyPress Profile Tabs 1.6.1
BuddyPress Security Check 2.1.2
BuddyPress Simple Terms And Conditions 1.3
BuddyPress Xprofile Custom Fields Type 2.5
BuddyPress Xprofile Member Type Field 1.0.4
Cherry Parallax Plugin 1.0.0 (for my theme)
Cherry Plugin 1.2.8.1 (for my theme)
Conditional Profile Fields for BuddyPress 1.1.9
Contact Form 7 4.5
Contact Form 7 – Dynamic Text Extension 2.0.1
Custom Hooks 1.0 (All my custom functions are in this plugin)
Custom Login 3.2.5
Custom Post Template By Templatic 1.0
Custom Post Type UI 1.4.1
Disable Comments 1.5.2
Display Posts Shortcode 2.7.0
Easy Parallax Slider 2.1.1
FacetWP 2.6.4
GEO my WP 2.6.6.1
GeoDirectory 1.6.5 (inactive)
Hello Dolly .1.6 (inactive)
MOJO Marketplace 1.0.1 (inactive)
MotoPress Content Editor Lite 1.6.5 (inactive)
Quick and Easy FAQs 1.0.3
SuitePlugins – Advanced XProfile Fields for BuddyPress 1.0.3
Super Socializer 7.8.1
WP Private Content Plus 1.11
WPFront User Role Editor 2.12.4
Yoast SEO 3.5October 11, 2016 at 6:46 pm #259742danbp
ParticipantThis topic is titled “Function to hide private message depending of user role”.
and the snippet does that ! Subscribers have no access to the button. So far i remember it is also the default role in WordPress. You change that to your need.
The first condition in the snippet allows some users (by ID) to access the button, whatever their role.
If you want to add other WP roles, you simply copy the 2nd conditionnal
if(role=='')and add another roleif(role=='mamamouchi") { //do something }.Or you use only the user ID if you have only a few members allowed to access. I litle understanding of php is of course a + to do that.
You have the basics in the snippet. Now, it’s to you now to make it work for your need.October 11, 2016 at 6:22 pm #259740Raphael.v
ParticipantThank you @danbp, this work ! I’m pretty sure this will help a lot (and not only me).
I’am asking something more : can this be adapt to allow only some user role to use private message ? (and not only some users ?) As the second part of the code you wrote, it remove the button to susbscriber.
(I’m learning PHP, I’ve tried to change the code but did not succeed to have it work…)
October 11, 2016 at 12:33 pm #259719danbp
ParticipantHi,
try this (goes to bp-custom.php)
function bpex_remove_private_message_button( $button ) { $user = bp_loggedin_user_id(); if ( $user == '4' || $user == '7' || $user == '25' ) { // the allowed user ID's return $button; } if ( !empty( $user->roles ) && is_array( $user->roles ) ) { if ( $role == 'subscriber') { $button = ''; } } } add_filter( 'bp_get_send_message_button', 'bpex_remove_private_message_button', 1 , 1 );No idea how to get specifically a pmpro defined user ID – you have to check their doc to adjust the above snippet. Note that it works on a standart install – without pmpro.
October 5, 2016 at 5:25 am #259414In reply to: Buddypress PM Message from Post
danbp
ParticipantHi @koded1999,
please, use the
<code>button to insert snippets. Also avoid double posting.
Closing this topic as duplicate.
Conversation goes ahead here:October 5, 2016 at 3:55 am #259413In reply to: Disable or Hide Private Message Button
koded1999
Participant@henrywright i managed to fix that and is working perfectly.
but i have another problem.
i will like to populate the subject automatically when user click the private message button from post
pls how can i achieve this.
thank you
October 5, 2016 at 3:02 am #259410In reply to: Disable or Hide Private Message Button
koded1999
Participant@henrywright Please i will like to add private message button in post side bar. i used the code below it works but doesnt populate the author automatically. how can i fix this thanks in advance.
function bpfr_message_shortcode() { $author = get_the_author(); $message = 'Login to contact advertiser!'; if( is_user_logged_in() ) { return '<a>MESSAGE ADVERTISER</a>'; } else { return $message; } } add_shortcode( 'ksam', 'bpfr_message_shortcode' );October 1, 2016 at 3:58 pm #259313In reply to: Disable BP reg
Ron Ashman
ParticipantHi Henry,
Wow I didn’t expect an answer so quickly. Thanks!
I wouldn’t feel comfortable opening a ticket because my understanding of developing is quite basic, and this is a free plugin so I’d feel greedy asking for things or “complaining”.
Would you please tell me if it might cause any trouble if I leave those pages set as blank? I don’t mind the warning or might find a way to hide it.
I tried setting private pages or assign a password, but they don’t show in the list or even if they’re password protected they still show the content (registration form).
Disabling registration through BP would be the best option for me, I think.
Thanks again, have a great day!
September 27, 2016 at 6:02 pm #259175In reply to: Changing visibility in Activity page
Venutius
ModeratorWhat you can do is hide that menu option option from non-logged in users. To do this, you need to install the WPFront User Role Editor plugin and it gives the the ability to choose who can see each menu option. It’s quick and dirty but also easy. Obviously is any not logged in user knows the address of the activity page they can still see it, but you could also set that page to private.
September 27, 2016 at 6:02 pm #259174In reply to: Changing visibility in Activity page
danbp
ParticipantPlease note that you don’t need to add your site url in each of your topic. It’s useless and considered as a bad practice when nobody asked specifically for it.
About privacy, read here
September 27, 2016 at 4:55 pm #259168In reply to: Group Forum Won’t Stay in Group
danbp
ParticipantHi,
Which group menu are you talking about ?
How do you add the link ? And why ? Because, you haven’t to do that on a standard MS install, even for private groups. Sorry, but this point is a bit unclear.Review your forum settings:
September 23, 2016 at 5:47 am #259053bikerwp000
Participant<?php /** * Plugin Name: BP Loop Filters * Plugin URI: https://codex.buddypress.org/add-custom-filters-to-loops-and-enjoy-them-within-your-plugin * Description: Plugin example to illustrate loop filters * Version: 1.0 * Author: imath * Author URI: http://imathi.eu * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt */ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; class BP_Loop_Filters { /** * Constructor */ public function __construct() { $this->setup_actions(); $this->setup_filters(); } /** * Actions * * @uses bp_is_active() * @uses is_multisite() */ private function setup_actions() { /** * Adds the random order to the select boxes of the Members, Groups and Blogs directory pages */ // Members component is core, so it will be available add_action( 'bp_members_directory_order_options', array( $this, 'random_order' ) ); // You need to check Groups component is available if ( bp_is_active( 'groups' ) ) { add_action( 'bp_groups_directory_order_options', array( $this, 'random_order' ) ); } // You need to check WordPress config and that Blogs Component is available if ( is_multisite() && bp_is_active( 'blogs' ) ) { add_action( 'bp_blogs_directory_order_options', array( $this, 'random_order' ) ); } /** * Registers the Activity actions so that they are available in the Activity Administration Screen */ // You need to check Activity component is available if ( bp_is_active( 'activity' ) ) { add_action( 'bp_register_activity_actions', array( $this, 'register_activity_actions' ) ); // Adds a new filter into the select boxes of the Activity directory page, // of group and member single items activity screens add_action( 'bp_activity_filter_options', array( $this, 'display_activity_actions' ) ); add_action( 'bp_member_activity_filter_options', array( $this, 'display_activity_actions' ) ); // You need to check Groups component is available if ( bp_is_active( 'groups' ) ) { add_action( 'bp_group_activity_filter_options', array( $this, 'display_activity_actions' ) ); } // You're going to output the favorite count after action buttons add_action( 'bp_activity_entry_meta', array( $this, 'display_favorite_count' ) ); } } /** * Displays a new option in the Members/Groups & Blogs directories * * @return string html output */ public function random_order() { ?> <option value="random"><?php _e( 'Random', 'buddypress' ); ?></option> <?php } /** * Registering the Activity actions for your component * * The registered actions will also be available in Administration * screens * * @uses bp_activity_set_action() * @uses is_admin() */ public function register_activity_actions() { /* arguments are : - 'component_id', 'component_action_type' to use in {$wpdb->prefix}bp_activity database - and 'caption' to display in the select boxes */ bp_activity_set_action( 'bp_plugin', 'bpplugin_action', __( 'BP Plugin Action' ) ); /* Activity Administration screen does not use bp_ajax_querystring Moreover This action type is reordering instead of filtering so you will only use it on front end */ if ( ! is_admin() ) { bp_activity_set_action( 'bp_plugin', 'activity_mostfavs', __( 'Most Favorited' ) ); } } /** * Building an array to loop in from our display function * * Using bp_activity_get_types() will list all registered activity actions * but you need to get the ones for your plugin, and this particular function * directly returns an array of key => value. As you need to filter activity * with your component id, the global buddypress()->activity->actions will be * more helpful. * * @uses buddypress() * @return array the list of your plugin actions. */ private function list_actions() { $bp_activity_actions = buddypress()->activity->actions; $bp_plugin_actions = array(); if ( !empty( $bp_activity_actions->bp_plugin ) ) { $bp_plugin_actions = array_values( (array) $bp_activity_actions->bp_plugin ); } return $bp_plugin_actions; } /** * Displays new actions into the Activity select boxes * to filter activities * - Activity Directory * - Single Group and Member activity screens * * @return string html output */ public function display_activity_actions() { $bp_plugin_actions = $this->list_actions(); if ( empty( $bp_plugin_actions ) ) { return; } foreach ( $bp_plugin_actions as $type ):?> <option value="<?php echo esc_attr( $type['key'] );?>"><?php echo esc_attr( $type['value'] ); ?></option> <?php endforeach; } /** * Displays a mention to inform about the number of time the activity * was favorited. * * @global BP_Activity_Template $activities_template * @return string html output */ public function display_favorite_count() { global $activities_template; // BuddyPress < 2.0 or filtering bp_use_legacy_activity_query if ( ! empty( $activities_template->activity->favorite_count ) ) { $fav_count = $activities_template->activity->favorite_count; } else { // This meta should already have been cached by BuddyPress :) $fav_count = (int) bp_activity_get_meta( bp_get_activity_id(), 'favorite_count' ); } if ( ! empty( $fav_count ) ): ?> <a name="favorite-<?php bp_activity_id();?>" class="button bp-primary-action">Favorited <span><?php printf( _n( 'once', '%s times', $fav_count ), $fav_count );?></span></a> <?php endif; } /** * Filters */ private function setup_filters() { add_filter( 'bp_ajax_querystring', array( $this, 'activity_querystring_filter' ), 12, 2 ); add_filter( 'bp_activity_get_user_join_filter', array( $this, 'order_by_most_favorited' ), 10, 6 ); add_filter( 'bp_activity_paged_activities_sql', array( $this, 'order_by_most_favorited'), 10, 2 ); // Maybe Fool Heartbeat Activities! add_filter( 'bp_before_activity_latest_args_parse_args', array( $this, 'maybe_fool_heartbeat' ), 10, 1 ); } /** * Builds an Activity Meta Query to retrieve the favorited activities * * @param string $query_string the front end arguments for the Activity loop * @param string $object the Component object * @uses wp_parse_args() * @uses bp_displayed_user_id() * @return array()|string $query_string new arguments or same if not needed */ public function activity_querystring_filter( $query_string = '', $object = '' ) { if ( $object != 'activity' ) { return $query_string; } // You can easily manipulate the query string // by transforming it into an array and merging // arguments with these default ones $args = wp_parse_args( $query_string, array( 'action' => false, 'type' => false, 'user_id' => false, 'page' => 1 ) ); /* most favorited */ if ( $args['action'] == 'activity_mostfavs' ) { unset( $args['action'], $args['type'] ); // on user's profile, shows the most favorited activities for displayed user if( bp_is_user() ) { $args['user_id'] = bp_displayed_user_id(); } // An activity meta query :) $args['meta_query'] = array( array( /* this is the meta_key you want to filter on */ 'key' => 'favorite_count', /* You need to get all values that are >= to 1 */ 'value' => 1, 'type' => 'numeric', 'compare' => '>=' ), ); $query_string = empty( $args ) ? $query_string : $args; } return apply_filters( 'bp_plugin_activity_querystring_filter', $query_string, $object ); } /** * Ninja Warrior trick to reorder the Activity Loop * regarding the activities favorite count * * @param string $sql the sql query that will be run * @param string $select_sql the select part of the query * @param string $from_sql the from part of the query * @param string $where_sql the where part of the query * @param string $sort the sort order (leaving it to DESC will be helpful!) * @param string $pag_sql the offset part of the query * @return string $sql the current or edited query */ public function order_by_most_favorited( $sql = '', $select_sql = '', $from_sql = '', $where_sql = '', $sort = '', $pag_sql = '' ) { if ( apply_filters( 'bp_use_legacy_activity_query', false ) ) { preg_match( '/\'favorite_count\' AND CAST\((.*) AS/', $where_sql, $match ); if ( ! empty( $match[1] ) ) { $new_order_by = 'ORDER BY '. $match[1] .' + 0'; $new_select_sql = $select_sql . ', '. $match[1] .' AS favorite_count'; $sql = str_replace( array( $select_sql, 'ORDER BY a.date_recorded' ), array( $new_select_sql, $new_order_by ), $sql ); } // $select_sql is carrying the requested argument since BuddyPress 2.0.0 } else { $r = $select_sql; if ( empty( $r['meta_query'] ) || ! is_array( $r['meta_query'] ) ) { return $sql; } else { $meta_query_keys = wp_list_pluck( $r['meta_query'], 'key' ); if ( ! in_array( 'favorite_count', $meta_query_keys ) ) { return $sql; } preg_match( '/\'favorite_count\' AND CAST\((.*) AS/', $sql, $match ); if ( ! empty( $match[1] ) ) { $sql = str_replace( 'ORDER BY a.date_recorded', 'ORDER BY '. $match[1] .' + 0', $sql ); } } } return $sql; } /** * Cannot pass the favorite data for now so just fool heartbeat activities */ public function maybe_fool_heartbeat( $r = array() ) { if ( empty( $r['meta_query'] ) ) { return $r; } $meta_query_keys = wp_list_pluck( $r['meta_query'], 'key' ); if ( ! in_array( 'favorite_count', $meta_query_keys ) ) { return $r; } else { $r['since'] = '3000-12-31 00:00:00'; } return $r; } } // 1, 2, 3 go ! function bp_loop_filters() { return new BP_Loop_Filters(); } add_action( 'bp_include', 'bp_loop_filters' );September 22, 2016 at 10:41 pm #259043In reply to: Adding external links within members pages
danbp
ParticipantHi,
To get the link to a user profile:
$link = bp_get_loggedin_user_link();Many use examples can be found on the forum. Ie:
Is it possible to make Activity and Forum profile tabs private?
September 22, 2016 at 5:21 pm #259033In reply to: Order by custom field in member loop
ositive
ParticipantThank you Shanebp
I tried the following steps (below is the final code):
-I started from the basic random code
-I introduced the function to create and pass #sql (like Ninja Warrior trick code)
but it seems not working.. Can you help me please (I’m really trying everithing..)?
Thanks<?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; class BP_Loop_Filters { public function __construct() { $this->setup_actions(); } private function setup_actions() { /** * Adds the Rating order to the select boxes of the Members directory pages */ // Members component is core, so it will be available add_action( 'bp_members_directory_order_options', array( $this, 'rating_order' ) ); } public function rating_order() { global $wpdb; $sql = "SELECT a.ID as id, a.user_nicename AS name, a.display_name AS displayname, AVG(star) AS rating, COUNT(star) AS reviews FROM {$wpdb->prefix}users AS a LEFT JOIN {$wpdb->prefix}bp_activity AS b ON a.ID = b.usercheck WHERE (b.is_activated is null or b.is_activated=1) GROUP BY id ORDER BY rating DESC"; var_dump( $sql ); return $sql; } } function bp_loop_filters() { return new BP_Loop_Filters(); } add_action( 'bp_include', 'bp_loop_filters' );September 22, 2016 at 4:41 pm #259030In reply to: [Resolved] bp_messages_subject_value
bdollin
ParticipantThanks but I should be more specific. I want to show a default subject field in a private message that the user is composing. I want to avoid changing the core compose.php and use an add_filter instead if possible
http://mywebsite.com/profiles/username/messages/compose/?r=recipientname&_wpnonce=a4a33412e1
It would be easy if we could add something like subject=”message’ but not possible
September 19, 2016 at 5:37 pm #258920Brajesh Singh
ParticipantPlease put this code in your bp-custom.php
function buddydev_hide_members_directory_from_all_except_admin() { if ( bp_is_members_directory() && ! is_super_admin() ) { //should we add a message too? //bp_core_add_message( 'Private page.', 'error' ); bp_core_redirect( site_url('/') ); } } add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_from_all_except_admin' );That should do it. Hoe it helps.
September 18, 2016 at 8:29 pm #258900danbp
ParticipantHere “the best guarded secret” finally revealed !
But it’s not a secret, is part of Codex and a multi handled topic subject on this forum.What we want to do: remove access possibility.
Where: on BuddyBar navigation menu (the one below the profile header).
Specifics: make the activity and forum tabs only visible to the logged in user.NOTE: The activity tab is shown by default when you visit a profile.
As we are going to hide/remove this tab to visitors, we need to define as first another default tab. If we won’t do that, the visitor will get a Page not found error. Which is not exactly the case here, the page exist but the visitor can’t access it.
Let’s define arbitrary Profile as the new default tab. You can of course define what ever other existing tab on your BuddyBar as default.
Add this line to bp-custom.php
define( 'BP_DEFAULT_COMPONENT','profile' );Now the mega “open secret” !
The folowing snippet contains almost any BP menu items you can have on a BuddyBar, and includes also the Forum item, in case you use bbPress.
You can remove or comment out those you don’t want to use.
Note also that it is only an example – you have to play with it to fit your need. But at least you have the right syntax to use.
Note also that some profile menu items are user only, such as message or notice. In other words, these are always private.This function goes preferably to bp-custom.php
function bpfr_hide_tabs() { global $bp; /** * class_exists() & bp_is_active are recommanded to avoid problems during updates * or when Component is deactivated */ if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) : /** here we fix the conditions. * Are we on a profile page ? | is user site admin ? | is user logged in ? */ if ( bp_is_user() && !is_super_admin() && !is_user_logged_in() ) { /* and here we remove our stuff ! */ bp_core_remove_nav_item( 'activity' ); bp_core_remove_nav_item( 'friends' ); bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); } endif; } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );Some other hints for privacy
if you want to allow only the profile owner to view some tabs, replace
!is_user_logged_inby!bp_is_my_profile()– this scenario doesn’t need a check for logged in users as it is made bybp_is_my_profile.If you want only to make a profile private, read here.
If you want to remove a sub-nav item (ie. View on Profile), you use something like:
bp_core_remove_subnav_item( 'profile', 'view' );Many other possibilities for navigation are also available, including for groups. Several examples are given on Codex, here.
And if not enough, RTFM and search the forum ! 🙂
Have fun !
September 15, 2016 at 4:07 pm #258761In reply to: Error 404 for non logged in users
tizianopitisci
ParticipantI would like to have on my website the same solution of buddydev.com. See this examples please:
BUDDYPRESS: https://buddypress.org/members/tizianopitisci/notifications/
BUDDYDEV: https://buddydev.com/members/tizianopitisci/notifications/In buddydev users:
1. Recive a notification by email with a link inside;
2. Follow the link;
3. Make the log-in;
4. Access the private areaI wuold like to have the same solution. Do you think is possible?
Thanks for your help
TizianoSeptember 15, 2016 at 9:07 am #258742In reply to: Error 404 for non logged in users
tizianopitisci
ParticipantThank you Henry, I’ve just made the following test:
-no plugin exept Buddypress
-defauolt wordpress theme “twenty fifteen”but we still have the issue. The point is that the message private as well as the notification area return a “not found page” message instead a “log-in required” message. I’m running the last buddypress version (italian located website).
Is that a bug?
September 12, 2016 at 4:07 pm #258659In reply to: Error 404 when joining a private group
jaumearagay
ParticipantIt’s a PRIVATE group I talk about, not a HIDDEN one. My fault! 😉
September 12, 2016 at 9:47 am #258653In reply to: Error 404 when joining a private group
jaumearagay
ParticipantHas anyboby tried this, please?
Can you join a private group either being an admin or not?
Is this a bug or is this something that affects only my install?Thanks for your time! 😉
-
AuthorSearch Results