Skip to:
Content

BuddyPress.org

Changeset 2168 for trunk/bp-xprofile.php


Ignore:
Timestamp:
12/14/2009 03:24:05 PM (16 years ago)
Author:
apeatling
Message:

Committing core code support for new default theme.

Removed all deprecated code since it will be released as a separate plugin for backwards compatibility if people need it.

Removed the wire and status updates components since there is no support in the theme for these. If people still want this functionality then I'm sure there is someone in the community that could spend a bit of time and release them as plugins. I'm happy to guide.

Removed a lot of template loop duplication. There are no longer site loops and user loops (e.g. bp_has_site_groups() / bp_has_groups() ). There are now bp_has_members(), bp_has_groups(), bp_has_blogs() and you can pass a "user_id" parameter into these loops to limit results to only that user or users.

Merged activity stream functions. There are no longer functions for bp_activity_get_sitewide() / bp_activity_get_for_user() / bp_activity_get_friends_activity() instead there is simply one function: bp_activity_get() and you can pass in parameters to filter on just friends, for a single user, or anything your heart desires. Actually, filtering is extremely fine grained, so I encourage devs to check out the filter functions.

Lots of other code cleanup.

The new default theme will be committed straight after this. The original default folder will be renamed to bp-classic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile.php

    r2088 r2168  
    1212require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-notifications.php' );
    1313require ( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-cssjs.php' );
    14 
    15 /* Include deprecated functions if settings allow */
    16 if ( !defined( 'BP_IGNORE_DEPRECATED' ) )
    17     require ( BP_PLUGIN_DIR . '/bp-xprofile/deprecated/bp-xprofile-deprecated.php' );
    1814
    1915/* Assign the base group and fullname field names to constants to use in SQL statements */
     
    296292
    297293    do_action( 'xprofile_screen_display_profile', $_GET['new'] );
    298     bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'profile/index' ) );
     294    bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/profile' ) );
    299295}
    300296
     
    376372
    377373    do_action( 'xprofile_screen_edit_profile' );
    378     bp_core_load_template( apply_filters( 'xprofile_template_edit_profile', 'profile/edit' ) );
     374    bp_core_load_template( apply_filters( 'xprofile_template_edit_profile', 'members/single/profile' ) );
    379375}
    380376
     
    426422    do_action( 'xprofile_screen_change_avatar' );
    427423
    428     bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'profile/change-avatar' ) );
     424    bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/profile' ) );
    429425}
    430426
     
    11071103
    11081104/**
     1105 * xprofile_filter_template_paths()
     1106 *
     1107 * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
     1108 * older than 1.2.
     1109 *
     1110 * @package BuddyPress Core
     1111 */
     1112function xprofile_filter_template_paths() {
     1113    if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
     1114        return false;
     1115
     1116    add_filter( 'xprofile_template_display_profile', create_function( '', 'return "profile/index";' ) );
     1117    add_filter( 'xprofile_template_edit_profile', create_function( '', 'return "profile/edit";' ) );
     1118    add_filter( 'xprofile_template_change_avatar', create_function( '', 'return "profile/change-avatar";' ) );
     1119}
     1120add_action( 'init', 'xprofile_filter_template_paths' );
     1121
     1122/**
    11091123 * xprofile_remove_data_on_user_deletion()
    11101124 *
Note: See TracChangeset for help on using the changeset viewer.