Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress 1.2.8 – How do I add a new Activity Filter option?


  • Phil Meyer
    Participant

    @philmeyer

    I want to add another option to the Activity Filter drop-down list, that will filter out everything but stuff that concerns the logged-in user. So selecting that option he’ll see all updates (his own and those of his friends/followers), likes, blog posts, comments, etc, etc. that are in some way connected to him, but everything that’s completely unrelated will be hidden. And then I want to make this option the default one.

    Could anyone help me out with some code? I’m not a programmer, so it would have to be quite clear and concise. ;)

    Thanks,
    Phil

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

  • Phil Meyer
    Participant

    @philmeyer

    Crikey – nobody?


    Phil Meyer
    Participant

    @philmeyer

    I can’t BELIEVE no-one wants to / can help me out with this! Please guys, I’m pretty desperate here…


    Boone Gorges
    Keymaster

    @boonebgorges

    It is not trivial to do this. That’s probably why no one has jumped in. It would take a developer a few hours to get this working correctly. I am happy to give you some pointers, though I’m unsure how useful it will be.

    The activity filter dropdown works by feeding parameters into the bp_has_members() loop. But that loop does not accept any parameters like “connected-to-him”. It does accept user_id and scope params, so you can get all of a user’s friends’ activity fairly easily. I’m not sure if this is what you mean by “related” and “unrelated”. If you want something above and beyond “friends”, then it’ll have to happen by means of a custom query.

    Making an activity filter the default involves a few things. First, you have to ensure that the correct dropdown option is selected onload. That can probably be done easily enough at the template level. Then you have to filter the output of bp_ajax_querystring, so that when there are no other scope items being passed, you add the user_id and friends arguments to the query string. If you search these forums for bp_ajax_querystring, you should be able to get some hints.

    As I said above, this will probably take a competent BP developer a few hours to implement – more if you need some complex query for the notion of “related” activity. Maybe that will help you BELIEVE why no one has jumped in to solve with a magical line of code :)


    Phil Meyer
    Participant

    @philmeyer

    LOL… thanks Boone! I suspected it might not be a quick fix. What I needed was someone to at least just react and tell me that – like you did. ;) I reckon this might ask for a custom plugin to be written. Do you think that’s doable by a competent developer?

    Basically what I wanted was an additional option that would exclude updates from anyone that are not friends or followers of the logged in user, and from groups or forums that have nothing to do with him. I might look for someone who will write me such a plugin for a reasonable fee.

    Thanks again for your answer! :)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BuddyPress 1.2.8 – How do I add a new Activity Filter option?’ is closed to new replies.
Skip to toolbar