Skip to:
Content

BuddyPress.org

Ticket #4897: 4897.02.diff

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

     
    126126        if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
    127127                $qs[] = 'page=' . $_POST['page'];
    128128
     129        // exludes activity just posted and avoids duplicate ids
     130        if ( ! empty( $_POST['exclude_just_posted'] ) ) {
     131                $just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
     132                $qs[] = 'exclude=' . implode( ',', $just_posted );
     133        }
     134
    129135        $object_search_text = bp_get_search_default_text( $object );
    130136        if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
    131137                $qs[] = 'search_terms=' . $_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();
     
    301301
    302302                        var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
    303303
     304                        var just_posted = '';
     305                       
     306                        jq('#buddypress li.just-posted').each( function(){
     307                                just_posted += jq(this).attr('id').replace( 'activity-','' ) + ',';
     308                        });
     309                       
     310                        if( just_posted.length )
     311                                just_posted = just_posted.substr( 0, just_posted.length - 1 );
     312
    304313                        jq.post( ajaxurl, {
    305314                                action: 'activity_get_older_updates',
    306315                                'cookie': bp_get_cookies(),
    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

     
    416416        if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] )
    417417                $qs[] = 'page=' . $_POST['page'];
    418418
     419        // exludes activity just posted and avoids duplicate ids
     420        if ( ! empty( $_POST['exclude_just_posted'] ) ) {
     421                $just_posted = wp_parse_id_list( $_POST['exclude_just_posted'] );
     422                $qs[] = 'exclude=' . implode( ',', $just_posted );
     423        }
     424
    419425        $object_search_text = bp_get_search_default_text( $object );
    420426        if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] )
    421427                $qs[] = 'search_terms=' . $_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();
     
    304304
    305305                        var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
    306306
     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 )
     314                                just_posted = just_posted.substr( 0, just_posted.length - 1 );
     315
    307316                        jq.post( ajaxurl, {
    308317                                action: 'activity_get_older_updates',
    309318                                'cookie': bp_get_cookies(),
    310                                 'page': oldest_page
     319                                'page': oldest_page,
     320                                'exclude_just_posted':just_posted
    311321                        },
    312322                        function(response)
    313323                        {