Skip to:
Content

BuddyPress.org

Changeset 2626


Ignore:
Timestamp:
02/08/2010 01:26:48 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1816

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums.php

    r2576 r2626  
    386386
    387387    $query = new BB_Query( 'post', $args, 'get_thread' );
    388     return $query->results;
     388    return bp_forums_get_post_extras( $query->results );
    389389}
    390390
     
    450450    return $post;
    451451}
     452
     453function bp_forums_get_post_extras( $posts ) {
     454    global $bp, $wpdb;
     455
     456    if ( empty( $posts ) )
     457        return $posts;
     458
     459    /* Get the user ids */
     460    foreach ( (array)$posts as $post ) $user_ids[] = $post->poster_id;
     461    $user_ids = $wpdb->escape( join( ',', (array)$user_ids ) );
     462
     463    /* Fetch the poster's user_email, user_nicename and user_login */
     464    $poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" ) );
     465
     466    for ( $i = 0; $i < count( $posts ); $i++ ) {
     467        foreach ( (array)$poster_details as $poster ) {
     468            if ( $poster->user_id == $posts[$i]->poster_id ) {
     469                $posts[$i]->poster_email = $poster->user_email;
     470                $posts[$i]->poster_login = $poster->user_nicename;
     471                $posts[$i]->poster_nicename = $poster->user_login;
     472                $posts[$i]->poster_name = $poster->display_name;
     473            }
     474        }
     475    }
     476
     477    /* Fetch fullname for each poster. */
     478    if ( function_exists( 'xprofile_install' ) ) {
     479        $poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" ) );
     480        for ( $i = 0; $i < count( $posts ); $i++ ) {
     481            foreach ( (array)$poster_names as $name ) {
     482                if ( $name->user_id == $topics[$i]->user_id )
     483                $posts[$i]->poster_name = $poster->value;
     484            }
     485        }
     486    }
     487
     488    return $posts;
     489}
     490
    452491
    453492function bp_forums_get_forum_topicpost_count( $forum_id ) {
  • trunk/bp-forums/bp-forums-templatetags.php

    r2594 r2626  
    523523    }
    524524
    525 function bp_the_topic_time_since_last_post( $deprecated = true ) {
     525function bp_the_topic_time_since_last_post() {
    526526    global $forum_template;
    527527
    528     if ( !$deprecated )
    529         return bp_get_the_topic_time_since_last_post();
    530     else
    531         echo bp_get_the_topic_time_since_last_post();
     528    echo bp_get_the_topic_time_since_last_post();
    532529}
    533530    function bp_get_the_topic_time_since_last_post() {
     
    879876    }
    880877
    881 function bp_the_topic_post_poster_name( $deprecated = true ) {
    882     if ( !$deprecated )
    883         return bp_get_the_topic_post_poster_name();
    884     else
    885         echo bp_get_the_topic_post_poster_name();
     878function bp_the_topic_post_poster_name() {
     879    echo bp_get_the_topic_post_poster_name();
    886880}
    887881    function bp_get_the_topic_post_poster_name() {
    888882        global $topic_template;
    889883
    890         if ( !$name = bp_core_get_userlink( $topic_template->post->poster_id ) )
     884        if ( !$link = bp_core_get_user_domain( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) )
    891885            return __( 'Deleted User', 'buddypress' );
    892886
    893         return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_userlink( $topic_template->post->poster_id ) );
    894     }
    895 
    896 function bp_the_topic_post_time_since( $deprecated = true ) {
    897     if ( !$deprecated )
    898         return bp_get_the_topic_post_time_since();
    899     else
    900         echo bp_get_the_topic_post_time_since();
     887        return apply_filters( 'bp_get_the_topic_post_poster_name', '<a href="' . $link . '" title="' . $topic_template->post->poster_name . '">' . $topic_template->post->poster_name . '</a>' );
     888    }
     889
     890function bp_the_topic_post_poster_link() {
     891    echo bp_get_the_topic_post_poster_link();
     892}
     893    function bp_get_the_topic_post_poster_link() {
     894        global $topic_template;
     895
     896        return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_user_domain( $topic_template->post->poster_id, $topic_template->post->poster_nicename, $topic_template->post->poster_login ) );
     897    }
     898
     899function bp_the_topic_post_time_since() {
     900    echo bp_get_the_topic_post_time_since();
    901901}
    902902    function bp_get_the_topic_post_time_since() {
  • trunk/bp-groups/bp-groups-templatetags.php

    r2622 r2626  
    13981398
    13991399        return apply_filters( 'bp_get_group_member_link', '<a href="' . bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) . '">' . $members_template->member->display_name . '</a>' );
     1400    }
     1401
     1402function bp_group_member_domain() {
     1403    echo bp_get_group_member_domain();
     1404}
     1405    function bp_get_group_member_domain() {
     1406        global $members_template;
     1407
     1408        return apply_filters( 'bp_get_group_member_domain', bp_core_get_user_domain( $members_template->member->user_id, $members_template->member->user_nicename, $members_template->member->user_login ) );
    14001409    }
    14011410
  • trunk/bp-themes/bp-default/groups/single/forum/topic.php

    r2460 r2626  
    2929                <li id="post-<?php bp_the_topic_post_id() ?>">
    3030                    <div class="poster-meta">
    31                         <?php bp_the_topic_post_poster_avatar( 'width=40&height=40') ?>
    32                         <?php echo sprintf( __( '%s said %s ago:', 'buddypress' ), bp_the_topic_post_poster_name( false ), bp_the_topic_post_time_since( false ) ) ?>
     31                        <a href="<?php bp_the_topic_post_poster_link() ?>">
     32                            <?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ) ?>
     33                        </a>
     34                        <?php echo sprintf( __( '%s said %s ago:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ) ?>
    3335                    </div>
    3436
  • trunk/bp-themes/bp-default/groups/single/group-header.php

    r2566 r2626  
    2222
    2323<div id="item-header-avatar">
    24     <?php bp_group_avatar() ?>
     24    <a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>">
     25        <?php bp_group_avatar() ?>
     26    </a>
    2527</div><!-- #item-header-avatar -->
    2628
  • trunk/bp-themes/bp-default/groups/single/members.php

    r2551 r2626  
    2121
    2222            <li>
    23                 <?php bp_group_member_avatar_thumb() ?>
     23                <a href="<?php bp_group_member_domain() ?>">
     24                    <?php bp_group_member_avatar_thumb() ?>
     25                </a>
    2426                <h5><?php bp_group_member_link() ?></h5>
    2527                <span class="activity"><?php bp_group_member_joined_since() ?></span>
  • trunk/bp-themes/bp-default/members/single/member-header.php

    r2566 r2626  
    22
    33<div id="item-header-avatar">
    4     <?php bp_displayed_user_avatar( 'type=full' ) ?>
     4    <a href="<?php bp_user_link() ?>">
     5        <?php bp_displayed_user_avatar( 'type=full' ) ?>
     6    </a>
    57</div><!-- #item-header-avatar -->
    68
  • trunk/bp-themes/bp-default/registration/register.php

    r2583 r2626  
    193193                            <?php do_action( 'bp_signup_blog_privacy_errors' ) ?>
    194194
    195                             <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes' ) ?></label>
     195                            <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes' ) ?></label>
    196196                            <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No' ) ?></label>
    197197
Note: See TracChangeset for help on using the changeset viewer.