Skip to:
Content

BuddyPress.org

Ticket #4897: 4897.01.diff

File 4897.01.diff, 4.0 KB (added by imath, 12 years ago)
  • bp-themes/bp-default/_inc/ajax.php

     
    125125        // If page and search_terms have been passed via the AJAX post request, use those.
    126126        if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
    127127                $qs[] = 'page=' . $_POST['page'];
     128               
     129        // exludes activity just posted and avoids duplicate ids
     130        if ( ! empty( $_POST['exclude_just_posted'] ) )
     131                $qs[] = 'exclude=' . $_POST['exclude_just_posted'];
    128132
    129133        $object_search_text = bp_get_search_default_text( $object );
    130134        if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
  • bp-themes/bp-default/_inc/global.js

     
    102102                                }
    103103
    104104                                jq("ul#activity-stream").prepend(response);
    105                                 jq("ul#activity-stream li:first").addClass('new-update');
     105                                jq("ul#activity-stream li:first").addClass('new-update just-posted');
    106106
    107107                                if ( 0 != jq("#latest-update").length ) {
    108108                                        var l = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
     
    300300                                } );
    301301
    302302                        var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
     303                       
     304                        var just_posted = '';
     305                       
     306                        jq('#content li.just-posted').each( function(){
     307                                just_posted += jq(this).attr('id').replace( 'activity-','' );
     308                        });
     309                       
     310                        if( just_posted.length > 2 )
     311                                just_posted = just_posted.substring(-1);
    303312
    304313                        jq.post( ajaxurl, {
    305314                                action: 'activity_get_older_updates',
    306315                                'cookie': encodeURIComponent(document.cookie),
    307                                 'page': oldest_page
     316                                'page': oldest_page,
     317                                'exclude_just_posted':just_posted
    308318                        },
    309319                        function(response)
    310320                        {
  • bp-templates/bp-legacy/buddypress-functions.php

     
    415415        // If page and search_terms have been passed via the AJAX post request, use those.
    416416        if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
    417417                $qs[] = 'page=' . $_POST['page'];
     418               
     419        // exludes activity just posted and avoids duplicate ids
     420        if ( ! empty( $_POST['exclude_just_posted'] ) )
     421                $qs[] = 'exclude=' . $_POST['exclude_just_posted'];
    418422
    419423        $object_search_text = bp_get_search_default_text( $object );
    420424        if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
  • bp-templates/bp-legacy/js/buddypress.js

     
    102102                                }
    103103
    104104                                jq("#activity-stream").prepend(response);
    105                                 jq("#activity-stream li:first").addClass('new-update');
     105                                jq("#activity-stream li:first").addClass('new-update just-posted');
    106106
    107107                                if ( 0 != jq("#latest-update").length ) {
    108108                                        var l = jq("#activity-stream li.new-update .activity-content .activity-inner p").html();
     
    303303                                } );
    304304
    305305                        var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
     306                       
     307                        var just_posted = '';
     308                       
     309                        jq('#buddypress li.just-posted').each( function(){
     310                                just_posted += jq(this).attr('id').replace( 'activity-','' );
     311                        });
     312                       
     313                        if( just_posted.length > 2 )
     314                                just_posted = just_posted.substring(-1);
    306315
    307316                        jq.post( ajaxurl, {
    308317                                action: 'activity_get_older_updates',
    309318                                'cookie': encodeURIComponent(document.cookie),
    310                                 'page': oldest_page
     319                                'page': oldest_page,
     320                                'exclude_just_posted':just_posted
    311321                        },
    312322                        function(response)
    313323                        {