Skip to:
Content
Pages
Categories
Search
Top
Bottom

Recent Topics link to most recent reply


  • welshdemon
    Participant

    @welshdemon

    Hi. Please can somebody tell me how to make the “Recent Topics” widget links, go to the most recent reply?

    As it stands, the links take me to the first post in the topic. Many of my topics are dozens of pages long and people want to go to the most recent reply.

    Many thanks for any help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The ‘Recent Topics’ widget even though it can include ‘Recent Replies’ the widget itself only outputs topic links. The ‘Recent Replies’ widget does link to the most recent reply id.

    I also read your comments on the Trac tickets, we will get the widgets updated, the performance improvements we are making for bbPress 2.6 will most likely affect the widgets also, so we will take a look at the widget tickets at the same time.


    welshdemon
    Participant

    @welshdemon

    As somebody who can bodge/program (quite) basic php code, do you think I could modify this and add a link or might it be difficult? You could potentially save me wasting hours or days of my life trying in futility!

    Thank you.


    welshdemon
    Participant

    @welshdemon

    It’s OK I have nearly got this working. I will post the code soon for anybody who would like it.


    welshdemon
    Participant

    @welshdemon

    In wp-content/plugins/bbpress/includes/common/widgets.php

    At around line 807 I added some code from the recent replies widget:

    
    // Verify the reply ID - TESTING
    $reply_id   = bbp_get_reply_id( $widget_query->post->ID );
    $reply_link = '<a class="bbp-reply-topic-title" href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . esc_attr( bbp_get_reply_excerpt( $reply_id, 50 ) ) . '"> TEST</a>';
    // END TESTING	
    

    Then near line 830 I changed

    
    <div><?php bbp_topic_last_active_time( $topic_id ); ?></div>
    

    to include the code to print the “recent reply” link after the date/time.

    
    <div><?php bbp_topic_last_active_time( $topic_id ); 
    //print latest reply link
    printf( _x( '%1$s',              'widgets', 'bbpress' ), $reply_link);
    ?></div>
    

    welshdemon
    Participant

    @welshdemon

    Oh to change your recent reply link text, for anyone who is more of a newbie than myself, you change the word TEST in the $reply_link line – change this to whatever, I think will use an (little arrow)…


    welshdemon
    Participant

    @welshdemon

    sorry. it doesnt work after all.

    The URLS now show a post id, which made me think it was linking to the most recent reply. But it still just goes to the beginning :(

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.