Skip to:
Content

BuddyPress.org

Changeset 1891


Ignore:
Timestamp:
09/16/2009 09:23:40 PM (15 years ago)
Author:
apeatling
Message:

Fixing profile pages to work when xprofile is disabled. Added more extensive options to groups_invite_user().

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r1882 r1891  
    226226   
    227227    $defaults = array(
    228         'user_id' => $bp->loggedin_user->id,
    229         'content' => false,
    230         'primary_link' => false,
    231         'component_name' => false,
    232         'component_action' => false,
    233         'item_id' => false,
    234         'secondary_item_id' => false,
    235         'recorded_time' => time(),
    236         'hide_sitewide' => false
     228        'user_id' => $bp->loggedin_user->id, // The user to record the activity for
     229        'content' => false, // The content of the activity item
     230        'primary_link' => false, // The primary URL for this item in RSS feeds
     231        'component_name' => false, // The name/ID of the component e.g. groups, profile, mycomponent
     232        'component_action' => false, // The component action e.g. new_wire_post, profile_updated
     233        'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id, or wire_post_id
     234        'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
     235        'recorded_time' => time(), // The time that this activity was recorded
     236        'hide_sitewide' => false // Should this be hidden on the sitewide activity stream?
    237237    );
    238238
  • trunk/bp-core.php

    r1887 r1891  
    325325    global $bp;
    326326   
    327     if ( !function_exists('xprofile_install') ) {
     327    /***
     328     * If the extended profiles component is disabled, we need to revert to using the
     329     * built in WordPress profile information
     330     */
     331    if ( !function_exists( 'xprofile_install' ) ) {
     332        /* Fallback wire values if xprofile is disabled */
     333        $bp->core->profile->slug = 'profile';
     334        $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug;
     335
    328336        /* Add 'Profile' to the main navigation */
    329         bp_core_add_nav_item( __('Profile', 'buddypress'), 'profile' );
    330         bp_core_add_nav_default( 'profile', 'bp_core_catch_profile_uri', 'public' );
     337        bp_core_new_nav_item( array(
     338            'name' => __('Profile', 'buddypress'),
     339            'slug' => $bp->core->profile->slug,
     340            'position' => 20,
     341            'screen_function' => 'bp_core_catch_profile_uri',
     342            'default_subnav_slug' => 'public'
     343        ) );
    331344
    332345        $profile_link = $bp->loggedin_user->domain . '/profile/';
    333 
     346       
    334347        /* Add the subnav items to the profile */
    335348        bp_core_new_subnav_item( array(
     
    337350            'slug' => 'public',
    338351            'parent_url' => $profile_link,
    339             'parent_slug' => 'profile',
    340             'screen_function' => 'xprofile_screen_display_profile',
    341             'position' => 10
     352            'parent_slug' => $bp->core->profile->slug,
     353            'screen_function' => 'bp_core_catch_profile_uri'
    342354        ) );
     355       
    343356
    344357        if ( 'profile' == $bp->current_component ) {
  • trunk/bp-groups.php

    r1878 r1891  
    22112211}
    22122212
    2213 function groups_invite_user( $user_id, $group_id ) {
    2214     global $bp;
     2213function groups_invite_user( $args = '' ) {
     2214    global $bp;
     2215   
     2216    $defaults = array(
     2217        'user_id' => false,
     2218        'group_id' => false,
     2219        'inviter_id' => $bp->loggedin_user->id,
     2220        'date_modified' => time(),
     2221        'is_confirmed' => 0
     2222    );
     2223
     2224    $args = wp_parse_args( $args, $defaults );
     2225    extract( $args, EXTR_SKIP );   
     2226
     2227    if ( !$user_id || !$group_id )
     2228        return false;
    22152229   
    22162230    if ( groups_is_user_member( $user_id, $group_id ) )
     
    22202234    $invite->group_id = $group_id;
    22212235    $invite->user_id = $user_id;
    2222     $invite->date_modified = time();
    2223     $invite->inviter_id = $bp->loggedin_user->id;
    2224     $invite->is_confirmed = 0;
     2236    $invite->date_modified = $date_modified;
     2237    $invite->inviter_id = $inviter_id;
     2238    $invite->is_confirmed = $is_confirmed;
    22252239   
    22262240    if ( !$invite->save() )
    22272241        return false;
    22282242   
    2229     do_action( 'groups_invite_user', $group_id, $user_id );
     2243    do_action( 'groups_invite_user', $args );
    22302244       
    22312245    return true;
    22322246}
    22332247
    2234 function groups_uninvite_user( $user_id, $group_id, $deprecated = true ) {
     2248function groups_uninvite_user( $user_id, $group_id ) {
    22352249    global $bp;
    22362250   
  • trunk/bp-groups/deprecated/bp-groups-deprecated.php

    r1834 r1891  
    636636    if ( 'invite' == $_POST['friend_action'] ) {
    637637               
    638         if ( !groups_invite_user( $_POST['friend_id'], $_POST['group_id'] ) )
     638        if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) )
    639639            return false;
    640640       
  • trunk/bp-themes/bp-default/_inc/css/screen.css

    r1876 r1891  
    19721972/**** PROFILES ************************/
    19731973
    1974 table.profile-fields tr.alt {
     1974table.profile-fields tr.alt, table.wp-profile-fields tr.alt {
    19751975    background: #f0f0f0;
    19761976}
    19771977
    1978 table.profile-fields tr td.label {
     1978table.profile-fields tr td.label, table.wp-profile-fields tr td.label {
    19791979    border-right: 1px solid #dadada;
    19801980    font-weight: bold;
     
    19851985}
    19861986
    1987 table.profile-fields {
     1987table.profile-fields, table.wp-profile-fields {
    19881988    width: 100%;
    19891989}
    1990     table.profile-fields tr td {
     1990    table.profile-fields tr td, table.wp-profile-fields tr td {
    19911991        padding: 0.5em 1em;
    19921992    }
    19931993   
    1994     table.profile-fields tr td.label {
     1994    table.profile-fields tr td.label, table.wp-profile-fields tr td.label {
    19951995        width: 130px;
    19961996    }
  • trunk/bp-themes/bp-sn-parent/_inc/ajax.php

    r1745 r1891  
    8080    if ( 'invite' == $_POST['friend_action'] ) {
    8181               
    82         if ( !groups_invite_user( $_POST['friend_id'], $_POST['group_id'] ) )
     82        if ( !groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) )
    8383            return false;
    8484       
  • trunk/bp-themes/bp-sn-parent/profile/index.php

    r1871 r1891  
    128128
    129129            <?php /* Profile Wire Loop - uses [TEMPLATEPATH]/wire/post-list.php */ ?>
    130             <?php if ( function_exists('bp_wire_get_post_list') ) : ?>
     130            <?php if ( function_exists('bp_wire_get_post_list') && function_exists( 'xprofile_install' ) ) : ?>
    131131
    132132                <?php do_action( 'bp_before_profile_wire_widget' ) ?>
  • trunk/bp-wire.php

    r1809 r1891  
    3434    global $bp;
    3535
     36    /* Profile wire's will only work if xprofile is enabled */
     37    if ( !function_exists( 'xprofile_install' ) )
     38        return false;
     39       
    3640    /* Add 'Wire' to the main navigation */
    3741    bp_core_new_nav_item( array( 'name' => __('Wire', 'buddypress'), 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', 'item_css_id' => $bp->wire->id ) );
Note: See TracChangeset for help on using the changeset viewer.