Skip to:
Content
Pages
Categories
Search
Top
Bottom

Easy way to check if topic is subscribed?


  • Shmoo
    Participant

    @macpresss

    Just curious if there is an easy way to check if a user has been subscribed to a topic or not..

    I’ve looked inside the Core templates and found the bbp_user_subscribe_link() function so I ported it over to my own functions file and changed it a little bit, now it works on the topics index page but for some reason it breaks at my topic-replies index page while they use the same default topics loop.

    This is my code I’ve changed around a little and what it does is, it prints an is-subscribed text to the page if a user is subscribed to an topic or not. IF not is doesn’t do anything – this is-subscribed text I placed inside a HTML class so I can catch him by some CSS.

    http://pastebin.com/iFybkjfr

    Visual, the 1px colored borders on the right indicate if a topic is-subscribed (blue), is-closed (black) or is-sticky (yellow).

    It’s a very small feature but I believe very effective, maybe it’s possible to hook those is-values into the bbp_topic_class() by default because BuddyPress has this feature out of the box. If you’re a member of a group it also prints is-member inside the groups-list-class.

    Anybody ideas about how we could make this more smooth and simple?

  • You must be logged in to reply to this topic.
Skip to toolbar