Skip to:
Content
Pages
Categories
Search
Top
Bottom

How would I show “next topic in forum”?

  • @3sixty

    Participant

    Similar to the WordPress “Next Post in Category” function ( next_post_link() ) , how would I display the next and previous topics at the topic of a specific topic page in the BP template (topic.php)?

    I noticed there is a next_topic() function as part of the class BP_Forums_Template_Topic, but my php knowledge stops short of figuring out what a class function is and how to work with it (or even if it would work here).

    Is that class function the way to go, or is there a better or simpler way to display the next and previous topics in a category?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @nuprn1

    Participant

    When viewing an actual topic – you’re within the scope of the BP_Forums_Template_Topic class instead. So you don’t have a handle to what is the previous or next topic is (since we are dealing with posts)

    If you think about it more – it would be hard to build that reference in a forum environment. What if someone replied to a different topic and it was bumped above the current topic being read? Where as in blog posts – they are static based on the time.

    @3sixty

    Participant

    That’s exactly what I’m trying to do – move to the next or previous post based on the original topic time, not the most recent comment time. Not sure if this exists in bbPress but it’s a core navigational feature of phpbb. When I get a chance I’m going to look at bbpress/phpbb code to see how they handle it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How would I show “next topic in forum”?’ is closed to new replies.
Skip to toolbar