Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to show sitewide activity in profile page


  • nickofnight
    Participant

    @nickofnight

    Hi! What I want to do is allow anyone who logs into the site see sitewide activiy, not just activity that is related to them. This will help my community know what is going on throughout the site better – but I have no idea how to do this.

    Is there a filter I can put in bp_has_activities on the profile page to do this? Like scope=all or id=all?

    I would appreciate any help 🙂

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

  • Henry Wright
    Moderator

    @henrywright

    Hi @nickofnight,

    In order to see the sitewide activity stream, by default members can go to: example.com/activity. Activity related to a particular member can be seen by going to example.com/members/username

    Why don’t you just redirect everyone to the first link on login?


    nickofnight
    Participant

    @nickofnight

    Hi, thanks for the response!

    I am trying to create a useful page for people once they log in, showing recommended groups for them based on their profile, forum posts they are subscribed to etc – basically a personalised portal to what is going on on the site and what they might be interested in doing.

    Showing sitewide activity on that page would be great and encourage them to reply to other peoples comments/status’s etc. Showing only their own activity on it right now is a bit pointless.


    Henry Wright
    Moderator

    @henrywright

    In that case, you can just do this:

    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     
            <?php locate_template( array( 'activity/entry.php' ), true, false ); ?>
     
        <?php endwhile; ?>
    <?php endif; ?>

    Unless you filter this, it’ll show everything.

    Ref: https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/


    nickofnight
    Participant

    @nickofnight

    If I put that code on the users activity page template, it is automatically filtered to that user and I don’t know how overwrite it to say don’t use a user/ID.


    alitoruiz
    Participant

    @alitoruiz

    Hi, did you find a workaround? I am trying to achieve the samething. that would be, that anybody can see any user activities, its kind to restricted to only friends.


    nickofnight
    Participant

    @nickofnight

    Hi @alitoruiz – yes I did but I used a plugin in the end. It is very lightweight and does almost exactly what I needed: http://buddydev.com/plugins/bp-community-activity-on-profile/

    Only problem was it didn’t make the “all activity” tab it creates the default, so I had to change a few links to point to the new tab.

    Hope it helps!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to show sitewide activity in profile page’ is closed to new replies.
Skip to toolbar