Search Results for 'custom activity page'
-
Search Results
-
Hi, I am trying to add a custom nav link titled “sub-members” to buddypress profiles that shows a list of members who inherit membership to my client’s services through the parent member. I have successfully added the custom nav link to the profile by inserting some code into bp-custom.php and I have successfully called the contents of a members loop template into the page (I will add filtering for the members loop after initial functionality is in place.)
Here is my code below:
<?php function add_communications_tabs() { global $bp; if (xprofile_get_field_data('Sub-Members') == "Yes") : bp_core_new_nav_item( array( 'name' => 'Sub-Members', 'slug' => 'submembers', 'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug, 'screen_function' => 'submembers_screen', 'position' => 100, 'default_subnav_slug' => 'submembers' ) ); endif; } add_action( 'bp_setup_nav', 'add_communications_tabs', 100 ); function submembers_screen() { add_action( 'bp_template_content', 'submembers_screen_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function submembers_screen_title() { echo $_POST[bp_displayed_user_id()]; echo 'Sub-members of '.bp_get_displayed_user_fullname().'<br/>'; } function submembers_screen_content() { get_template_part( '\buddypress\members\members', 'loop' ); } ?>Here is my problem:
Pagination and any other function using ajax seems to break when the members loop is placed here.
It seems that while ajax work fine for the members loop when placed on a normal page outside the profile–and I should also mention ajax works fine for built-in Buddypress profile functions like activity stream posting–the same cannot be said for my members loop or any other content I test on the custom-made ‘sub-members’ page that requires ajax functionality. For instance, when I try to click on a link within the pagination on the member loop within the ‘sub-members’ page, the link is correct (loads the next page in the loop if it were to be opened in a new tab), but nothing happens when it is clicked.
Steps I tried to pinpoint the issue:
– Disabled all plugins besides Buddypress for potential conflicts
– Inserted other ajax content independent of Buddypress onto the ‘sub-members’ page (this content failed too)
– Tested the Members Loop within existing profile page templates to see if it had to do with inserting it onto a custom Buddypress page (loaded it on the “Activity” page and the ajax didn’t work for this either)
– Tried to enqueue ajax.php and other relevant scripts despite the fact that in the <head> section, it seems they are being called correctly and working for other built-in ajax calls.I have spent many hours trying to figure this out and I would greatly appreciate any help as I am truly stumped and not very knowledgeable about ajax. Thank you
Hi everyone. I would like to know if you can give access to the page (admin) bp-activity with the list of all activities, to a specific user role.
My customers in the future need to see the whole list of activities from the wordpress back-end.Topic: Login Issues
Wordpress 4.8.3, BuddyPress 2.9.2, self hosted on an Apache (shared) server.
I really want this to work but I install WP and BP without errors. I set ‘activity’ as a static front page. I test the site (there are no other users) and all looks OK.
I logout. I login. The page still appears to be logged out. The page doesn’t refresh to the ‘activity’ page with me as logged in.
I have tried with themes twentyfifteen, sixteen and seventeen.
I’ve searched the entire internet for a solution, not just here, and many people suggest redirect plugins. I’ve tried a few but it doesn’t work for me.
Some solutions suggest bp_custom code. I tried and it didn’t work.
The only solution I sort of found for myself was to place a “who’s online” widget on the page. After I login (and appear logged out) I click the link in the widget to my profile page. Then I can return to the home page and see I am logged in, BUT even that sometimes fails.
Please, someone, tell me what causes this incorrect login issue and how to finally resolve it.
Thank you in advance for any help given on this…
The aim…
- What we’d like is to add a new top level tab (such as Activity, Profile & Notifications) entitled “Add content”.
- The “Add content” tab should have the following sub-navigation sections… “Create article”, “Create event”, “Create vacancy” & “Create Service Listing”.
- Each of the tabs above should only be visible to the logged in user on their own profile.
We’ll be including front-end publishing forms in each tab.
Let’s be honest…
If you feel that this would cause any issues, be too much hassle or just wouldn’t work, please feel free to tell me straight as there is an alternative method I can use (Creating specific pages requiring login etc).Hi,
I have this code below for one custom post type to be shown in the activity feed. All works fine, but how can i use this also for an extra CTP?I tried adding an extra line
add_post_type_support( 'listing_2', 'buddypress-activity' );
But that is not working. Also i rather have different tracking_args for the different custom post types.Anyone? Thanks!
<?php //Listing activity support function customize_page_tracking_args_listing() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } // Don't forget to add the 'buddypress-activity' support! add_post_type_support( 'listing', 'buddypress-activity' ); /** * Also don't forget to allow comments from the WordPress Edit Page screen * see this screencap https://cldup.com/nsl4TxBV_j.png */ bp_activity_set_post_type_tracking_args( 'listing', array( 'action_id' => 'new_listing', 'bp_activity_admin_filter' => __( 'Vermelding toegevoegd', 'custom-textdomain' ), 'bp_activity_front_filter' => __( 'Vermelding', 'custom-textdomain' ), 'bp_activity_new_post' => __( '%1$s heeft een nieuwe vermelding genaamd <a href="%2$s">[vermelding]</a> toegevoegd', 'custom-textdomain' ), 'contexts' => array( 'activity', 'member' ), 'comment_action_id' => 'new_listing_comment', 'bp_activity_comments_admin_filter' => __( 'Reageerde op vermelding', 'custom-textdomain' ), 'bp_activity_comments_front_filter' => __( 'Reacties op vermelding', 'custom-textdomain' ), 'bp_activity_new_comment' => __( '%1$s reageerde op <a href="%2$s">een vermelding</a>', 'custom-textdomain' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args_listing', 1000 ); function new_listing_include_post_type_title( $action, $activity ) { if ( empty( $activity->id ) ) { return $action; } if ( 'new_listing' != $activity->type ) { return $action; } preg_match_all( '/<a.*?>([^>]*)<\/a>/', $action, $matches ); if ( empty( $matches[1][1] ) || '[vermelding]' != $matches[1][1] ) { return $action; } $post_type_title = bp_activity_get_meta( $activity->id, 'post_title' ); if ( empty( $post_type_title ) ) { switch_to_blog( $activity->item_id ); $post_type_title = get_post_field( 'post_title', $activity->secondary_item_id ); // We have a title save it in activity meta to avoid switching blogs too much if ( ! empty( $post_type_title ) ) { bp_activity_update_meta( $activity->id, 'post_title', $post_type_title ); } restore_current_blog(); } return str_replace( $matches[1][1], esc_html( $post_type_title ), $action ); } add_filter( 'bp_activity_custom_post_type_post_action', 'new_listing_include_post_type_title', 10, 2 );Hi,
So i have this script in my /plugins/bp-custom.php file (see below). I was wondering if it is possible to exclude new posts, from posting them on the activity wall, for a certain category. So that (i.e.) new posts that are posted in category_id 2 are not posted on the wall.Any ideas on this?
Here is my script:<?php //Listing activity support function customize_page_tracking_args_listing() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } // Don't forget to add the 'buddypress-activity' support! add_post_type_support( 'listing', 'buddypress-activity' ); /** * Also don't forget to allow comments from the WordPress Edit Page screen * see this screencap https://cldup.com/nsl4TxBV_j.png */ bp_activity_set_post_type_tracking_args( 'listing', array( 'action_id' => 'new_listing', 'bp_activity_admin_filter' => __( 'Post added', 'custom-textdomain' ), 'bp_activity_front_filter' => __( 'Post', 'custom-textdomain' ), 'bp_activity_new_post' => __( '%1$s added a new post called <a href="%2$s">[post]</a>', 'custom-textdomain' ), 'contexts' => array( 'activity', 'member' ), 'comment_action_id' => 'new_listing_comment', 'bp_activity_comments_admin_filter' => __( 'Commented on', 'custom-textdomain' ), 'bp_activity_comments_front_filter' => __( 'Comments on post', 'custom-textdomain' ), 'bp_activity_new_comment' => __( '%1$s commented on <a href="%2$s">a post</a>', 'custom-textdomain' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args_listing', 1000 ); function new_listing_include_post_type_title( $action, $activity ) { if ( empty( $activity->id ) ) { return $action; } if ( 'new_listing' != $activity->type ) { return $action; } preg_match_all( '/<a.*?>([^>]*)<\/a>/', $action, $matches ); if ( empty( $matches[1][1] ) || '[post]' != $matches[1][1] ) { return $action; } $post_type_title = bp_activity_get_meta( $activity->id, 'post_title' ); if ( empty( $post_type_title ) ) { switch_to_blog( $activity->item_id ); $post_type_title = get_post_field( 'post_title', $activity->secondary_item_id ); // We have a title save it in activity meta to avoid switching blogs too much if ( ! empty( $post_type_title ) ) { bp_activity_update_meta( $activity->id, 'post_title', $post_type_title ); } restore_current_blog(); } return str_replace( $matches[1][1], esc_html( $post_type_title ), $action ); } add_filter( 'bp_activity_custom_post_type_post_action', 'new_listing_include_post_type_title', 10, 2 );Hi, I’m trying to create a custom profile page using visual composer with aditional forms and categories. I’ll like to add the whole buddypress profile page header into a page (cover image, profile picture and buttons: activity, profiles, messages). I found some shortcodes but it only shows parts of the profile.
Hello,
First of all here is my config:
Server vps ssd 8GB ram 3×3.7 ghz apache
Wordpress 4.8.1
Theme Responsive free 2.9Plugins :
Wp rocket cache
Buddypress 2.9
Admin custom login
Advanced ads pro
Responsive menu pro
Ban Hammer
Bp profile search
Buddypress activity shortcode
Buddypress like
Wp foro
Google analytics dashboard
Iq block country
Newsletter
Plugin business directory
Redirection
Secupress
Social Plug
Strong testimonials
Table of content plus
Wordpress database backup
Wp asset cleanup
Wp excerpt generator
Wp testing
Yoast seoDatabase SQL manage on phpmyadmin; modify :
max connection = 502
timeout = 69
table open cache = 71144
max heap table size = 3G
tmp table size = 3G
allowed pack 1 000 000
open files limit = 150 000
myisam_sort_buffer_size = 72M
read_rnd_buffer_size = 24M
join_buffer_size = 32M
query_prealloc_size = 65K
query_alloc_block_size = 128K
table_definition_cache = 71144
thread_stack = 512K
thread_concurrency = 28
read_buffer_size = 36M
query cache min res unit = 512
bulk insert buffer size = 72M
thread_cache_size = 16K
query_cache_limit = 512M
innodb_buffer_pool_size = 3G
query_cache_size= 512M
innodb_log_buffer_size = 32M
sort_buffer_size = 192M
innodb_read_io_threads = 12
innodb_write_io_threads = 12?
innodb_open_files = 1200Members on my buddypress : 1300
monthly visitors : 100 000
monthly pages views : 200 000For several months now, I have activities that disappear completely from my database !!! I checked all the plugins, in case there was a conflict, but everything is ok. So I changed the table type from my MYISAM database to INNODB, but that still has not solved the problem. Same, I have changed many times some sql varibals in phpmyadmin, but nothing works. I also tried the data recovery via the buddypress dashboard, but it does not help! Activities disappear when some members are very active. Bizarre ??? !! So, if people have the solution to my problem, thank you for telling me what to change. Thank you !
Hello there, I have been trying and researching about this for over a week and haven’t been able to figure it out. Any help is much appreciated.
So here is the problem: Any changes that I make to the template files are not mirrored on the site.
What have I have already tried? I hope I have done all the basics correctly.
1. I have a child theme.
2. I have copied the files from: plugins/buddypress/bp-templates/bp-legacy/buddypress… into my child theme. (so my file structure looks like childtheme/buddypress/members/….(everything inside).
3. I am able to style the profile pages using CSS (I add them in my child theme stylesheet.css)What I am not able to do: Any changes I make to the template files are not visible on the website. Let me give an example.
Say I wanted to remove my name (@ajitjohnson) from the profile page.
I locate the header php file, so that is now located at childtheme/buddypress/members/single/member-header.php
Now I remove the following lines,
<?php if ( bp_is_active( ‘activity’ ) && bp_activity_do_mentions() ) : ?>
<h2 class=”user-nicename”>@<?php bp_displayed_user_mentionname(); ?></h2>
<?php endif; ?>I would imagine it should remove my name from the profile page but it doesn’t. May be something else is overriding it?
I have also tried editing the core template files without adding them to the child theme. It still doesn’t work.
Please help. Thank you.
Ps: WordPress version 4.8.1, buddypress version: 2.9, theme: _tk (basic bootstrap theme that I have customised)
Hi,
I want to change the user profile url for the activity stream, so that these are linked to a custom profile page. Ive found the link below, but in my case this only edits the link of the user avatar and not of the in-text link in the activity stream like: %avatar% “user_x just signed up”. Now the %avatar% is linked to the custom profile page but the user_x is still linked to the BP profile page.. How to fix this?function imborx_profile_link( $link ) { global $activities_template; if( $link != bp_loggedin_user_domain() ) $link = esc_url( get_author_posts_url( $activities_template->activity->user_id ) ); return $link; } add_filter( 'bp_get_activity_user_link', 'imborx_profile_link', 15, 1 );Hi, I am struggling to get a profile page as it shows 404 error. Also notification and other profile related pages show 404 error. Have deactivated all plugins to test if any code conflict but that also didn’t resolve the issue.
Links to pages:Profile page
Activity:profile activity
Notification:notificationAll other pages related to profile that showup on right corner when the member is signed in show 404 error.
wordpress version:4.8
Buddypress version:2.8.2
Also have installed bbpress:2.5.12
Wordpress Theme: customizr child themePlease help and thanks in advance.
Hello, I have been using buddyPress Version 2.7.4. After updating to version 2.8.2, I get this error Fatal error: Call to undefined function bp_is_front_page() in ……/wp-content/plugins/bp-custom.php on line 17 here is my code in the bp-custom.php `<?php
// hacks and mods will go here
/* Redirects to profile upon login */
add_action(‘login_form’, ‘redirect_after_login’);
function redirect_after_login()
{
global $redirect_to;
if (!isset($_GET[‘redirect_to’]))
{
$redirect_to = get_option(‘activity’);
// sample-page = your page name after site_url
} }function bp_help_redirect_to_profile(){
global $bp;if( is_user_logged_in() && bp_is_front_page() )
bp_core_redirect( get_option(‘home’) . ‘/members/’ . bp_core_get_username( bp_loggedin_user_id() ) . ‘/activity’ );}
add_action( ‘get_header’, ‘bp_help_redirect_to_profile’,1);
add_action(‘wp_logout’,’go_home’);
function go_home(){
wp_redirect( home_url() );
exit();
}add_action( ‘bp_complete_signup’, ‘buddydev_redirect_after_signup’ );
function buddydev_redirect_after_signup() {
$page = wp_redirect( get_option(‘siteurl’) . ‘/profile’ );
bp_core_redirect( site_url( $page ) );
}?>` Help me what has happened and how can I correct this Error?
Hi,
I have a social networking site that is intended for subscribers to share only with his/her friends. Therefore, I would like to remove the options for them to be able to select where they want to post their activity. I would like to remove all options for where to post activity updates and I would like it to always post to the friends feed. Also, I would like it to post to the activity page if they are in the activity page and to post to whatever group they are in when they do a post from that page.
Is this something that I would accomplish by removing lines of code from files, by adding custom CSS, or by adding a function in the functions.php file?
Website: http://www.tacklebox.fish
WP Version: 4.7.5
BP Version: 2.8.2
Theme: Buddy (themeforest)Please let me know if these is anything I can do to accomplish this.
Thanks in Advance!
BuddyHello everyone,
Currently im using Bp Portfolio plugin and on my activity stream, when subscribers update on their latest portfolio didn’t show up on the stream. (Only for admin role it works fine)
So, i added custom post type for the portfolio on custom.php, here are the code:
add_post_type_support( ‘bb_project’, ‘buddypress-activity’ ); function customize_page_tracking_args() {
// Check if the Activity component is active before using it.
if ( ! bp_is_active( ‘activity’ ) ) { return; }bp_activity_set_post_type_tracking_args(
‘page’, array( ‘action_id’ => ‘new_blog_page’,
‘bp_activity_admin_filter’ => __( ‘Published a new page’, ‘boss’ ),
‘bp_activity_front_filter’ => __( ‘Pages’, ‘boss’ ),
‘contexts’ => array( ‘activity’, ‘member’ ), ‘activity_comment’ => true,
‘bp_activity_new_post’ => __( ‘%1$s posted a new page‘, ‘boss’ ), ‘bp_activity_new_post_ms’ => __( ‘%1$s posted a new page, on the site %3$s’, ‘boss’ ), ‘position’ => 100, ) ); }add_action( ‘bp_init’, ‘customize_page_tracking_args’ );
It works however it didn’t display the featured image for the portfolio. Maybe im missing some code here plus im not really good at php.
Is there any help for me to fix this?
Really this makes no sense to me.
I created a custom template for a page im working on and copied over the change.avatars.php to the custom page..
Should work in theory, at least I thought.But the upload or crop didnt work.
The dotted box wasn’t even there.So I ended up creating a index-action-change-avatar.php file and placed it in the BuddyPress/members/single directory and copied the change.avatars.php code over.
And also added general-after-wrap and general-before-wrap to the file.Then back to my custom.php template file I added
<meta http-equiv="refresh" content="0; url=<?php echo bp_loggedin_user_domain();?>profile/change-avatar/" />So now my custom page template looks like this before it gets redirected.

Then after the redirect the page looks like this.

I wanted my custom page to look like the 2nd pic.
Now if I remove the index-action-change-avatar.php file it would just redirect me to the normal user profile page to upload the Avatar.
But I didn’t want that for this custom page I am doing.So now that I added the index-action-change-avatar.php file it will just override the default change-avatar.php as its expected to do but unfortunately that means when a user clicks on his profile settings and selects upload avatar it would direct them to the index-action-change-avatar.php file that has some changed settings I’ve added.
This is what I was trying to do.
Step 1-user registers on homepage.
Step 2-user is redirected to the check email for activation page.
Step 3-user clicks activation link within their email.
Step 4-user is redirected to my custom page notifying account is activated.Now on step 4 I was going to add the option to upload their avatar or just continue.
Now what I could do is just add a href link that would redirect them to their profile to upload but it would defeat the purpose of what I was aiming for.
Another option i might just do is after activation have them auto logged in and redirected to the activity page then from there I’ll add a tour of the website.
I’ve been having an issue with my activity feed where the first activity’s time since permalink comes back as site.com/activity/p/321 even when it is a blog post activity or custom post type activity. As soon as it becomes the second item in the loop, it goes back to normal permalink where it comes back as the site.com/?p=123 or site.com/2017/04/post-name/comment-page-1#comment-123.
Does this sound familiar.
I am running BP on the primary site of a Multisite installation.
Hey all I’m attempting to modify the content returned by BuddyPress’ default ‘@’ mention notification. I’m using this as part of a custom profile page and would like to modify the “username mentioned you’ text to something more personalized based on post type.
// Change mention output function format_mention_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string', $component_action, $component_name, $notification_id) { if ( $component_action === 'new_at_mention') { // User mentioned notification $mentioned_source_type = get_post_type($item_id); $username = wl_get_username($secondary_item_id); $mention_avatar = wl_get_avatar($secondary_item_id); $mention_title = ''; $mention_text = $username; if ($mentioned_source_type == 'topic') { $mention_title = bbp_get_topic_title( $item_id ); $mention_text .= ' mentioned you in the forum post '; $mention_source_link = ''; // link to topic } else if ($mentioned_source_type == 'reply') { $parent_topic_id = bbp_get_reply_topic_id( $item_id ); $mention_title = bbp_get_topic_title( $parent_topic_id ); $mention_text .= ' mentioned you in their response to the forum post '; $mention_source_link = bbp_get_reply_url( $item_id ); // link to reply } else if ($mentioned_source_type == 'comment') { $comment = get_comment($item_id); $mention_text .= ' mentioned you in their comment'; $mention_source_link = get_comment_link($comment); } else { $mention_avatar = ''; $mention_title = get_the_title($item_id); $mention_text = 'You were mentioned in '; $mention_source_link = get_permalink($item_id); } $mention_source_link = wp_nonce_url( add_query_arg( array( 'action' => 'read', 'notification_id' => $notification_id), $mention_source_link ), 'bp_notification_mark_read_' . $notification_id); // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'bp_activity_single_at_mentions_notification', '<a href="' . esc_url( $mention_source_link ) . '" title="New mention">'. $mention_avatar . esc_html( $mention_text ) . '<span class="activity-title">'.$mention_title.'</span></a>', (int) $total_items, $mention_text, $mention_source_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'bp_activity_single_at_mentions_notification', array( 'text' => $mention_text . $mention_title, 'link' => $mention_source_link ), $mention_source_link, (int) $total_items, $mention_text, $mention_title ); } } return $return; } add_filter( 'bp_notifications_get_notifications_for_user', 'format_mention_notifications', 100, 8 );What I’ve tried so far:
– Changing the priority of the filter
– Moving my logic into theactivity_format_notificationsaction with various different priorities
– All of the above in a custom plugin file, bp-custom.php, and my themes’ function.php fileI’ve used a similar filter for custom notifications and that aspect works great. I just can’t seem to override the default content with my own. My thoughts are that the the filters/actions run too late to be noticed by BuddyPress.
Many thanks for your help.
I am using visual composer for all my pages, but the buddypress pages are empty when i edit them and none of changes i make there shows up on said bp pages eg. members. Can i call a complete bubbypress page on to a new page ? with php maybe? or create a shortcode? Then i could still ad a heading above and style with vc custom css? i got activity feed to work like that with the help of 2 plugins. the other short code plugins do not give me the full bp page elements on my new page. Is there any way to do this? Help would be grately appreciated. Hope this makes sense. 🙂
Regards
LC