Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Filter custom activity stream to display only new groups, new topics, new replies


  • kraigg
    Participant

    @kraigg

    Good morning

    My list of users is starting to grow, and the activity stream is starting to get very long and messy. So I’m trying to filter out the activity stream so that it doesn’t display friendships, and users joining groups. I’d like it to display only:
    – new groups created
    – new topics
    – new replies

    My custom activity stream (below) used to work, but ever since I started using bbPress plugin separately, instead of the bbPress included with BuddyPress, the activity stream no longer works the way it should.

    If I don’t have any filtering, the activity stream displays, but if I add any sort of filtering, the activity stream returns 0 items.

    I’m using the latest bbPress 2.1.3, BuddyPress 1.6.1, and WordPress 3.4.2.

    Can you tell me what I’m doing wrong, and how I can fix it?

    `/* = Custom Activity Stream


    * Place this function in bp-custom.php (in your plugins directory)

    function my_activity_stream($args ) {

    if ( bp_has_activities($args) ) : ?>

      <li class="” id=”activity-“>

      <a href="”>

      bp_activity_content_body();
      }
      ?>
      `

      I then placed the function call (below) inside wp-content/themes/my_custom_theme/homepage.php

      This doesn’t work, returns 0 items:

      This works, but returns all items, including friendships and group joins

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

  • kizzywizzy
    Participant

    @kizzywizzy

    I believe I have the answer for this in one of my old codes. Hand on , I’ll search for it


    kizzywizzy
    Participant

    @kizzywizzy

    Try changing this
    `if ( bp_has_activities($args) ) : ?>`

    to this

    `if (bp_has_activities(‘action=created_group,new_forum_topic,new_forum_reply’) ) : ?>`


    kraigg
    Participant

    @kraigg

    Thanks kizzywizzy,

    I gave your code a try. It’s getting closer but still not quite there. With your code, it only displays newly created groups, but doesn’t display new topics or new replies at all. New topics and replies only seems to display in the activity stream if I don’t do any sort of filtering, but then it displays all the things I don’t want as well. Thanks for trying though

    Do you think it could be because I’m using the bbPress standalone plugin, instead of the bbPress that comes with BuddyPress?


    kizzywizzy
    Participant

    @kizzywizzy

    Kraigg, look closely at my code.

    `created_group,new_forum_topic,new_forum_reply`

    The code I originally had works andI tried to modify mine to include your forum and topic strings. In other words, I never used my code to include forum and topics so you’ll have to look into your database and find the action that is saved when a new topic and forum is created.

    It could be `created_forum` – I don’t know but I’ll look into it.


    kraigg
    Participant

    @kraigg

    Hi Kizzywizzy, thank you SO much!

    I followed your instructions and was able to find it in my database, in the bp_activity table, ‘type’ field.
    I created a new topic and new reply so I could see what the type was.

    Then I changed the line in my /plugins/bp-custom.php file

    Changed this
    `if ( bp_has_activities($args) ) : ?>`

    to this
    `if (bp_has_activities(‘action=created_group, bbp_topic_create, bbp_reply_create’) ) :`

    Thanks again for all your help!


    kizzywizzy
    Participant

    @kizzywizzy

    @kraigg you’re super welcome!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Filter custom activity stream to display only new groups, new topics, new replies’ is closed to new replies.
Skip to toolbar