BuddyDev

Search

how to set the Activity feed to ascending?

  • Participant
    Level: Enlightened
    Posts: 26
    Peter Fae on #14039

    hey. I’m wanting to use the activity feed and profile feeds as ongoing blurbs from an online novel, so every post is a new update from the novel, which Readers can go through sequentially from the top down in the feed.

    I’d like to know how to set the feed to show the oldest posts last and then scroll down.

    Actually, what would be amazing is if the latest post was shown as the top, and then the oldest post below it. But, for now, as I’m working out the specifics of how to make this happen in buddypress, it would be awesome just to have oldest-first, newest-last.

    How can I do this on the general feed?

    Also, how can I leave the general feed ‘newest first’, ‘oldest last’ and then have the PROFILE be oldest-first, newest-last?

    The concept would be, come see the regular activity feed to see the latest posts, yet if you go to a Profile, it will show the oldest first, a sequential listing of updates.

    thanks!!!

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14044

    You can list the activities as ascending using the following code

    
    
    /**
     * List activities in ascending order.
     *
     * @param array $args activity args.
     *
     * @return array
     */
    function buddydev_list_activities_ascending( $args ) {
        $args['sort'] = 'ASC';
    
        return $args;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'buddydev_list_activities_ascending' );
    
    

    It is possible to list the last activity at top but that will be a bit complicated and I won’t be able to assist much with that due to lack of time.

    Hope it helps.
    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 26
    Peter Fae on #14045

    I figured. Yet the help that You have so graciously provided with your time is INTEGRAL to showcasing the concept to Readers & Authors.

    What would the code be to showcase the PROFILE in ascending order yet the ACTIVITY feed in descending order?

    This way the concept of ‘coming to an ‘Author’s’ profile leads to their Story, which is mixed with the revolution slider idea that I spoke about in the other thread, yet the regular activity feed is the same.

    thank you so much. This is uber-uber-UBER helpful.

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14047

    Thank you.

    You may use the following code instead

    
    
    /**
     * List activities in ascending order.
     *
     * @param array $args activity args.
     *
     * @return array
     */
    function buddydev_list_activities_ascending( $args ) {
    	if ( bp_is_user_activity() ) {
    		$args['sort'] = 'ASC';
    	}
    
    	return $args;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'buddydev_list_activities_ascending' );
    
    

    It only shows the activities as ascending on the user profile.

    Best regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 26
    Peter Fae on #14049

    yah that. caused a whitescreen on my system. the other code works for the general ascending yet not for user profile/activity feed difference. why white screen?

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14050

    Please make sure to remove the previous code. Keeping both have caused white screen as I have used same name for the functions.

  • Participant
    Level: Enlightened
    Posts: 26
    Peter Fae on #14052

    Yah I copy &. replaced it. Not working. Strange

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14053

    Hi Peter,
    The code is working fine as I just confirmed again.

    Please enable WP_DEBUG and let me know what error you are seeing. It should be a fatal error.

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14054

    Also, Please make sure you did not copy it from the email notification. The code in email gets entity encoded.

  • Participant
    Level: Enlightened
    Posts: 26
    Peter Fae on #14055

    MMM … that is working. Nice.

    We’re really getting there. Your help is fantastic. We’re just getting things dialed so this is very helpful for our presentation. I want to get some plugins and premium with Buddydev. At this point we’re just launching so not in the budget *however* this help is deeply appreciated *and* I WILL be getting some kind of a more premium support package as I plan on going deeper into buddypress.

    Question –

    How do showcase ONLY updates on the profile feed? Meaning the regular network posts (like, this user posted on this site in the network and it shows up in the feed) on the Activity Feed, yet *only* BP updates on the profile feed?

    This way … this way only the Story updates will show up on the profile feed, and older network-wide posts won’t.

You must be logged in to reply to this topic.

This topic is: not resolved