Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 308 total)

  • nm
    Participant

    @nahummadrid

    I always reference this https://buddypress.org/support/topic/choosing-activity-stream-information/ but maybe something like, untested

    add_filter( 'bp_before_has_activities_parse_args', function( $args ) {
    	
    if(bp_is_current_action( 'groups' )) {
    
     $args['object'] = array('groups');
    
    } else {
    $filter_query = array(
    		array(
    			'column' => 'type',
    			'value' => array( 'group_action_1', 'group_action_etc' ),
    			'compare' => 'NOT IN',
    		),
    	);
    
    	$args['filter_query'] = $filter_query;
    }
    
    	return $args;
    } );

    nm
    Participant

    @nahummadrid

    If the above is working with template files, why wouldn’t overwriting buddypress.css via /buddypress/bp-legacy/css be working like it would under /buddypress/css or /community/css?


    nm
    Participant

    @nahummadrid

    oops sorry I put in the wrong snip then I couldn’t edit…here’s what “seems” to be working for me.

    add_filter( 'bp_get_template_locations', 'my_template_pack_stack' );
    
    function my_template_pack_stack( $locations = array() ) {
    
    if( bp_get_theme_package_id()  === 'nouveau') {
    
    $locations[] = '/buddypress/bp-nouveau';
    
    } elseif( bp_get_theme_package_id()  === 'legacy') {
    
    $locations[] = '/buddypress/bp-legacy';
    
    }
    
      return $locations;
    }
    

    nm
    Participant

    @nahummadrid

    could try
    https://codex.wordpress.org/Shortcode_API#Output
    and
    codex.buddypress.org/developer/loops-reference/the-blogs-loop/


    nm
    Participant

    @nahummadrid

    Find the /buddypress/members/single/profile/change-avatar.php file and place a copy in your child theme’s /buddypress/members/single/profile/ folder and modify that file by removing the parts about gravatar

    or this maybe

    Loco Translate


    nm
    Participant

    @nahummadrid

    That is a path I have tried but I think it would be a little different for nouveau pack. I tried it but don’t fully know the downsides…I think mentions can happen from blog comments so I know that would not work with some of those dequeues. I can’t think of any other reasons where scripts would be needed…maybe if you use bp widgets on non bp pages.


    nm
    Participant

    @nahummadrid

    screen: https://ibb.co/FJYPhDx

    I am able to get the button in the activity entry using bp_get_activity_content_body but that gets added outside my card.


    nm
    Participant

    @nahummadrid

    Thanks for the suggestion, I think I tried that and my problem there was getting what the user inputted username and email to add to the url in order to prepopulate the next form on the redirected page. I can’t auto log them in quite yet to get current user info.

    What I ended up doing was this with a plugin:

    <script src="http://malsup.github.com/jquery.form.js"></script> 
    
        <script> 
            // wait for the DOM to be loaded 
            jQuery(document).ready(function($) { 
                // bind form and provide a simple callback function 
                $('form#signup-form').ajaxForm(function() { 
    
                    //window.location = "/page/success" 
    
                   var name = jQuery('#signup_username').val();
                   var dname = jQuery('#field_1').val();
                   var email = jQuery('#signup_email').val();
     	       var city = jQuery('#field_2').val();
    
     	       var queryString = "https://______.com?username=" + name + "&email=" + email + "&firstName=" + dname + "&address.city=" + city;
    
    		window.location.replace(queryString);
    
                }); 
            }); 
        </script>

    on the register page. I’d rather go with your suggestion and expand on it to make this work with a snippet behind the scenes.


    nm
    Participant

    @nahummadrid

    I see thanks! I went ahead and did just that!


    nm
    Participant

    @nahummadrid

    In Nouveau, where is bp_displayed_user_username in members/single template? @prashantvatsh


    nm
    Participant

    @nahummadrid

    That was it, I guess the_title is the display name now for the profile and this other displayed_user_mentionname is another displayed name on the same page(?!). But where the mentionname is, is where ideally a profile name should always be I thought. If you turn off activity, the displayed_user_mentionname – does – disappear. I had removed the_title on profile pages because of their placement a while ago. 🙂

    so in cover-image-header.php

    <?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?>
    <h2 class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></h2>
    <?php else:?>
    <h2 class="user-nicename"><?php the_title(); ?></h2>
    <?php endif; ?>
    

    would be I guess what I was expecting.

    Thanks for the help


    nm
    Participant

    @nahummadrid

    @prashantvatsh thanks for the reply.

    Is this area where the username is supposed to appear?

    OR does nouveau rely on the page title for the username?

    And this bp_displayed_user_mentionname() is meant to only do mention replies?


    nm
    Participant

    @nahummadrid

    @djpaul thanks for the feedback. I’d say then that having a dropdown template pack option in the options page gives the impression that we can switch between the 2 as long as a theme supports both. In fact if I start working with BP + Twenty Seventeen or underscores, I need to stick with whichever pack i choose from the beginning if I make modifications to bp templates or have nouveau/legacy specific functions.

    concept of multiple small template packs being active at the same time

    I wouldn’t need multiple packs active at the same time just for the theme to respond to whichever pack is active. I guess I should have a child theme that works with legacy and another child theme for nouveau… should we be moving away from the legacy pac? if so, my objective of using the same theme for both isn’t needed.


    nm
    Participant

    @nahummadrid

    @djpaul but lets say we want the THEME to remain compatible with both? would it be possible to switch between the 2 template packs for a theme having a the override/buddypress folder in order to modify bp templates and still have the theme stay compatible.

    I can look for custom functions for each pack when i switch back and forth like so no? so that i can try to make them continue to work for each…

    if(class_exists('buddypress')) {
      
      if( bp_get_theme_package_id()  == 'nouveau') { 
      my custom nouveau actions, functions and stuff
      enequeue custom nouveu.css
      } else {
      my custom legacy actions, functions and stuff
      enequeue custom legacy.css
      }
    
    }

    How to do this with the theme overrides in the theme/child theme’s /buddypress folder?

    should this work?
    /bp-nouveau/buddypress/…template overrides
    /bp-legacy/buddypress/…template overrides

    So in this way my theme can continue working with both packs…


    nm
    Participant

    @nahummadrid

    i went ahead and just put the flexslider script in the entry.php for post formats = gallery.


    nm
    Participant

    @nahummadrid

    got it. have to get the original activity type then post id via the parent activity. that will allow me to continue formatting the CPT activity_comments and then I’ll remove the ability to comment inline. found it in bp-blogs-activity.php.


    nm
    Participant

    @nahummadrid

    …or might there be a way to target blog/forum comments after enabling blog/forum comment sync? once the blog comment activity becomes an activity_comment…I lose the ability to format the content on different CPT new_cpt_comments.


    nm
    Participant

    @nahummadrid


    nm
    Participant

    @nahummadrid

    Plus this https://wordpress.org/plugins/buddypress-simple-events/ maybe? In the pro version, users can mark if they will attend(“register on it”).


    nm
    Participant

    @nahummadrid

    @shanebp thanks for the reply

    I was looking at the BP component references, even on your event simple plugin to get an idea…

    If what I would like to do is just assign all my CPT comments tracking under a united CPT comments component or post component with all the different cpt post actions in one stream, I would need to create a different plugin for each combination of mixed activities?

    Let’s say I want to move around specific actons like “updated_profiles” from activity to custom component in order to address an issue like this https://buddypress.org/support/topic/removing-actions-from-activity-stream-with-filtering-options/…wouldn’t it be a solution to reassign an unwanted action to a custom component.


    nm
    Participant

    @nahummadrid

    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.


    nm
    Participant

    @nahummadrid

    looking for this too.


    nm
    Participant

    @nahummadrid

    I figured this out, in my case.

    If you disable a component and still have the new buddypress menu link for that component in your navigation menu, you’ll get this error. You have to remember to remove it from your menus.


    nm
    Participant

    @nahummadrid

    I was working just fine, Multisite, 3.8, and 1.9…and I went to activate Groups component. And I started getting this error message.

    Only thing I can think of is that I had Buddypress activated on single mode as opposed to Network activated at the time I enabled Groups.

    I activated bp in network mode, but it didnt fix it.


    nm
    Participant

    @nahummadrid

    Ok thanks Paul. I’ve been away for a long time. but i’m back playing around with BP…so this was my first shot and introductory support ticket in this awesome new BP site. 🙂 I’ll dig into this further.

Viewing 25 replies - 1 through 25 (of 308 total)
Skip to toolbar