Changeset 2168 for trunk/bp-activity.php
- Timestamp:
- 12/14/2009 03:24:05 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2158 r2168 9 9 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-classes.php' ); 10 10 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-templatetags.php' ); 11 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-widgets.php' );12 11 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-filters.php' ); 13 14 /* Include deprecated functions if settings allow */15 if ( !defined( 'BP_IGNORE_DEPRECATED' ) )16 require ( BP_PLUGIN_DIR . '/bp-activity/deprecated/bp-activity-deprecated.php' );17 12 18 13 function bp_activity_install() { … … 122 117 function bp_activity_screen_my_activity() { 123 118 do_action( 'bp_activity_screen_my_activity' ); 124 bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', ' activity/just-me' ) );119 bp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'members/single/activity' ) ); 125 120 } 126 121 … … 173 168 } 174 169 175 bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', ' activity/single' ) );170 bp_core_load_template( apply_filters( 'bp_activity_template_profile_activity_permalink', 'members/single/activity/permalink' ) ); 176 171 } 177 172 /* This screen is not attached to a nav item, so we need to add an action for it. */ … … 307 302 */ 308 303 309 function bp_activity_get _sitewide( $args = '' ) {304 function bp_activity_get( $args = '' ) { 310 305 $defaults = array( 311 306 'max' => false, // Maximum number of results to return … … 319 314 320 315 /** 321 * Pass filters as an array :316 * Pass filters as an array -- all filter items can be multiple values comma separated: 322 317 * array( 323 318 * 'user_id' => false, // user_id to filter on … … 334 329 extract( $r, EXTR_SKIP ); 335 330 336 return apply_filters( 'bp_activity_get_sitewide', BP_Activity_Activity::get_sitewide_activity( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), &$r ); 337 } 338 339 function bp_activity_get_for_user( $args = '' ) { 340 global $bp; 341 342 $defaults = array( 343 'user_id' => $bp->displayed_user->id, 344 'max' => false, // Maximum number of results to return 345 'page' => 1, // page 1 without a per_page will result in no pagination. 346 'per_page' => false, // results per page 347 'sort' => 'DESC', // sort ASC or DESC 348 'display_comments' => 'stream', // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item 349 350 'search_terms' => false, // Pass search terms as a string 351 'show_hidden' => false, // Show activity items that are hidden site-wide? 352 353 /* See bp_activity_get_sitewide() for filters */ 354 'filter' => array() 355 ); 356 357 $r = wp_parse_args( $args, $defaults ); 358 extract( $r, EXTR_SKIP ); 359 360 return apply_filters( 'bp_activity_get_for_user', BP_Activity_Activity::get_activity_for_user( $user_id, $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), &$r ); 361 } 362 363 function bp_activity_get_friends_activity( $user_id, $max = 30, $max_items_per_friend = false, $pag_num = false, $pag_page = false, $filter = false ) { 364 return apply_filters( 'bp_activity_get_friends_activity', BP_Activity_Activity::get_activity_for_friends( $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter ), $user_id, $max_items, $max_items_per_friend, $pag_num, $pag_page, $filter ); 331 return apply_filters( 'bp_activity_get', BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), &$r ); 365 332 } 366 333 … … 537 504 } 538 505 506 /** 507 * bp_activity_filter_template_paths() 508 * 509 * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions 510 * older than 1.2. 511 * 512 * @package BuddyPress Core 513 */ 514 function bp_activity_filter_template_paths() { 515 if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) ) 516 return false; 517 518 add_filter( 'bp_activity_template_my_activity', create_function( '', 'return "activity/just-me";' ) ); 519 add_filter( 'bp_activity_template_friends_activity', create_function( '', 'return "activity/my-friends";' ) ); 520 add_filter( 'bp_activity_template_profile_activity_permalink', create_function( '', 'return "activity/single";' ) ); 521 522 /* Activity widget should only be available to older themes since the new default has it all in the template */ 523 require ( BP_PLUGIN_DIR . '/bp-activity/bp-activity-widgets.php' ); 524 } 525 add_action( 'widgets_init', 'bp_activity_filter_template_paths' ); 526 539 527 function bp_activity_remove_data( $user_id ) { 540 528 // Clear the user's activity from the sitewide stream and clear their activity tables … … 547 535 add_action( 'make_spam_user', 'bp_activity_remove_data' ); 548 536 549 /* Ordering function - don't call this directly */550 function bp_activity_order_by_date( $a, $b ) {551 return apply_filters( 'bp_activity_order_by_date', strcasecmp( $b['date_recorded'], $a['date_recorded'] ) );552 }553 554 537 ?>
Note: See TracChangeset
for help on using the changeset viewer.