Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 176 through 200 (of 838 total)
  • Author
    Search Results
  • wzshop
    Participant

    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 );
    soporteomega
    Participant

    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.

    mika69400
    Participant

    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.9

    Plugins :
    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 seo

    Database 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 = 1200

    Members on my buddypress : 1300
    monthly visitors : 100 000
    monthly pages views : 200 000

    For 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 !

    ajitjohnson
    Participant

    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)

    #267331
    Joost abrahams
    Participant

    1. Which version of WordPress are you running?

    4.8

    2. Did you install WordPress as a directory or subdomain install?

    directory

    3. If a directory install, is it in root or in a subdirectory?

    root

    4. Did you upgrade from a previous version of WordPress? If so, from which version?

    No

    5. Was WordPress functioning properly before installing/upgrading BuddyPress (BP)? e.g. permalinks, creating a new post, commenting.

    Yes

    6. Which version of BP are you running?

    2.9

    7. Did you upgraded from a previous version of BP? If so, from which version?

    2.8.2

    8. Do you have any plugins other than BuddyPress installed and activated? If so, which ones?

    Ban Hammer: 2.6
    bbPress: 2.6-rc-3
    BP Blog Author Profile Link: 2.8.1
    BP Idea Stream: 1.0.1
    BP XProfile WordPress User Sync: 0.6.4
    BuddyDrive: 2.1.1
    BuddyPress: 2.9.0
    BuddyPress Docs: 1.9.4
    BuddyPress Edit Activity: 1.0.8
    BuddyPress Groups Extras: 3.6.9.1
    Co-Authors Plus: 3.2.2
    Jetpack by WordPress.com: 5.1
    JetPack Non-Admin Removal: 3.0
    Login Site Icon: 1.0
    Mantablog bp register text: 0.1
    Mantablog bp remove rss: 0.1
    Mantablog Custom Profile: 0.1
    Mantablog meta desc homepage: 0.1
    MediaPress: 1.1.6
    Registration Honeypot: 1.1.0-alpha-1
    SEO – Remove H1: 1.0.2
    TablePress: 1.8
    TinyMCE Advanced: 4.6.3
    WP Idea Stream: 2.4.0
    WP Revisions Control: 1.2.1
    WP Sitemap Page: 1.6

    9. Are you using the standard WordPress theme or customized theme?

    standard WordPress theme

    10. Which theme do you use ?

    Generatepress

    11. Have you modified the core files in any way?

    No

    12. Do you have any custom functions in bp-custom.php?

    No

    13. If running bbPress, which version? Or did your BuddyPress install come with a copy of bbPress built-in?

    2.6rc3

    14. Please provide a list of any errors in your server’s log files.

    15. Which company provides your hosting?

    16. Is your server running Windows, or if Linux; Apache, nginx or something else?

    Linux; Apache

    Eric Thomas Weber
    Participant

    Hi! I did follow the documentation. You’re right that those two pages work. Both of those pages use a certain template within the theme. That template uses a full-width page, without the sidebar and search bar that are on other pages. I’ve a few things to see what can remedy the matter:

    1) Yes, I switched to a different template to test, and yes, on the 2016 template, BP works, so I don’t need to reinstall BP or get it working on its own. That part is working. I didn’t realize I’d have to reset all of my widgets and stuff. Fortunately, they weren’t deleted… Got those set up again.

    2) I tried making all other relevant pages, creating pages for the stuff that BP uses, and setting each of those to use the template that works for Activity, Members, and Chapters. That didn’t work, though.

    3) I tried creating a Custom CSS entry that uses the .buddypress class, telling it to use full-width for #primary. That made the page use full-width, but it didn’t make the functionality of BP work… Like on this page:
    https://www.philosophersinamerica.com/chapters/create/step/group-details/

    Please help! I’ve reached out to my theme’s creator – and there’s no changing to a different theme. We’re super committed and it works really well for everything else, and he’s had no experience using BuddyPress. I need help! This is just the plugin I’ve been looking for to help my people create groups that they need to manage.

    It seems to me that if we’re able to get some of the pages to work there’s GOT to be a way to get other relevant pages to use whatever that same setting is to work also. Any help would be hugely appreciated.
    Best,

    Eric

    wzshop
    Participant

    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 );
    abhinav.kakku
    Participant

    i want to rename / reorder / remove items from buddypress profile page menu which includes Activity profile notification friends etc. I am running WPLMS theme

    ruchika88
    Participant

    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:notification

    All 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 theme

    Please help and thanks in advance.

    #266925
    xavi3r12
    Participant

    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?

    xavi3r12
    Participant

    I have tried that it still returned the same error, however i have just noticed that if i delete my bp-custom.php everything works fine but my pages does not redirect users to there profile “if logged in” which was the purpose of the bp-custom.php file. This in the code in my bp-custom.php file

    <?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 ) );
    }
    
    ?>

    So how do i fix this?? I need help Please

    #266407
    tackleb0x
    Participant

    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!
    Buddy

    shahidjaszle
    Participant

    Hello 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?

    shirleyddsn
    Participant

    Another Update:

    Ok, I was finally able to create a change in the file I was trying to edit. For some reason, I wasn’t able to insert code in the exact place I was trying to last time, but I WAS able to add code elsewhere in the document.

    Also, I noticed the name of the hook started with “bp”, so I moved my cover-image code to my bp-custom.php file in my child theme. But it didn’t work there either. I feel like there’s something else I’m supposed to do with $settings['callback']. Or maybe I’m supposed to plug some more code in elsewhere. I could really use some help with this.

    Also, while playing with the profile templates, I noticed there were a few hooks (which I’m learning are the ‘actions’ I’m adding to) that don’t really seem to do anything but sit there. Do they exist only for me to add code to through my bp-custom.php? If so, why wouldn’t I just hard-code something into the template file?

    For example: do_action( 'bp_member_header_actions' ); sits between the @username and last-activity. But it’s empty. When the profile page loads, there’s nothing there. So that would make it an empty hook for me to plug stuff into, right? bp_profile_header_meta is also empty. Are all hooks like that? Or do any of them have their own code/functions?

    I would still like to know where these actions are declared, and what possible functions lie inside them. Is there any way to find that information out? People create their own BP themes and plugins all the time so there has to be a way to figure this stuff out . . .

    threwthenevr
    Participant

    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.

    Nahum
    Participant

    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.

    #265734
    Nahum
    Participant

    well I was trying post the my code, but I think I spammed myself after trying to edit the reply to this …
    CPT (and custom title thing)

    add_action('init', 'video_register_my_cpt');
    function video_register_my_cpt() {
    register_post_type('video', array( 
    'label' => 'Videos',
    'description' => 'Latest Videos',
    'public' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'menu_position' => 5,
     'show_in_nav_menus' => false,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug' => 'videos'),
    'query_var' => true,
    'has_archive' => true,
    'exclude_from_search' => false,
    'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','buddypress-activity'), 
    'bp_activity' => array(
                'component_id' => buddypress()->blogs->id,
                'action_id'    => 'new_video',
                'format_callback' => 'bp_blogs_format_activity_action_new_blog_post',
                'comment_action_id' => 'new_video_comment',
                'comment_format_callback' => 'bp_activity_format_activity_action_custom_post_type_comment',
                'contexts'     => array( 'activity', 'member' ),
                'position'     => 40,
                ),
      'taxonomies' => array('video_category','video_tag'),
      'labels' => array(
      'name' => 'Videos',
      'singular_name' => 'Video',
      'menu_name' => 'Videos',
      'add_new' => 'Add Video',
      'add_new_item' => 'Add New Video',
      'edit' => 'Edit',
      'edit_item' => 'Edit Video',
      'new_item' => 'New Video',
      'view' => 'View Video',
      'view_item' => 'View Video',
      'search_items' => 'Search Videos',
      'not_found' => 'No Videos Found',
      'not_found_in_trash' => 'No Videos Found in Trash',
                
                'bp_activity_admin_filter' => __( 'New video published', 'custom-domain' ),
                'bp_activity_front_filter' => __( 'Videos', 'custom-domain' ),
                'bp_activity_new_post'     => __( '%1$s added <a href="%2$s">[Video]</a>', 'custom-domain' ),
                'bp_activity_new_post_ms'  => __( '%1$s added <a href="%2$s">[Video]</a>','custom-domain' ),
                
                'bp_activity_comments_admin_filter' => __( 'Comments about video', 'custom-domain' ), // label for the Admin dropdown filter
                'bp_activity_comments_front_filter' => __( 'Video Comments', 'custom-domain' ),        // label for the Front dropdown filter
                'bp_activity_new_comment'           => __( '%1$s commented on a <a href="%2$s">video</a>', 'custom-domain' ),
                'bp_activity_new_comment_ms'        => __( '%1$s commented on a <a href="%2$s">[Video]</a>, on the site %3$s', 'custom-domain' )
    
      )
    
    ) ); }
    
    function my_video_include_post_type_title( $action, $activity ) {
      if ( empty( $activity->id ) ) {
        return $action;
      }
    
      if ( 'new_video' != $activity->type && 'new_video_comment' !=$activity->type ) {
        return $action;
      }
    
      preg_match_all( '/<a.*?>([^>]*)<\/a>/', $action, $matches );
    
      if ( empty( $matches[1][1] ) || '[Video]' != $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', 'my_video_include_post_type_title', 10, 2 );
    
    

    BP CUSTOM

    
    /*////////////////////////////////////////////////////////////////////////////////////////////*/
    // Modifying CPT Activity Actions
    /*///////////////////////////////////////////////////////////////////////////////////////////*/
    
    function record_blogpost_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    
    if( $post->post_type == 'jobs' || get_post_type($post->ID) == 'jobs' ) {
      
      $activity_action  = sprintf( __( '%1$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>');
    
    } elseif( $post->post_type == 'video' || get_post_type($post->ID) == 'video' ) {
    
      $activity_action  = sprintf( __( '%1$s posted a video', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    
    } elseif($post->post_type == 'post'  ) {
    
      $activity_action  = sprintf( __( '%1$s posted a blog', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    
    }  
    
    return $activity_action;
    }
    
    add_filter('bp_blogs_activity_new_post_action', 'record_blogpost_activity_action', 11, 3);
    
    /*////////////////////////////////////////////////////////////////////////////////////////////*/
    // Modifying CPT Comment Activity Actions
    /*///////////////////////////////////////////////////////////////////////////////////////////*/
    
    function comment_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    if( $post->post_type == 'post' ) {
    
      $activity_action  = sprintf( __( '%1$s commented on %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    
    } elseif( $post->post_type == 'video' || get_post_type($post->ID) == 'video' ) {
    
      $activity_action = sprintf( __( '%1$s replied on the video %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . esc_url( $post_permalink ). '">' . $post->post_title . '</a>' );
    
    } 
    return $activity_action;
    
    }
    
    add_filter('bp_blogs_activity_new_comment_action', 'comment_activity_action', 11, 3);
    
    /*//// ? /////*/
    function bbg_record_video_post_type_comments( $post_types ) {
          $post_types[] = 'video';
          return $post_types;
      }
    //add_filter( 'bp_blogs_record_post_post_types', 'bbg_record_video_post_type_comments' );
    //add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_video_post_type_comments' );
    

    doing it this way, everything works except my custom comment action.

    cahara
    Participant

    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 the activity_format_notifications action with various different priorities
    – All of the above in a custom plugin file, bp-custom.php, and my themes’ function.php file

    I’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.

    lilcxnty
    Participant

    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

    #264785
    Siddharth
    Participant

    hello support team,

    I’m facing a problem after updating buddypress to 2.8.2. Once I submit any text into activity stream it shows the website in an IFRAME, see the screenshot below plz. Can provide login if that helps.

    Screenshot: http://nimb.ws/ufhcbA

    Also when I’m trying to upload an image into activity stream, or trying to upload an image in Groups avatar or cover photo or my individual cover photo, it says “An error occured. Please try again later”. It was working all fine 2 days ago & after the buddypress update it doesn’t seems to work.

    I’m using:-

    WP 4.7.3
    BP 2.8.2
    BBpress 2.5.12
    rtMedia for WordPress, BuddyPress and bbPress 4.3.1
    Gravity Forms 2.0.6.9 – For customized registration page
    Gravity Forms User Registration Add-On 3.3.9 – For mapping user registration with WP & BP fields.

    Please help!

    Thanks,
    Sidd

    #264030
    danbp
    Participant

    Hi,

    you have to use a group_id and to ensure you’re in an appropriate loop (activity or group)

    To get a group id, you can for ex. do:

    // check for a group ID
    	if( bp_has_groups() ) {
    		// Grab current group ID
    		bp_the_group();
    		$group_id = bp_get_group_ID();
    	}	
    	
        // apply our changes only to this group ID's
    	// conditionnal action
    	if ( $group_id == 22 OR $group_id == 8 ) {  

    … and so on!

    You may also use bp_parse_args, depending where you use your custom work. In other words, you can create a complete new activity loop on a distinct page template for only one group.

    Using bp_parse_args() to filter BuddyPress template loops

    pellu
    Participant

    I search for a plugin or code.

    I wish a notification in the administration of the keywords I would have chosen, without deleting his keywords in the front office. This feature must work with all buddypress, message, activity, group, and custom pages.

    I use WordPress 4.7 and BuddyPress 2.7.4. I have Woffice theme based on Unyson.

    Thank you in advance for your help

    #263856
    r-a-y
    Keymaster
    • Site Tracking – The description on the Settings page says it all – “Record activity for new posts and comments from your site.“. This is useful if the Activity Streams component is also active.
    • Login Widget – Not sure why you want extra tabs for a login widget… if you need extra functionality, you can always add your own widget if you have some coding ability.
    • Profile photo by URL or user-selectable profile photo – This isn’t a core option. Would have to be a custom plugin for now.
    • Mini-blog – No core option, unless a user’s activity stream is enough. There are plugins out there like BuddyBlog that offer some frontend blogging functionality.
    • Disabling emails – I think putting the desired email in draft mode might be sufficient to disable email sending. Test and see what happens!
    #263616

    In reply to: add subnav to activity

    kalughodakiya
    Participant

    Just add sub nav using bp_core_new_subnav_item and modify file activity.php just put your code before if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( ‘just-me’ ) ) )
    bp_get_template_part( ‘activity/post-form’ );

    with if condition like
    if(is_user_logged_in() && bp_is_my_profile() && bp_is_current_action( ‘schedule_message’ )){
    get_template_part( ‘custom_files/schedule_message’ );

    if current action is you tab slug then load you page template otherwise default

    #262749
    squadup
    Participant

    Excuse me if this request is in the wrong place:

    I have added a working custom date field to my activity page by editing the post-form.php and the the bp-custom.php. This is in my bp-custom.php:

    
    // CUSTOM DATE FIELD
    function add_date_to_activity( $content, $user_id, $activity_id ) {
    bp_activity_update_meta( $activity_id,'thedate', $_POST['thedate'] );
    }
    add_action( 'bp_activity_posted_update', 'add_date_to_activity', 10, 3 );
    function my_datemeta() {
    $my_datemeta = bp_activity_get_meta( bp_get_activity_id(),'thedate' );
    if (is_user_logged_in()) : {
    echo "<span class='datefont'>" . $my_datemeta . "</span></br>";
    }
    endif;
    }
    add_action( 'bp_activity_entry_meta','my_datemeta' );
    

    Now I am trying to sort the posted activities by this date field instead of the standard sort by activity-id’s. Is there any way to override the standard sort function?

    Thanks in advance, i’d be happy to share more information if necessary

Viewing 25 results - 176 through 200 (of 838 total)
Skip to toolbar