Skip to:
Content

BuddyPress.org

Changeset 1982


Ignore:
Timestamp:
09/28/2009 10:49:53 PM (17 years ago)
Author:
apeatling
Message:

Fixes #1096 props messenlehner

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1980 r1982  
    572572 */
    573573function bp_core_get_displayed_userid( $user_login ) {
    574     return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid_from_user_login( $user_login ) );
     574    return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid( $user_login ) );
    575575}
    576576
     
    584584 */
    585585function bp_core_new_nav_item( $args = '' ) {
    586     global $bp, $temp_nav;
    587 
    588     $temp_nav[] = $args;
    589    
     586    global $bp;
     587
    590588    $defaults = array(
    591589        'name' => false, // Display name for the nav item
     
    639637}
    640638
     639/**
     640 * bp_core_new_nav_default()
     641 *
     642 * Modify the default subnav item to load when a top level nav item is clicked.
     643 *
     644 * @package BuddyPress Core
     645 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     646 */
     647function bp_core_new_nav_default( $args = '' ) {
     648    global $bp;
     649   
     650    $defaults = array(
     651        'parent_slug' => false, // Slug of the parent
     652        'screen_function' => false, // The name of the function to run when clicked
     653        'subnav_slug' => false // The slug of the subnav item to select when clicked
     654    );
     655
     656    $r = wp_parse_args( $args, $defaults );
     657    extract( $r, EXTR_SKIP );
     658
     659    if ( $bp->current_component == $parent_slug && !$bp->current_action ) {
     660        if ( !is_object( $screen_function[0] ) )
     661            add_action( 'wp', $screen_function, 3 );
     662        else
     663            add_action( 'wp', array( &$screen_function[0], $screen_function[1] ), 3 );
     664
     665        if ( $subnav_slug )
     666            $bp->current_action = $subnav_slug;
     667    }
     668}
    641669
    642670/**
  • trunk/bp-core/deprecated/bp-core-deprecated.php

    r1981 r1982  
    940940}
    941941
    942 /* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() */
     942/* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() OR bp_core_new_nav_default() */
    943943function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) {
    944944    global $bp;
  • trunk/bp-groups.php

    r1976 r1982  
    261261           
    262262            /* Add a new default subnav item for when the groups nav is selected. */
    263             bp_core_add_nav_default( $bp->groups->slug, 'groups_screen_group_home', 'home' );
     263            bp_core_new_nav_default( array( 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_home', 'subnav_slug' => 'home' ) );
    264264           
    265265            /* Add the "Home" subnav item, as this will always be present */
     
    299299    global $bp;
    300300
    301     if ( $bp->current_component == $bp->groups->slug && empty( $bp->current_action ) ) {
     301    if ( $bp->current_component == $bp->groups->slug && empty( $bp->current_action ) && empty( $bp->current_item ) ) {
    302302        $bp->is_directory = true;
    303303
  • trunk/bp-themes/bp-sn-parent/_inc/ajax.php

    r1942 r1982  
    304304            $ud = get_userdata($user_id);
    305305            $username = $ud->user_login;
    306             echo bp_core_get_avatar( $user_id, 1, 15, 15 ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
     306            echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
    307307            ';
    308308        }       
  • trunk/bp-themes/bp-sn-parent/profile/profile-menu.php

    r1905 r1982  
    11<?php do_action( 'bp_before_profile_menu' ) ?>
    22
    3 <?php bp_the_avatar() ?>
     3<?php bp_displayed_user_avatar( 'type=full' ) ?>
    44
    55<div class="button-block">
  • trunk/bp-themes/bp-sn-parent/userbar.php

    r1938 r1982  
    99       
    1010        <p class="avatar">
    11             <?php bp_loggedinuser_avatar_thumbnail() ?>
     11            <?php bp_loggedin_user_avatar( 'type=thumb' ) ?>
    1212        </p>
    1313       
  • trunk/bp-themes/deprecated/bpmember/activity/just-me.php

    r1905 r1982  
    99   
    1010    <div class="left-menu">
    11         <?php bp_the_avatar() ?>
     11        <?php bp_displayed_user_avatar() ?>
    1212       
    1313        <div class="button-block">
Note: See TracChangeset for help on using the changeset viewer.