Changeset 1021 for trunk/bp-wire.php
- Timestamp:
- 02/06/2009 03:07:48 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-wire.php
r974 r1021 27 27 global $bp, $wpdb; 28 28 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; 33 31 34 $bp ['version_numbers'][$bp['wire']['slug']]= BP_WIRE_VERSION;32 $bp->version_numbers->wire = BP_WIRE_VERSION; 35 33 } 36 34 add_action( 'wp', 'bp_wire_setup_globals', 1 ); … … 47 45 48 46 /* 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' ); 51 49 52 50 /* 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' ); 54 52 55 if ( $bp ['current_component'] == $bp['wire']['slug']) {53 if ( $bp->current_component == $bp->wire->slug ) { 56 54 if ( bp_is_home() ) { 57 $bp ['bp_options_title']= __('My Wire', 'buddypress');55 $bp->bp_options_title = __('My Wire', 'buddypress'); 58 56 } 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; 61 59 } 62 60 } … … 75 73 if ( function_exists('bp_activity_record') ) { 76 74 extract($args); 75 77 76 bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id ); 78 77 } … … 93 92 94 93 if ( !$table_name ) 95 $table_name = $bp [$component_name]['table_name_wire'];94 $table_name = $bp->{$component_name}->table_name_wire; 96 95 97 96 $wire_post = new BP_Wire_Post( $table_name ); 98 97 $wire_post->item_id = $item_id; 99 $wire_post->user_id = $bp ['loggedin_userid'];98 $wire_post->user_id = $bp->loggedin_user->id; 100 99 $wire_post->date_posted = time(); 101 102 100 103 101 $allowed_tags = apply_filters( 'bp_wire_post_allowed_tags', '<a>,<b>,<strong>,<i>,<em>,<img>' ); … … 126 124 127 125 if ( !$table_name ) 128 $table_name = $bp [$component_name]['table_name_wire'];126 $table_name = $bp->{$component_name}->table_name_wire; 129 127 130 128 $wire_post = new BP_Wire_Post( $table_name, $wire_post_id ); 131 129 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 ) 134 132 return false; 135 133 }
Note: See TracChangeset
for help on using the changeset viewer.