Making WordPress.org


Ignore:
Timestamp:
07/07/2017 05:39:52 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Support Theme: Add two views to user profiles to allow for browsing topics ordered by recent activity:

  • "Active Topics" shows the user's topics with recent replies, ordered by latest reply.
  • "Topics Replied To" shows all topics the user has replied to (including topics started by others), ordered by latest reply.

Fixes #2470.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/bbpress/loop-single-reply-topic.php

    r5622 r5626  
    1 <ul id="bbp-topic-<?php bbp_topic_id(); ?>" <?php bbp_topic_class(); ?>>
     1<?php $topic_id = bbp_get_reply_topic_id(); ?>
     2
     3<ul id="bbp-topic-<?php bbp_topic_id( $topic_id ); ?>" <?php bbp_topic_class( $topic_id ); ?>>
    24
    35    <li class="bbp-topic-title">
    46
    5         <?php if ( bbp_is_user_home() ) : ?>
    6 
    7             <?php if ( bbp_is_favorites() ) : ?>
    8 
    9                 <span class="bbp-topic-action">
    10 
    11                     <?php do_action( 'bbp_theme_before_topic_favorites_action' ); ?>
    12 
    13                     <?php bbp_user_favorites_link( array( 'before' => '', 'favorite' => '+', 'favorited' => '&times;' ) ); ?>
    14 
    15                     <?php do_action( 'bbp_theme_after_topic_favorites_action' ); ?>
    16 
    17                 </span>
    18 
    19             <?php elseif ( bbp_is_subscriptions() ) : ?>
    20 
    21                 <span class="bbp-topic-action">
    22 
    23                     <?php do_action( 'bbp_theme_before_topic_subscription_action' ); ?>
    24 
    25                     <?php bbp_user_subscribe_link( array( 'before' => '', 'subscribe' => '+', 'unsubscribe' => '&times;' ) ); ?>
    26 
    27                     <?php do_action( 'bbp_theme_after_topic_subscription_action' ); ?>
    28 
    29                 </span>
    30 
    31             <?php endif; ?>
    32 
    33         <?php endif; ?>
    34 
    357        <?php do_action( 'bbp_theme_before_topic_title' ); ?>
    368
    37         <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink(); ?>"><?php bbp_topic_title(); ?></a>
     9        <a class="bbp-topic-permalink" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>
    3810
    3911        <?php do_action( 'bbp_theme_after_topic_title' ); ?>
    4012
    41         <?php bbp_topic_pagination(); ?>
     13        <?php bbp_topic_pagination( array( 'topic_id' => $topic_id ) ); ?>
    4214
    4315        <?php do_action( 'bbp_theme_before_topic_meta' ); ?>
     
    4719            <?php do_action( 'bbp_theme_before_topic_started_by' ); ?>
    4820
    49             <span class="bbp-topic-started-by"><?php printf( __( 'Started by: %1$s', 'wporg-forums' ), bbp_get_topic_author_link( array( 'size' => '14' ) ) ); ?></span>
     21            <span class="bbp-topic-started-by"><?php printf( __( 'Started by: %1$s', 'wporg-forums' ), bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'size' => '14' ) ) ); ?></span>
    5022
    5123            <?php do_action( 'bbp_theme_after_topic_started_by' ); ?>
    5224
    53             <?php if ( ( bbp_is_single_view() && ! wporg_support_is_compat_view() ) || ( bbp_is_single_forum() && bbp_get_topic_forum_id() != bbp_get_forum_id() ) || bbp_is_single_user_topics() ) : ?>
     25            <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
    5426
    55                 <?php do_action( 'bbp_theme_before_topic_started_in' ); ?>
     27            <span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'wporg-forums' ), bbp_get_forum_permalink( bbp_get_topic_forum_id( $topic_id ) ), bbp_get_forum_title( bbp_get_topic_forum_id( $topic_id ) ) ); ?></span>
    5628
    57                 <span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'wporg-forums' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
    58 
    59                 <?php do_action( 'bbp_theme_after_topic_started_in' ); ?>
    60 
    61             <?php endif; ?>
     29            <?php do_action( 'bbp_theme_after_topic_started_in' ); ?>
    6230
    6331        </p>
     
    6937    </li>
    7038
    71     <li class="bbp-topic-voice-count"><?php bbp_topic_voice_count(); ?></li>
     39    <li class="bbp-topic-voice-count"><?php bbp_topic_voice_count( $topic_id ); ?></li>
    7240
    73     <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?></li>
     41    <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count( $topic_id ) : bbp_topic_post_count( $topic_id ); ?></li>
    7442
    7543    <li class="bbp-topic-freshness">
     
    7745        <?php do_action( 'bbp_theme_before_topic_freshness_link' ); ?>
    7846
    79         <?php bbp_topic_freshness_link(); ?>
     47        <?php bbp_topic_freshness_link( $topic_id ); ?>
    8048
    8149        <?php do_action( 'bbp_theme_after_topic_freshness_link' ); ?>
     
    8553            <?php do_action( 'bbp_theme_before_topic_freshness_author' ); ?>
    8654
    87             <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_topic_last_active_id(), 'size' => 14 ) ); ?></span>
     55            <span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_topic_last_active_id( $topic_id ), 'size' => 14 ) ); ?></span>
    8856
    8957            <?php do_action( 'bbp_theme_after_topic_freshness_author' ); ?>
     
    9260    </li>
    9361
    94 </ul><!-- #bbp-topic-<?php bbp_topic_id(); ?> -->
     62</ul><!-- #bbp-topic-<?php bbp_topic_id( $topic_id ); ?> -->
Note: See TracChangeset for help on using the changeset viewer.