Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/01/2011 09:47:50 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Allow individual activity stream comments and forum replies to appear in favorites listings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-actions.php

    r3982 r3985  
    1717
    1818    // Not viewing activity
    19     if ( ( $bp->current_component != $bp->activity->id ) || ( $bp->current_action != 'p' ) )
     19    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'p' ) )
    2020        return false;
    2121
     
    6868
    6969    // Not viewing activity or action is not delete
    70     if ( ( $bp->current_component != $bp->activity->id ) || ( $bp->current_action != 'delete' ) )
     70    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'delete' ) )
    7171        return false;
    7272
     
    106106
    107107    // Do not proceed if user is not logged in, not viewing activity, or not posting
    108     if ( !is_user_logged_in() || ( $bp->current_component != $bp->activity->id ) || ( 'post' != $bp->current_action ) )
     108    if ( !is_user_logged_in() || ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'post' ) )
    109109        return false;
    110110
     
    152152    global $bp;
    153153
    154     if ( !is_user_logged_in() || $bp->current_component != $bp->activity->id || $bp->current_action != 'reply' )
     154    if ( !is_user_logged_in() || ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'reply' ) )
    155155        return false;
    156156
     
    184184    global $bp;
    185185
    186     if ( !is_user_logged_in() || $bp->current_component != $bp->activity->slug || $bp->current_action != 'favorite' )
    187         return false;
    188 
    189     /* Check the nonce */
     186    if ( !is_user_logged_in() || ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'favorite' ) )
     187        return false;
     188
     189    // Check the nonce
    190190    check_admin_referer( 'mark_favorite' );
    191191
     
    202202    global $bp;
    203203
    204     if ( !is_user_logged_in() || $bp->current_component != $bp->activity->slug || $bp->current_action != 'unfavorite' )
    205         return false;
    206 
    207     /* Check the nonce */
     204    if ( !is_user_logged_in() || ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'unfavorite' ) )
     205        return false;
     206
     207    // Check the nonce
    208208    check_admin_referer( 'unmark_favorite' );
    209209
     
    220220    global $bp, $wp_query;
    221221
    222     if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id ) || isset( $bp->groups->current_group ) )
     222    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_current_action( 'feed' ) || bp_is_user() || isset( $bp->groups->current_group ) )
    223223        return false;
    224224
     
    234234    global $bp, $wp_query;
    235235
    236     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'feed' )
     236    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_user() || !bp_is_current_action( 'feed' ) )
    237237        return false;
    238238
     
    248248    global $bp, $wp_query;
    249249
    250     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     250    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_user() || !bp_is_current_action( $bp->friends->slug ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    251251        return false;
    252252
     
    262262    global $bp, $wp_query;
    263263
    264     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     264    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_user() || !bp_is_current_action( $bp->groups->slug ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    265265        return false;
    266266
     
    276276    global $bp, $wp_query;
    277277
    278     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'mentions' || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     278    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    279279        return false;
    280280
     
    290290    global $bp, $wp_query;
    291291
    292     if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'favorites' || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     292    if ( ( $bp->activity->slug != bp_current_component() ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    293293        return false;
    294294
Note: See TracChangeset for help on using the changeset viewer.