Changeset 2626
- Timestamp:
- 02/08/2010 01:26:48 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums.php
r2576 r2626 386 386 387 387 $query = new BB_Query( 'post', $args, 'get_thread' ); 388 return $query->results;388 return bp_forums_get_post_extras( $query->results ); 389 389 } 390 390 … … 450 450 return $post; 451 451 } 452 453 function 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 452 491 453 492 function bp_forums_get_forum_topicpost_count( $forum_id ) { -
trunk/bp-forums/bp-forums-templatetags.php
r2594 r2626 523 523 } 524 524 525 function bp_the_topic_time_since_last_post( $deprecated = true) {525 function bp_the_topic_time_since_last_post() { 526 526 global $forum_template; 527 527 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(); 532 529 } 533 530 function bp_get_the_topic_time_since_last_post() { … … 879 876 } 880 877 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(); 878 function bp_the_topic_post_poster_name() { 879 echo bp_get_the_topic_post_poster_name(); 886 880 } 887 881 function bp_get_the_topic_post_poster_name() { 888 882 global $topic_template; 889 883 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 ) ) 891 885 return __( 'Deleted User', 'buddypress' ); 892 886 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 890 function 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 899 function bp_the_topic_post_time_since() { 900 echo bp_get_the_topic_post_time_since(); 901 901 } 902 902 function bp_get_the_topic_post_time_since() { -
trunk/bp-groups/bp-groups-templatetags.php
r2622 r2626 1398 1398 1399 1399 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 1402 function 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 ) ); 1400 1409 } 1401 1410 -
trunk/bp-themes/bp-default/groups/single/forum/topic.php
r2460 r2626 29 29 <li id="post-<?php bp_the_topic_post_id() ?>"> 30 30 <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() ) ?> 33 35 </div> 34 36 -
trunk/bp-themes/bp-default/groups/single/group-header.php
r2566 r2626 22 22 23 23 <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> 25 27 </div><!-- #item-header-avatar --> 26 28 -
trunk/bp-themes/bp-default/groups/single/members.php
r2551 r2626 21 21 22 22 <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> 24 26 <h5><?php bp_group_member_link() ?></h5> 25 27 <span class="activity"><?php bp_group_member_joined_since() ?></span> -
trunk/bp-themes/bp-default/members/single/member-header.php
r2566 r2626 2 2 3 3 <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> 5 7 </div><!-- #item-header-avatar --> 6 8 -
trunk/bp-themes/bp-default/registration/register.php
r2583 r2626 193 193 <?php do_action( 'bp_signup_blog_privacy_errors' ) ?> 194 194 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> 196 196 <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> 197 197
Note: See TracChangeset
for help on using the changeset viewer.