BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 17

    No, my goal is to eliminate the “what’s new” field completely.

  • Participant
    Level: Initiated
    Posts: 17
    Mike Witt on in reply to: [Resolved] Database Errors #44301

    Just an update – I finally did open a ticket:

    https://buddypress.trac.wordpress.org/ticket/8676

    I’m kind of a novice at this. If anyone knows how to improve it or knows any more information, please feel free to add it.

  • Participant
    Level: Initiated
    Posts: 17
    Mike Witt on in reply to: [Resolved] Database Errors #43947

    Hi Brajesh,

    Thank you for looking at this. I don’t feel like it’s a good idea for me to report a bug on this. At least not yet. For all I know it could be a plugin conflict or some conflict with custom code of mine. I want to gather more info first. I also have a post on the BuddyPress forum waiting for input.

    We’ll see what happens, but thanks again.

    Mike

  • Participant
    Level: Initiated
    Posts: 17

    Thanks very much Ravi. That definitely works on my test site. I need to spend some time understanding how the ajax stuff works exactly, but that something I need to learn.

    This have been very helpful. Once again, thank you!

    -Mike

  • Participant
    Level: Initiated
    Posts: 17

    Hi Ravi,

    I would actually like to create a 2nd drop-down, as I mentioned above. However, let me try to understand what you are suggesting. I think my problem is that I don’t know how to communicate the asc and desc options to bp_ajax_querystring. When I do what you are suggesting, the “asc” or “desc” parameters show up as “type” not as “sort” when they get to bp_ajax_querystring.

    I don’t know if I’m explaining that very well 🙂

    Mike

    
    function add_order_options( $options ) {
        // If not on single user screen return default options.
        if ( ! bp_is_user() ) {
            return $options;
        }
    
        $log_me = "\nVer 8:";
        $log_me .= "\nBefore: " . json_encode($options);
    
        if ( ! isset( $options['asc'] ) ) {
            $options['asc'] = __( 'Ascending Order' );
        }
    
        if ( ! isset( $options['desc'] ) ) {
            $options['desc'] = __( 'Descending Order' );
        }
    
        $log_me .= "\nAfter: " . json_encode($options);
        error_log($log_me);
        return $options;
    }
    add_filter( 'bp_get_activity_show_filters_options', 'add_order_options');
    
    function filter_bp_aqs( $bp_aqs, $object )
    { 
        /*
        $query_sort = $_GET['sort'];
    
        if ( isset( $query_sort ) && $query_sort === 'asc' )
        $bp_aqs .= 'sort=ASC';
         */
    
        error_log('filter_bp_aqs: ' . $bp_aqs); 
        return $bp_aqs;
    }
    add_filter( 'bp_ajax_querystring', 'filter_bp_aqs', 999, 2 );
    
  • Participant
    Level: Initiated
    Posts: 17

    Hi Brajesh, the site in question uses Legacy. Thanks.