Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Private Pages Glitch?

@burger0815

Participant

Hello Brajesh Singh and Engine44

I am a newcomer to buddypress and I think I had similar problems as Engine44.
Frankly I could imagine that there are more people who have this
problem but eventually don’t even realize it as a problem.
In particular I can’t imagine that all that bp networks which
are used by schools want to have kids discuss in public. So it might
be a severe problem. But as said I am a newcomer so I might easily be
wrong.

The following concerns mostly the member and activity pages (I hope they are called
this way, this is a direct translation from german), which are either set
public -or if set private can’t be found anymore (which seems to kill more or less all major bp functions, like you can’t see profile etc.) I haven’t looked into groups yet.

I asked a person for help who is pretty proficient in solving general programming
problems but who is not a programmer and in particular not a PHP programmer. So eat with
utmost caution.

He came up with the following hack:
The activity and member pages need to be public in order to assign them
on the bp page. (I think this is the default upon installation)
Then set the pages to private.

go to buddypress/bp-core/bp-core-functions.php
and then in function bp_core_get_directory_pages() {…

change

$page_names = $wpdb->get_results( „SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_statues = ‘publish’ ” );

into

// temporary hack
if ( is_user_logged_in() ) {
$page_names = $wpdb->get_results( “SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) ” );
} else {
$page_names = $wpdb->get_results( “SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_statues = ‘publish’ ” );
}
// was:
// $page_names = $wpdb->get_results( “SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_statues = ‘publish’ ” );
// /temporary hack

Skip to toolbar