Changeset 3985
- Timestamp:
- 02/01/2011 09:47:50 PM (14 years ago)
- Location:
- trunk/bp-activity
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-actions.php
r3982 r3985 17 17 18 18 // 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' ) ) 20 20 return false; 21 21 … … 68 68 69 69 // 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' ) ) 71 71 return false; 72 72 … … 106 106 107 107 // 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' ) ) 109 109 return false; 110 110 … … 152 152 global $bp; 153 153 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' ) ) 155 155 return false; 156 156 … … 184 184 global $bp; 185 185 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 190 190 check_admin_referer( 'mark_favorite' ); 191 191 … … 202 202 global $bp; 203 203 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 208 208 check_admin_referer( 'unmark_favorite' ); 209 209 … … 220 220 global $bp, $wp_query; 221 221 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 ) ) 223 223 return false; 224 224 … … 234 234 global $bp, $wp_query; 235 235 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' ) ) 237 237 return false; 238 238 … … 248 248 global $bp, $wp_query; 249 249 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' ) 251 251 return false; 252 252 … … 262 262 global $bp, $wp_query; 263 263 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' ) 265 265 return false; 266 266 … … 276 276 global $bp, $wp_query; 277 277 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' ) 279 279 return false; 280 280 … … 290 290 global $bp, $wp_query; 291 291 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' ) 293 293 return false; 294 294 -
trunk/bp-activity/bp-activity-classes.php
r3917 r3985 134 134 // comments in the stream like normal comments or threaded below 135 135 // the activity. 136 if ( !$display_comments || 'threaded'== $display_comments )136 if ( false === $display_comments || 'threaded' === $display_comments ) 137 137 $where_conditions[] = "a.type != 'activity_comment'"; 138 138 -
trunk/bp-activity/bp-activity-functions.php
r3982 r3985 153 153 154 154 // Get favorites for user 155 $favs = get_user_meta( $user_id, 'bp_favorite_activities', true ); 156 $existing_favs = bp_activity_get_specific( array( 'activity_ids' => $favs ) ); 157 158 foreach( (array)$existing_favs['activities'] as $fav ) 159 $new_favs[] = $fav->id; 160 161 $new_favs = array_unique( (array)$new_favs ); 162 update_user_meta( $user_id, 'bp_favorite_activities', $new_favs ); 163 164 return apply_filters( 'bp_activity_get_user_favorites', $new_favs ); 155 $favs = get_user_meta( $user_id, 'bp_favorite_activities', true ); 156 157 return apply_filters( 'bp_activity_get_user_favorites', $favs ); 165 158 } 166 159 … … 550 543 'max' => false, // Maximum number of results to return 551 544 'sort' => 'DESC', // sort ASC or DESC 552 'display_comments' => false // true or false to display threaded comments for these specific activity items 545 'display_comments' => false, // true or false to display threaded comments for these specific activity items 546 'show_hidden' => false 553 547 ); 554 548 $r = wp_parse_args( $args, $defaults ); 555 549 extract( $r, EXTR_SKIP ); 556 550 557 return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, false, false, $activity_ids ) );551 return apply_filters( 'bp_activity_get_specific', BP_Activity_Activity::get( $max, $page, $per_page, $sort, false, false, $display_comments, $show_hidden, false, $activity_ids ) ); 558 552 } 559 553 -
trunk/bp-activity/bp-activity-template.php
r3984 r3985 94 94 // Fetch specific activity items based on ID's 95 95 if ( !empty( $include ) ) 96 $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments ) );96 $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden ) ); 97 97 // Fetch all activity items 98 98 else … … 317 317 return false; 318 318 319 $include = implode( ',', (array)$favs ); 319 $include = implode( ',', (array)$favs ); 320 $show_hidden = true; 321 $display_comments = true; 320 322 break; 321 323 case 'mentions': 322 $user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;323 $user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;324 $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter.324 $user_nicename = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename; 325 $user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login; 326 $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter. 325 327 $display_comments = 'stream'; 326 328 $user_id = 0;
Note: See TracChangeset
for help on using the changeset viewer.