Skip to:
Content

BuddyPress.org

Ticket #723: wire_patch_three.patch

File wire_patch_three.patch, 5.4 KB (added by burtadsit, 15 years ago)

Includes all previously found issues. Includes a fix for the problem changing the BP_WIRE_SLUG and hardcoded /groups in groups widget

  • bp-groups.php

     
    268268                                bp_core_add_subnav_item( $bp->groups->slug, 'forum', __('Forum', 'buddypress'), $group_link , 'groups_screen_group_forum', 'group-forum', $is_visible);
    269269
    270270                        if ( $has_access && $group_obj->enable_wire && function_exists('bp_wire_install') )
    271                                 bp_core_add_subnav_item( $bp->groups->slug, 'wire', __('Wire', 'buddypress'), $group_link, 'groups_screen_group_wire', 'group-wire', $is_visible );
     271                                bp_core_add_subnav_item( $bp->groups->slug, $bp->wire->slug, __('Wire', 'buddypress'), $group_link, 'groups_screen_group_wire', 'group-wire', $is_visible );
    272272
    273273                        if ( $has_access && $group_obj->enable_photos && function_exists('bp_gallery_install') )
    274274                                bp_core_add_subnav_item( $bp->groups->slug, 'photos', __('Photos', 'buddypress'), $group_link, 'groups_screen_group_photos', 'group-photos', $is_visible );
  • bp-groups/bp-groups-widgets.php

     
    4040        <?php if ( $groups['groups'] ) : ?>
    4141                <div class="item-options" id="groups-list-options">
    4242                        <img id="ajax-loader-groups" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
    43                         <a href="<?php echo site_url() . '/groups' ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
    44                         <a href="<?php echo site_url() . '/groups' ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
    45                         <a href="<?php echo site_url() . '/groups' ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
     43                        <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
     44                        <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
     45                        <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
    4646                </div>
    4747                <ul id="groups-list" class="item-list">
    4848                        <?php foreach ( $groups['groups'] as $group_id ) : ?>
  • bp-wire.php

     
    9191                return false;
    9292       
    9393        if ( !$table_name )
    94                 $table_name = $bp->{$component_name}->table_name_wire;
     94                $table_name = $bp->groups->table_name_wire;
    9595
    9696        $wire_post = new BP_Wire_Post( $table_name );
    9797        $wire_post->item_id = $item_id;
     
    123123                return false;
    124124
    125125        if ( !$table_name )
    126                 $table_name = $bp->{$component_name}->table_name_wire;
     126                $table_name = $bp->groups->table_name_wire;
    127127       
    128128        $wire_post = new BP_Wire_Post( $table_name, $wire_post_id );
    129129       
  • bp-wire/bp-wire-templatetags.php

     
    2020        function bp_wire_posts_template( $item_id, $component_slug, $can_post, $per_page, $max ) {
    2121                global $bp;
    2222               
    23                 if ( $bp->current_component == $bp->wire->slug ) {
     23                if ( $bp->current_component == $bp->wire->slug || 'profile' == $bp->current_component ) {
    2424                        $this->table_name = $bp->profile->table_name_wire;
    2525                       
    2626                        // If the user is viewing their own wire, delete the notifications.
     
    2828                                bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'xprofile', 'new_wire_post' );
    2929                       
    3030                } else {
    31                         $this->table_name = $bp->{$component_slug}->table_name_wire;
     31                        $this->table_name = $bp->groups->table_name_wire;
    3232                }
    3333               
    3434                $this->pag_page = isset( $_REQUEST['wpage'] ) ? intval( $_REQUEST['wpage'] ) : 1;
     
    315315                if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) {
    316316                        return apply_filters( 'bp_get_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' );
    317317                } else {
    318                         return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp->current_component}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' );
     318                        return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->groups->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' );
    319319                }
    320320        }
    321321
     
    365365                        if ( $bp->wire->slug == $bp->current_component || $bp->profile->slug == $bp->current_component ) {
    366366                                return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
    367367                        } else {
    368                                 return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
     368                                return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( site_url( $bp->groups->slug . '/' . $uri . '/' . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' );
    369369                        }
    370370                }
    371371        }