Skip to:

categories for activity items

  • jazgold


    Filters for the activity feed are important, and there are currently a few, but I need to extend that functionality.

    My users need to be able to filter activity by categories like:

    • Family,
    • Philanthropy,
    • Business… etc.

    I simply want an activity item to have the same categories as the post item it points back to (if it’s a new post item or a related comment).

    I see that there’s a plugin for categorizing everything, , such as entire blogs, or users, or groups… but first off, it doesn’t extend to activity items, and second it is more focused on allowing users to actively categorize things – mine is passive, categorizing automatically, and simply giving users the ability to filter their lists.

    so i came up with a few options, and i think i know which i have to take, but i figured i’d ask the experts, because well… you always have better ideas:)

    1. (least flexible, and messy) modify the component or action fields of the activity items to include the cat, like “new-blog-post-PURPLE.” simple, and i can use the current filtering techniques and get_activity functions, but things can only have one category.

    2. don’t modify anything in the database, but make a separate function with a custom MYSQL query that looks at the activity items and inner joins all the way through (to the post and then to it’s cat relationships) and return only those with the proper cats… ( allows multiple categorization and no database manipulation, but nothing is cached so it seems like a big drain on the server, and a fairly complex mysql statement to figure out)

    3. make a separate Activity-Item-To-Category relationship table. this would bring down the drain on the server per-load a bunch, and allow for multiple categories per activity item… and it would utilize the categories already in the system… but still it would require a custom get-activity function and mysql call to make use of the new db table. this is the one that i think i’ll need to go with however. seems like the most flexible.

    i’m actually hoping that i’ll be able to make use of the core bp classes to render the actual activity feed… for example the time_since function and whatnot.

    but any suggestions for alternate routes, or perhaps simply tips to expedite it?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Be sure to look into the filtering options on the activity loop:




    andy, i think i might be missing something, or perhaps i didn’t explain myself well enough.

    let’s say Good-ol-granny makes two posts. the first post is filed under a category named “Fun,” and the second under “TimeWaster.” (Granny likes using categories)

    When I check out the activity list, I want to be able to filter it so that I only see the stuff categorized under “Fun.” when i activate this filter, i should see posts filed under “Fun,” such as grannie’s, as well as any comments people have made on her post… since they’re related to a “Fun” item.

    is that clearer? perhaps i’m missing something basic, but i can’t see how that’s possible with the built in params.

    and sorry my original post was so long:)




    hrm… was hoping someone would have a bright idea.

    so i guess i’m going with the 3rd solution – a separate table that holds relationships between categories/tags and cached activity items.

    it just means that the relevant records need to be updated every time a post’s tags are updated, or tags are deleted… etc.

    i wish i could split the content up by some built in differentiator, like which blog it’s in… but having a “family” blog distinct from a “business” blog won’t work i think, because some things need to be labeled/categorized, and exist in both places.

    kind of annoying

    Hi there it’s amazing that I came across someone trying to do this a year ago. I am trying to figure this out. I added a radio button black white and would like it to categorize my activity post. But I dont know where i should enter the data into the db or which php file to modify. I only created a non workable radio button above what’s new in postinfo.php but i wouldn’t know where i should update to categorize my post I hope you figured this out will be super!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘categories for activity items’ is closed to new replies.
Skip to toolbar