Forum Replies Created
-
In reply to: HIde BuddyPress and bbPress items from guests
I’m surprised that it works via add_filter.
The hook is a do_action.
And – You don’t need the global.
And – bp_is_page is deprecated.function bp_guest_redirect( $name ) { if( ! is_user_logged_in() ) { if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_directory() || bp_is_user() ) wp_redirect( get_option('siteurl') . '/wp-login.php/' ); } } add_action( 'get_header', 'bp_guest_redirect', 1, 1 );In reply to: allow search by usernameIf you are on the Members page, the search function already supports username.
What are you trying to do?
In reply to: Comment button stops working after refreshI ended up duplicating the site
Good, now you have a dev site.
Try turning off all plugins except BP and continue using the 2015 theme.
If the problem persists, then it might be a BP issue.
If not, turn the other plugins back on one at a time and hopefully find the plugin that is causing the issue.In reply to: FATAL ERROR: BuddyPress 2.2.3 – Security Release@i-am-anja – I apologize for the fact that you weren’t provided good info on how to access your dashboard.
You will need to use FTP or if your host provides a File Manager ( maybe thru cpanel ).
Then navigate to[your site]/wp-content/plugins/buddypressand either delete the buddypress folder or rename to something else, for example ‘buddypressX’.
Doing so means BP will not be loaded and you should be able to access your dashboard.In reply to: Comment button stops working after refreshI am using a custom theme, so it’s possible that is the problem,
Switch to a WP theme like 2013.
If the problem goes away, then it’s something in your theme.In reply to: Members loop doesn’t show new membersMembers won’t appear in the members loop until they have a last_activity entry.
Logging in will create that entry.
Or you can give them one as soon as a member is registered via front or back end:function webmister_add_last_activity( $user_id ) { bp_update_user_last_activity( $user_id, bp_core_current_time() ); } add_action ('user_register', 'webmister_add_last_activity', 20, 1);Put the function in your theme/functions.php or in bp-custom.php.
In reply to: Add a blog tab in profile pageI would like to have a list of posts with hyperlinks instead of displaying the whole content.
@alexterchum – his code kindly provides explicit instructions for doing exactly that.
Did you read them?
Here is what you need:foreach($myposts as $post) { setup_postdata( $post ); echo '<a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a><br/>'; }In reply to: Group Moderator broken?afaik, even site admins and groups admins cannot edit activity stream items on the front-end.
This will give group moderators the ability to delete activity stream items:function majecdad_group_mod_delete( $can_delete, $activity ) { if( $activity->component == 'groups' ) { $group_id = $activity->item_id; if( bp_current_user_can( 'bp_moderate' ) || groups_is_user_mod( bp_loggedin_user_id(), $group_id ) ) $can_delete = true; } return $can_delete; } add_filter('bp_activity_user_can_delete', 'majecdad_group_mod_delete', 21, 2 );Are you sure you’ve translated this label:
Friends <span class="%s">%s</span>Did you include this Sources Keyword when creating the translation .mo in poEdit:
_x()The Friends label is generated by
__()and_x(), depending on the context.More info re keywords: http://www.cssigniter.com/ignite/wordpress-poedit-translation-secrets/
In reply to: Bp register pageThe @ symbol is added in this file:
buddypress\bp-templates\bp-legacy\buddypress\members\single\member-header.phpCreate a template overload of that file and remove the symbol.
In reply to: Bp register pageIt would be helpful to your question to get some terminology sorted.
Example:
- username aka login name: jayd94
- display name: Daniel
In BP, your profile would show:
Daniel
@jayd94So the name on the BP ‘side’ of register = display name
And the name on the WP ‘side’ of register = username aka login name
Both fields are required.Using that info, can you restate your question.
Try using this hook from
function groups_delete_groupin buddypress\bp-groups\bp-groups-functions.phpdo_action( 'groups_before_delete_group', $group_id );In reply to: Customising members-loop paginationYour approach should be okay, but…
Since you only want member IDs, then only request IDs.
You can avoid retrieving user objects for each member and then having to extract their ID by doing this:function modify_members_loop( $qs=false, $object=false ) { if ( $object != 'members' ) return $qs; $subscribers = get_users( 'fields=ID&role=subscriber' ); $args['include'] = $subscribers; $qs = build_query($args); return $qs; } add_action( 'bp_ajax_querystring' , 'modify_members_loop', 25, 2 );In reply to: Unable to Edit ProfileSo when you go to your profile screen and click ‘Profile > Edit’ you get a blank screen?
Try to narrow down the potential issues.
What is the browser url on that screen? Do you see the site header?
What theme are you using?
Try switching to a WP theme, like TwentyThirteen.
Try deactivating your other ‘extensions’.
In reply to: wp_insert_comment and activity commentsPlease use the
codebutton when posting code.If I go into the admin panel and select Activities, I can see the same comment, but “View Activity” takes me to the activity panel, were I can see the parent activity and the post successfully.
As you can see, the url is being rewritten when you click on ‘view activity’.
You can either figure how the url is being rewritten.
Or create your own url using the fields from the comment object.
Something like:
$url = bp_core_get_userlink( comment[user_id] ) . '/activity/' . comment[comment_ID] . '/';In reply to: Unable to Edit Profilewhen I click on my profile in the groups setup
What do you mean by ‘groups setup’ ?
Re pagination:
It’s probably due to my code wiping out the query array and hardcoding page = 1There is most likely an easier / better way, but try storing the page in a var before the if( isset conditional:
$page = $query_args['page'];Then put it back into the array in the conditional:
$query_args['page'] = $page;In reply to: [Resolved] Activity stream – show personal activityThis is separate from the function I supplied.
Put it in activity/index.php
<li id="activity-just-me"> <a id="just-me" href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/'; ?>">Personal</a></li>You can also insert the link without using a template overload by using the provided hook:
do_action( 'bp_activity_type_tabs' );In reply to: wp_insert_comment and activity commentsHave you tried using
get_comment_link( $post_comment_id );?In reply to: Foursquare API >>> GroupsLocation data from the Foursquare API isn’t very useful unless you’re only dealing with Foursquare users. The data is way too centric.
Google Places API is easy to pull in.
Their documentation is very comprehensive.
Hook intowp_enqueue_scriptsand usewp_register_scriptandwp_print_scriptto pull it in.
Then call it in a template.
How to get, store and use the Location data is up to you.Where are you getting
bp_pre_group_queryfrom?
You can’t make up hooks :>
SeeBP_Groups_Group::getin buddypress\bp-groups\bp-groups-classes.php for more info.Try this:
function antares_groups_filter_options() { echo '<option value="user-league">User League</option>'; } add_action( 'bp_groups_directory_order_options', 'antares_groups_filter_options' ); function antares_ajax_querystring( $query_string, $object ) { if ( 'groups' != $object ) return $query_string; if ( ! bp_is_groups_directory() ) return $query_string; $query_args = wp_parse_args( $query_string, array() ); $page = $query_args['page']; if( isset( $query_args['action'] ) && $query_args['action'] == 'user-league' ) { $query_args = array(); $query_args['page'] = $page; $query_args['orderby'] = 'name'; $query_args['order'] = 'ASC'; $query_args['include'] = antares_get_groups(); $query_string = http_build_query( $query_args ); } return $query_string; } add_filter( 'bp_ajax_querystring', 'antares_ajax_querystring', 32, 2 ); function antares_get_groups() { // put your custom sql here // return a csv string of the groups ids // for example '1,22,57' }In reply to: Remove Email requirementUnless you’re specifically using the default theme, you only have to change this file:
\buddypress\bp-templates\bp-legacy\buddypress\members\register.phpAnd the recommended approach is to create a template overload in your theme:
This is probably theme related.
This is the default template:
\buddypress\bp-templates\bp-legacy\buddypress\groups\groups-loop.phpYou’re using a custom template.
Take a look at the code generating the links in your groups loop.
Or there may be a function in your theme that filtersbp_group_permalink()or permalinks in general.In reply to: Remove Email requirementThe email requirement is a WP requirement.
There are various code snippets and plugins to get around this requirement – whether creating users only thru the Dashboard or through open registration:
https://www.google.com/?gws_rd=ssl#q=wordpress+registration+email+optional
In reply to: [Resolved] Activity stream – show personal activityYou want to add a ‘Personal’ option to the ‘Show’ selector on Site Wide Activity?
Try this in your theme/functions.php or in bp-custom.php
function leanne_activity_filter_options() { if ( is_user_logged_in() ) echo '<option value="personal">Personal</option>'; } add_action( 'bp_activity_filter_options', 'leanne_activity_filter_options' ); function leanne_ajax_querystring( $query_string, $object ) { if ( 'activity' != $object ) return $query_string; if ( ! bp_is_activity_directory() ) return $query_string; $query_args = wp_parse_args( $query_string, array() ); $page = $query_args['page']; if( isset( $query_args['action'] ) && $query_args['action'] == 'personal' ) { $query_args = array(); $query_args['page'] = $page; $query_args['user_id'] = bp_loggedin_user_id(); $query_string = http_build_query( $query_args ); } return $query_string; } add_filter( 'bp_ajax_querystring', 'leanne_ajax_querystring', 20, 2 );