Skip to:
Content

bbPress.org

Changeset 6592


Ignore:
Timestamp:
06/19/2017 10:23:03 AM (8 years ago)
Author:
johnjamesjacoby
Message:

Users: Add user_url, user_registered, and last-active to profiles.

Also divide profile page up into 2 sections: Profile & Forums.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/options.php

    r6573 r6592  
    330330 */
    331331function bbp_user_last_posted( $user_id = 0 ) {
    332     echo bbp_get_user_last_posted( $user_id );
     332    echo esc_html( bbp_get_user_last_posted( $user_id ) );
    333333}
    334334
  • trunk/src/templates/default/bbpress/user-profile.php

    r6355 r6592  
    1414
    1515<div id="bbp-user-profile" class="bbp-user-profile">
    16     <h2 class="entry-title"><?php esc_html_e( 'Profile', 'bbpress' ); ?></h2>
     16    <h2 class="entry-title">@<?php bbp_displayed_user_field( 'user_nicename' ); ?></h2>
    1717    <div class="bbp-user-section">
     18        <h3><?php esc_html_e( 'Profile', 'bbpress' ); ?></h3>
     19        <p class="bbp-user-forum-role"><?php  printf( esc_html__( 'Registered: %s', 'bbpress' ), bbp_get_time_since( bbp_get_displayed_user_field( 'user_registered' ) ) ); ?></p>
    1820
    1921        <?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>
     
    2325        <?php endif; ?>
    2426
    25         <p class="bbp-user-forum-role"><?php  printf( esc_html__( 'Forum Role: %s',      'bbpress' ), bbp_get_user_display_role()    ); ?></p>
    26         <p class="bbp-user-topic-count"><?php printf( esc_html__( 'Topics Started: %s',  'bbpress' ), bbp_get_user_topic_count_raw() ); ?></p>
    27         <p class="bbp-user-reply-count"><?php printf( esc_html__( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count_raw() ); ?></p>
     27        <?php if ( bbp_get_displayed_user_field( 'user_url' ) ) : ?>
     28
     29            <p class="bbp-user-website"><?php  printf( esc_html__( 'Website: %s', 'bbpress' ), bbp_rel_nofollow( bbp_make_clickable( bbp_get_displayed_user_field( 'user_url' ) ) ) ); ?></p>
     30
     31        <?php endif; ?>
     32
     33        <hr>
     34        <h3><?php esc_html_e( 'Forums', 'bbpress' ); ?></h3>
     35
     36        <?php if ( bbp_get_user_last_posted() ) : ?>
     37
     38            <p class="bbp-user-topic-count"><?php printf( esc_html__( 'Last Activity: %s',  'bbpress' ), bbp_get_time_since( bbp_get_user_last_posted() ) ); ?></p>
     39
     40        <?php endif; ?>
     41
     42        <p class="bbp-user-topic-count"><?php printf( esc_html__( 'Topics Started: %s',  'bbpress' ), bbp_get_user_topic_count() ); ?></p>
     43        <p class="bbp-user-reply-count"><?php printf( esc_html__( 'Replies Created: %s', 'bbpress' ), bbp_get_user_reply_count() ); ?></p>
     44        <p class="bbp-user-forum-role"><?php  printf( esc_html__( 'Forum Role: %s',      'bbpress' ), bbp_get_user_display_role() ); ?></p>
    2845    </div>
    2946</div><!-- #bbp-author-topics-started -->
Note: See TracChangeset for help on using the changeset viewer.