Skip to:
Content

BuddyPress.org

Changeset 1021 for trunk/bp-wire.php


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.php

    r974 r1021  
    2727        global $bp, $wpdb;
    2828       
    29         $bp['wire'] = array(
    30                 'image_base' => site_url( MUPLUGINDIR . '/bp-wire/images' ),
    31                 'slug'           => BP_WIRE_SLUG
    32         );
     29        $bp->wire->image_base = site_url( MUPLUGINDIR . '/bp-wire/images' );
     30        $bp->wire->slug = BP_WIRE_SLUG;
    3331
    34         $bp['version_numbers'][$bp['wire']['slug']] = BP_WIRE_VERSION;
     32        $bp->version_numbers->wire = BP_WIRE_VERSION;
    3533}
    3634add_action( 'wp', 'bp_wire_setup_globals', 1 );
     
    4745
    4846        /* Add 'Wire' to the main navigation */
    49         bp_core_add_nav_item( __('Wire', 'buddypress'), $bp['wire']['slug'] );
    50         bp_core_add_nav_default( $bp['wire']['slug'], 'bp_wire_screen_latest', 'all-posts' );
     47        bp_core_add_nav_item( __('Wire', 'buddypress'), $bp->wire->slug );
     48        bp_core_add_nav_default( $bp->wire->slug, 'bp_wire_screen_latest', 'all-posts' );
    5149
    5250        /* Add the subnav items to the wire nav */
    53         bp_core_add_subnav_item( $bp['wire']['slug'], 'all-posts', __('All Posts', 'buddypress'), $bp['loggedin_domain'] . $bp['wire']['slug'] . '/', 'bp_wire_screen_latest' );
     51        bp_core_add_subnav_item( $bp->wire->slug, 'all-posts', __('All Posts', 'buddypress'), $bp->loggedin_user->domain . $bp->wire->slug . '/', 'bp_wire_screen_latest' );
    5452       
    55         if ( $bp['current_component'] == $bp['wire']['slug'] ) {
     53        if ( $bp->current_component == $bp->wire->slug ) {
    5654                if ( bp_is_home() ) {
    57                         $bp['bp_options_title'] = __('My Wire', 'buddypress');
     55                        $bp->bp_options_title = __('My Wire', 'buddypress');
    5856                } else {
    59                         $bp['bp_options_avatar'] = bp_core_get_avatar( $bp['current_userid'], 1 );
    60                         $bp['bp_options_title'] = $bp['current_fullname'];
     57                        $bp->bp_options_avatar = bp_core_get_avatar( $bp->displayed_user->id, 1 );
     58                        $bp->bp_options_title = $bp->displayed_user->fullname;
    6159                }
    6260        }
     
    7573        if ( function_exists('bp_activity_record') ) {
    7674                extract($args);
     75
    7776                bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id );
    7877        }
     
    9392       
    9493        if ( !$table_name )
    95                 $table_name = $bp[$component_name]['table_name_wire'];
     94                $table_name = $bp->{$component_name}->table_name_wire;
    9695
    9796        $wire_post = new BP_Wire_Post( $table_name );
    9897        $wire_post->item_id = $item_id;
    99         $wire_post->user_id = $bp['loggedin_userid'];
     98        $wire_post->user_id = $bp->loggedin_user->id;
    10099        $wire_post->date_posted = time();
    101        
    102100
    103101        $allowed_tags = apply_filters( 'bp_wire_post_allowed_tags', '<a>,<b>,<strong>,<i>,<em>,<img>' );
     
    126124
    127125        if ( !$table_name )
    128                 $table_name = $bp[$component_name]['table_name_wire'];
     126                $table_name = $bp->{$component_name}->table_name_wire;
    129127       
    130128        $wire_post = new BP_Wire_Post( $table_name, $wire_post_id );
    131129       
    132         if ( !$bp['is_item_admin'] ) {
    133                 if ( $wire_post->user_id != $bp['loggedin_userid'] )
     130        if ( !$bp->is_item_admin ) {
     131                if ( $wire_post->user_id != $bp->loggedin_user->id )
    134132                        return false;
    135133        }
Note: See TracChangeset for help on using the changeset viewer.