Forum Replies Created
-
Try
<?php echo bp_core_get_username( bp_displayed_user_id() ); ?>In reply to: [Resolved] What Anti-Spam Should I use?Akismet is great and is free if you’re using your website for non-commercial purposes.
@kookidooki glad you found a tutorial!
In reply to: Super Admin Reading User MessagesHi @dmike88
Try logging in as super-admin and go to
example.com/members/username/messagesand see if you can readusername‘s messages.Hi @kookidooki
Do you mean merge databases or just merge files?
In reply to: Profile contact formHi @kypto
Are you using a contact form plugin? You’ll need one because contact form functionality doesn’t come in WordPress or BuddyPress core.
To add a member’s name and email to the form data is easy (ish) but you’ll need a contact form in place first.
In reply to: [Resolved] Remove RSS Feeds@ubernaut perhaps there’s a privacy concern if their site is a closed community? I’ve also heard how some people choose to disable RSS feeds because it is an easy way for sites to scrape their content.
In reply to: [Resolved] Show Username next to Display NameBTW Iām not using a theme with Buddypress support
That’s not a problem because since BP 1.7 you can create your own very easily. Check out this article on the BP Template Hierarchy for info on how templates work. If you have any questions or come across any problems then I suggest you open a separate topic for each different issue.
In reply to: Register Page redirects to wp-admin pageLast time we checked, Canvas was not compatible with BuddyPress
@mercime that explains these redirection problems š
In reply to: How to make a custom add friend link in buddypressHi @jaybee08
Building the link isn’t straightforward because there are a number of cases to consider. To take all of the conditions into account it is necessary to use a switch statement like this:
$is_friend = bp_is_friend( $potential_friend_id ); if ( empty( $is_friend ) ) return false; switch ( $is_friend ) { case 'pending' : $link = wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $potential_friend_id . '/', 'friends_withdraw_friendship' ); break; case 'awaiting_response' : $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/'; break; case 'is_friend' : $link = wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ); break; default: $link = wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ); break; } echo $link;Note: You will need to provide the value of
$potential_friend_idyourself. For example, if you know the ID of the potential friend is8then do this at the very top of that code:$potential_friend_id = 8;Alternatively,
bp_displayed_user_id()will get the ID of the currently displayed member.In reply to: Buddypress Profile : My GamesHi @bumbummen99
I’m not aware of a plugin that will do this for you. To add a new subnav item manually, check out
bp_core_new_subnav_item()In reply to: Register Page redirects to wp-admin pageThat’s a premium theme so unfortunately I don’t have access to the code. Try searching the theme’s code for
wp_redirectorbp_core_redirect– the aim is to find out where the redirect to wp-admin.php is happening and then remove it. To my knowledge, this isn’t something that BuddyPress core does, so the issue is likely to be either plugin or theme related (most likely your theme).In reply to: [Resolved] Show Username next to Display NameHi @packjazz
I don’t think a filter is appropriate in this case. Editing the templates is the best approach in my opinion.
bp_displayed_user_username()will display the displayed member’s username andbp_displayed_user_fullname()will output the displayed member’s display name.In reply to: Register Page redirects to wp-admin pageHi @canadadre
Which theme are you using?
Try:
bloginfo( 'name' );Ref: https://codex.wordpress.org/Function_Reference/bloginfo
In reply to: Pinterest-style Activity FeedIf you take a look at the docs on the Masonry website you’ll see that you can do something like this with jQuery
<script> jQuery('#container').masonry({ columnWidth: 200, itemSelector: '.item' }); </script>#containerand.itemare used in the example but in BuddyPress they will be something like#membersand.member. For example your BuddyPress page source code might look like this<div id="members"> <!-- this is the #container --> <div class="member"> <!-- this is the .item --> <!-- various stuff happens here for a particular member --> </div> <div class="member"> <!-- this is the .item --> <!-- various stuff happens here for a particular member --> </div> <div class="member"> <!-- this is the .item --> <!-- various stuff happens here for a particular member --> </div> </div>Note I’ve made up these selectors, they will be something different so check your BP templates.
In reply to: Pinterest-style Activity FeedUsing Masonry with the BP activity feed would be possible. It’s a loop of data just like a loop of blog posts. You might need to change some of the default selectors to match the BuddyPress markup but aside from that I see no problems.
In reply to: 'Change Avatar' ButtonA dirty way of removing it is to hide it via CSS.
.change-avatar-button { display: none; }I’m not sure what selector to use (you’ll need to replace
.change-avatar-buttonwith the classname or ID of the button).In reply to: How do I move profile subnavs to Settings subnav@lflier couldn’t do any better than this if I tried. It all looks good to me š
In reply to: How do I move profile subnavs to Settings subnavTake a look at this example screen function from the BP Skeleton Component:
Instead of trying to re-use the
xprofile_screen_change_avatar, perhaps try creating your own using this as a guide. Boone Gorges looks after the BP Skeleton Component, so the techniques used within it are good practice and provide lots of useful comments on how to get things done.In reply to: How do I move profile subnavs to Settings subnavCan you try making a copy of
xprofile_screen_change_avatarin functions.php and renaming it tocustom_xprofile_screen_change_avatarThen try:
'screen_function' => 'custom_xprofile_screen_change_avatar',In reply to: How do I move profile subnavs to Settings subnavIn your
setup_custom_navfunction, instead of:'screen_function' => 'lf_screen_function',Maybe you can do this:
'screen_function' => 'xprofile_screen_change_avatar',And you won’t need your
lf_screen_function()function.I haven’t tested this, but don’t see why doing that isn’t possible.
In reply to: How do I move profile subnavs to Settings subnav@lflier that sounds like a good approach. The screen function will be already written for you and as you say, creating the new subnav and removing the unwanted one is easy enough.
In reply to: How do I move profile subnavs to Settings subnavHi @josephfrio13yahoocom and @lflier
Component navigation is set-up in the component’s class. For example, the
setup_navmethod within theBP_Friends_Componentclass does this for the Friends component. See here for exactly how it’s done.To my knowledge, there is no easy way to move subnavs around.
In reply to: Accordion-style messagesHi @peipooh
You’ll need to use CSS or JavaScript to create the accordion effect. You could write that yourself or you could take the easier route and use a framework such as Bootstrap. Their collapse.js plugin is what you’d need to use.