Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/06/2009 03:07:48 AM (17 years ago)
Author:
apeatling
Message:

Converted $bp as an array to $bp as an object. See this post for more info: http://buddypress.org/forums/topic.php?id=1125

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-wire/bp-wire-templatetags.php

    r900 r1021  
    2121                global $bp;
    2222               
    23                 if ( $bp['current_component'] == $bp['wire']['slug'] ) {
    24                         $this->table_name = $bp['profile']['table_name_wire'];
     23                if ( $bp->current_component == $bp->wire->slug ) {
     24                        $this->table_name = $bp->profile->table_name_wire;
    2525                       
    2626                        // Seeing as we're viewing a users wire, lets remove any new wire
    2727                        // post notifications
    28                         if ( $bp['current_action'] == 'all-posts' )
    29                                 bp_core_delete_notifications_for_user_by_type( $bp['loggedin_userid'], 'xprofile', 'new_wire_post' );
     28                        if ( $bp->current_action == 'all-posts' )
     29                                bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'xprofile', 'new_wire_post' );
    3030                       
    3131                } else {
    32                         $this->table_name = $bp[$bp['current_component']]['table_name_wire'];
     32                        $this->table_name = $bp->{$bp->current_component}->table_name_wire;
    3333                }
    3434               
     
    4242                $this->wire_post_count = count($this->wire_posts);
    4343               
    44                 if ( (int)get_site_option('non-friend-wire-posting') && ( $bp['current_component'] == $bp['profile']['slug'] || $bp['current_component'] == $bp['wire']['slug'] ) )
     44                if ( (int)get_site_option('non-friend-wire-posting') && ( $bp->current_component == $bp->profile->slug || $bp->current_component == $bp->wire->slug ) )
    4545                        $this->can_post = 1;
    4646                else
     
    4848               
    4949                $this->pag_links = paginate_links( array(
    50                         'base' => add_query_arg( 'wpage', '%#%', $bp['current_domain'] ),
     50                        'base' => add_query_arg( 'wpage', '%#%', $bp->displayed_user->domain ),
    5151                        'format' => '',
    5252                        'total' => ceil($this->total_wire_post_count / $this->pag_num),
     
    217217        global $bp;
    218218       
    219         echo apply_filters( 'bp_wire_ajax_loader_src', $bp['wire']['image_base'] . '/ajax-loader.gif' );
     219        echo apply_filters( 'bp_wire_ajax_loader_src', $bp->wire->image_base . '/ajax-loader.gif' );
    220220}
    221221
     
    257257        global $bp;
    258258       
    259         if ( $bp['current_item'] == '')
    260                 $uri = $bp['current_action'];
    261         else
    262                 $uri = $bp['current_item'];
    263        
    264         if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile' ) {
    265                 echo apply_filters( 'bp_wire_get_action', $bp['current_domain'] . $bp['wire']['slug'] . '/post/' );
     259        if ( empty( $bp->current_item ) )
     260                $uri = $bp->current_action;
     261        else
     262                $uri = $bp->current_item;
     263       
     264        if ( $bp->current_component == 'wire' || $bp->current_component == 'profile' ) {
     265                echo apply_filters( 'bp_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' );
    266266        } else {
    267                 echo apply_filters( 'bp_wire_get_action', site_url() . '/' . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/post/' );
     267                echo apply_filters( 'bp_wire_get_action', site_url() . '/' . $bp[$bp->current_component]['slug'] . '/' . $uri . '/wire/post/' );
    268268        }
    269269}
     
    272272        global $bp;
    273273       
    274         echo apply_filters( 'bp_wire_poster_avatar', bp_core_get_avatar( $bp['loggedin_userid'], 1 ) );
     274        echo apply_filters( 'bp_wire_poster_avatar', bp_core_get_avatar( $bp->loggedin_user->id, 1 ) );
    275275}
    276276
     
    279279       
    280280        if ( $echo )
    281                 echo apply_filters( 'bp_wire_poster_name', '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>' );
    282         else
    283                 return apply_filters( 'bp_wire_poster_name', '<a href="' . $bp['loggedin_domain'] . $bp['profile']['slug'] . '">' . __('You', 'buddypress') . '</a>' );
     281                echo apply_filters( 'bp_wire_poster_name', '<a href="' . $bp->loggedin_user->domain . $bp->profile->slug . '">' . __('You', 'buddypress') . '</a>' );
     282        else
     283                return apply_filters( 'bp_wire_poster_name', '<a href="' . $bp->loggedin_user->domain . $bp->profile->slug . '">' . __('You', 'buddypress') . '</a>' );
    284284}
    285285
     
    297297        global $wire_posts_template, $bp;
    298298
    299         if ( $bp['current_item'] == '')
    300                 $uri = $bp['current_action'];
    301         else
    302                 $uri = $bp['current_item'];
    303                
    304         if ( ( $wire_posts_template->wire_post->user_id == $bp['loggedin_userid'] ) || $bp['is_item_admin'] ) {
    305                 if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile' ) {
    306                         echo apply_filters( 'bp_wire_delete_link', '<a href="' . $bp['current_domain'] . $bp['wire']['slug'] . '/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' );
     299        if ( empty( $bp->current_item ) )
     300                $uri = $bp->current_action;
     301        else
     302                $uri = $bp->current_item;
     303               
     304        if ( ( $wire_posts_template->wire_post->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin ) {
     305                if ( $bp->current_component == 'wire' || $bp->current_component == 'profile' ) {
     306                        echo apply_filters( 'bp_wire_delete_link', '<a href="' . $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' );
    307307                } else {
    308                         echo apply_filters( 'bp_wire_delete_link', '<a href="' . site_url() . '/' . $bp[$bp['current_component']]['slug'] . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' );
     308                        echo apply_filters( 'bp_wire_delete_link', '<a href="' . site_url() . '/' . $bp[$bp->current_component]['slug'] . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id . '">[' . __('Delete', 'buddypress') . ']</a>' );
    309309                }
    310310        }
     
    314314        global $bp;
    315315       
    316         if ( $bp['current_item'] == '')
    317                 $uri = $bp['current_action'];
    318         else
    319                 $uri = $bp['current_item'];
    320        
    321         if ( $bp['current_component'] == 'wire' || $bp['current_component'] == 'profile') {
    322                 echo apply_filters( 'bp_wire_see_all_link', $bp['current_domain'] . $bp['wire']['slug'] );
     316        if ( empty( $bp->current_item ) )
     317                $uri = $bp->current_action;
     318        else
     319                $uri = $bp->current_item;
     320       
     321        if ( $bp->current_component == 'wire' || $bp->current_component == 'profile') {
     322                echo apply_filters( 'bp_wire_see_all_link', $bp->displayed_user->domain . $bp->wire->slug );
    323323        } else {
    324                 echo apply_filters( 'bp_wire_see_all_link', $bp['root_domain'] . '/' . $bp['groups']['slug'] . '/' . $uri . '/wire' );
     324                echo apply_filters( 'bp_wire_see_all_link', $bp->root_domain . '/' . $bp->groups->slug . '/' . $uri . '/wire' );
    325325        }
    326326}
Note: See TracChangeset for help on using the changeset viewer.