Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide forum post content in activity streams?


  • andrew55
    Participant

    @andrew55

    We have bbPress integrated with BuddyPress. We have an educational based membership site which is lesson based. The member’s access to forums in bbPress is controlled by what lesson student currently has, so if a student isn’t on lesson 5 yet, they can’t see the forum for lesson 5.

    When any student creates a topic/reply in a forum, this shows in the activity stream of BuddyPress (personal and site-wide). Because we do not want students reading topics/replies of forums they don’t have access to yet, is there a method of hiding just the content of the topic/reply in the activity streams within BuddyPress?

    We would love to keep the topic/reply titles and and participants in the activity stream, just not the content/excerpt.

    I seen in the activity steam, there is a div class “activity-inner”

    I could hide this using css, but that would hide all the content for all activity updates. We only want to hide the content/excerpt for bbPress topic/reply content. Thanks for any help with this.

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

  • andrew55
    Participant

    @andrew55

    Is there a function that can be used to simply hide a div class, just within BuddyPress?

    I think I can easily add an extra div to the content area of all posts in bbPress, and this would allow me to hide the content area of bbPress posts in BuddyPress.

    I’ve been searching for such a funtion, and can’t seem to find anything. Thanks for any help.


    andrew55
    Participant

    @andrew55

    I’m still testing, but I think this does it:

    .activity-list li.bbp_topic_create .activity-content .activity-inner, .activity-list li.bbp_reply_create .activity-content .activity-inner {
    	display: none !important;
    }

    It shows bbPress forum titles in BuddyPress activity streams, but not content of the bbPress reply/post. I’m still checking to see if it might cause problems somewhere else, but so far, I don’t see any.

    Hope this helps anyone who might need it.


    andrew55
    Participant

    @andrew55

    Actually, this isn’t working right. I prevents any bbPress topic/replies from being posting on activity walls at all (even just the titles). I guess it’s back to the drawing board.

    I’m wondering if this might do it – putting a div class around the topic/reply content in the template files of bbPress, and then only hiding this div in BuddyPress. But then I’m thinking it might result in the same issue – nothing topic/replies show in activity wall at all.

    Any suggestions greatly appreciated.


    Henry Wright
    Moderator

    @henrywright

    Hi @andrew55

    I think bp_get_activity_content_body is a filter you could use for this. You’d need to find out the activity ‘type’ and conditionally filter out the content.


    andrew55
    Participant

    @andrew55

    @henrywright – thanks for the reply. I’m new to BuddyPress and not exactly a “master coder.”

    Do you have any suggested resources on where I might find out more about your recommendation? Thanks for any help.


    Henry Wright
    Moderator

    @henrywright

    Sure!

    See here for where your filter will be applied. Here is documentation on apply_filters_ref_array() (it’s almost identical to apply_filters()). And you’ll need to use add_filter() to hook your filter function to the hook.

    If you’re new to filter hooks, try searching for some tutorials, there’s so much info available already. Hope this info helps!


    andrew55
    Participant

    @andrew55

    Thanks for all the great resources.

    Unfortunately, this is way over me head. Writing php from scratch is not a skill I’ve yet developed. I’ll keep messing with it, but if anyone has any suggestions, I’d be appreciative.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hide forum post content in activity streams?’ is closed to new replies.
Skip to toolbar