Changeset 4847
- Timestamp:
- 07/25/2011 12:29:19 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-actions.php
r4819 r4847 23 23 24 24 // No activity to display 25 if ( empty( $bp->action_variables[0] ) || !is_numeric( $bp->action_variables[0]) )25 if ( !bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) ) 26 26 return false; 27 27 28 28 // Get the activity details 29 $activity = bp_activity_get_specific( array( 'activity_ids' => $bp->action_variables[0], 'show_hidden' => true ) );29 $activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) ); 30 30 31 31 // 404 if activity does not exist … … 88 88 return false; 89 89 90 if ( empty( $activity_id ) && !empty( $bp->action_variables[0] ) && is_numeric( $bp->action_variables[0]) )91 $activity_id = (int) $bp->action_variables[0];90 if ( empty( $activity_id ) && bp_action_variable( 0 ) ) 91 $activity_id = (int) bp_action_variable( 0 ); 92 92 93 93 // Not viewing a specific activity item … … 212 212 check_admin_referer( 'mark_favorite' ); 213 213 214 if ( bp_activity_add_user_favorite( $bp->action_variables[0]) )214 if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) ) 215 215 bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) ); 216 216 else 217 217 bp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' ); 218 218 219 bp_core_redirect( wp_get_referer() . '#activity-' . $bp->action_variables[0]);219 bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) ); 220 220 } 221 221 add_action( 'bp_actions', 'bp_activity_action_mark_favorite' ); … … 230 230 check_admin_referer( 'unmark_favorite' ); 231 231 232 if ( bp_activity_remove_user_favorite( $bp->action_variables[0]) )232 if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) ) 233 233 bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) ); 234 234 else 235 235 bp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' ); 236 236 237 bp_core_redirect( wp_get_referer() . '#activity-' . $bp->action_variables[0]);237 bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) ); 238 238 } 239 239 add_action( 'bp_actions', 'bp_activity_action_remove_favorite' ); … … 270 270 global $bp, $wp_query; 271 271 272 if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')272 if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) ) 273 273 return false; 274 274 … … 284 284 global $bp, $wp_query; 285 285 286 if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')286 if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) ) 287 287 return false; 288 288 … … 298 298 global $bp, $wp_query; 299 299 300 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')300 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) ) 301 301 return false; 302 302 … … 312 312 global $bp, $wp_query; 313 313 314 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')314 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) ) 315 315 return false; 316 316 -
trunk/bp-activity/bp-activity-screens.php
r4817 r4847 99 99 100 100 // 404 if activity does not exist 101 if ( empty( $activity['activities'][0] ) || !empty( $bp->action_variables) ) {101 if ( empty( $activity['activities'][0] ) || bp_action_variables() ) { 102 102 bp_do_404(); 103 103 return; -
trunk/bp-activity/bp-activity-template.php
r4819 r4847 275 275 $scope = $bp->active_components[$bp->current_action]; 276 276 else 277 $scope = $bp->current_action;277 $scope = bp_current_action(); 278 278 279 279 // Support for permalinks on single item pages: /groups/my-group/activity/124/ 280 280 if ( bp_is_current_action( bp_get_activity_slug() ) ) 281 $include = $bp->action_variables[0];282 281 $include = bp_action_variable( 0 ); 282 283 283 // Note: any params used for filtering can be a single value, or multiple values comma separated. 284 284 $defaults = array( -
trunk/bp-core/bp-core-template.php
r4844 r4847 1155 1155 1156 1156 function bp_is_group_forum_topic() { 1157 global $bp; 1158 1159 if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && isset( $bp->action_variables[0] ) && 'topic' == $bp->action_variables[0] ) 1157 if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) ) 1160 1158 return true; 1161 1159 … … 1166 1164 global $bp; 1167 1165 1168 if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && isset( $bp->action_variables[0] ) && 'topic' == $bp->action_variables[0] && isset( $bp->action_variables[2] ) && 'edit' == $bp->action_variables[2])1166 if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_is_action_variable( 'edit', 2 ) ) 1169 1167 return true; 1170 1168
Note: See TracChangeset
for help on using the changeset viewer.