Sure, Let me break it down for you.
So the thing is that I wanted to create an excerpt to load all media when the user really wanted to see them on the activity stream, so i figure out that buddypress has an embedded excerpt function for all activity stream related content.
Its located in two files:
First file: /buddypress/bp-activity/bp-activity-filters.php
Between lines 373 and 397:
$append_text = apply_filters( ‘bp_activity_excerpt_append_text’, __( ‘[Load Images]’, ‘buddypress’ ) ); //Here You set the name for the excerpt
$excerpt_length = apply_filters( ‘bp_activity_excerpt_length’, 140 ); //Here you set the characters, set it to 10 characters or something like that or less to make it appear with a few words of text, then attach the images with the rtmedia and post the content, it shall appear.
Second file: /Buddypress/bp-templates/bp-legacy/js/buddypress.js
Here is the js function to call in action. Lines 445-467
// Activity "Read More" links
jq('div.activity').on('click', '.activity-read-more a', function(event) {
var target = jq(event.target);
var link_id = target.parent().attr('id').split('-');
var a_id = link_id[3];
var type = link_id[0]; /* activity or acomment */
var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner';
var a_inner = jq('#' + type + '-' + a_id + ' .' + inner_class + ':first' );
jq(target).addClass('loading');
jq.post( ajaxurl, {
action: 'get_single_activity_content',
'activity_id': a_id
},
function(response) {
jq(a_inner).slideUp(0).html(response).slideDown(300);
apply_rtMagnificPopup('.rtmedia-list-media, .rtmedia-activity-container ul.rtmedia-list, #bp-media-list,.bp-media-sc-list, li.media.album_updated ul,ul.bp-media-list-media, li.activity-item div.activity-content div.activity-inner div.bp_media_content, .rtm-bbp-container');
});
return false;
});
There you have it.