Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change the default activity tab

  • Avatar of Anton
    Anton
    Participant

    @antonrsa

    When a member is logged in and browsing to the activity page, the default activity tab shows “All Members” activity. I am using the “Followers” plugin. How can I change that so that the default tab for logged in users displays the people that they are following activity instead of every member on the network? For logged out users, the default site wide activity can still be the default. Is there a way to hack this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Avatar of Anton
    Anton
    Participant

    @antonrsa

    Anyone?

    Avatar of Anton
    Anton
    Participant

    @antonrsa

    Is it at all possible to have a different default tab for the activity stream except the “All Members” tab displaying everything?

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    Hmm… I’d be interested in this as well. Was there a fix that someone had written up a while back?

    Avatar of Nm
    nm
    Participant

    @nahummadrid

    i’ve tried doing this for the activity page and the profile activity, but I wasn’t able to get it going…i think there was someone who posted a possible solution but I can’t find it.

    It almost makes sense to include the logic you described into the default BP. Its the most common activity logic found everywhere else….so you got my vote.

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    I did some snooping around and found some tips for changing the ordering and defaults tabs of groups, but nothing on the default activity tabs.

    http://shabushabu.eu/reordering-buddypress-group-tabs/

    I found a thread that @modemlooper made a couple months back discussing the issue. I completely forgot that I had posted on the thread. :P

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    Hmm… did some more snooping. The relevant file is /bp-child-default-theme/activity/index.php

    Ideally there would be a single function that should generate the current activity tabs, that way we could use the hook to remove the existing function and then drop in our own existing function via add_action();

    Unfortunately I see nothing of the sort. Here are lines 18 – 56.

    http://pastebin.com/PH8BTyN8

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    Whoa, whoa, come to think of it then theoretically there should be a single value floating out there somewhere that’s making the “All Members” tab behave as the default.

    Avatar of paulhastings0
    paulhastings0
    Participant

    @paulhastings0

    Wow, I think I just figured out how to do it. It’s kind of hacky but I’ll share it with yall anyway.

    1. Make sure that you’re working on a child theme of the BP Default theme.
    2. Copy/paste the contents of bp-default/activity/index.php into your child theme’s activity/index.php folder
    3. Find the line `

  • ` and delete `class=”selected”`
    4. Scroll down a few lines further to `
  • ` and insert `class=”selected”` just after `id=”activity-friends”`

    And that should be it. One thing I’ve noticed though is that the browser still seems to remember what the last tab was that you were using. But if you login into your account with a completely new browser then your default activity tab will be “Friends”.

    If anyone else has a less “hacky” solution then by all means share with us.

Avatar of Anton
Anton
Participant

@antonrsa

@paulhastings0

So it won’t display anything when you are not logged in?

Avatar of paulhastings0
paulhastings0
Participant

@paulhastings0

To be honest I don’t remember. It might just display something like “There are no current topics” or something similar to that or perhaps it’ll just default to the only available tab which would be the “All Members” tab since logged-out users obviously don’t have the “My Friends”, “My Groups”, etc. tabs.

Of course to guarantee what logged-out guests see, someone could write an if/else clause that decides what activity to set as “selected” depending whether they’re logged in or not. For the purposes of our website though we don’t allow logged-out visitor to see our pages at all, so it really wasn’t an issue for us.

Avatar of calvinhsu
calvinhsu
Participant

@calvinhsu

@paulhastings0

Hi, I used this method before, and I even moved `

  • ` to the end of all tabs.

    But after this, although it appears the preferred tab(“My friends” or “my groups”) is selected, the actual activities automatically loaded below the tabs are still all members’ activities.

    So it seems the `class=”selected”` is just for defining css style, it does not change the default activity sream loaded.

  • Avatar of freddy mcbob
    freddy mcbob
    Participant

    @yeshourun

    thank you very much! worked great!

    Avatar of Martyn_
    Martyn_
    Participant

    @martyn_

    Bumping this.

    the wider problem is that new users don’t have friends (or followings) and yet for established users the global feed is way to busy and way too irrelevant. Selecting a filter/feed doesn’t persist beyond the session.

    Ideally, there would be a user setting that allowed choice as to what the view was, or a way of hooking in an algorithmic choice – say based on friend count or following count.

    Secondly the exclusive choice isn’t ideal, inclusive selection (friends, friends and following, friends and following and condition XYZ) would be much better.

    Is anyone working on such? Or interested in helping? Or pointers to code….

    Viewing 13 replies - 1 through 13 (of 13 total)

    You must be logged in to reply to this topic.