Skip to:
Content

BuddyPress.org

Changeset 3555


Ignore:
Timestamp:
12/22/2010 01:13:29 AM (14 years ago)
Author:
boonebgorges
Message:

More glorious WP_DEBUG fixes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-classes.php

    r3542 r3555  
    507507        global $wpdb, $bp;
    508508
    509         if ( $secondary_item_id )
    510             $secondary_item_sql = $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id );
     509        $secondary_item_sql = !empty( $secondary_item_id ) ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id ) : '';
    511510
    512511        return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND item_id = %d AND component_name = %s AND component_action = %s{$secondary_item_sql}", $user_id, $item_id, $component_name, $component_action ) );
  • trunk/bp-groups.php

    r3554 r3555  
    536536
    537537    if ( $bp->is_single_item ) {
    538         if ( isset($bp->action_variables) && 'send' == $bp->action_variables[0] ) {
     538        if ( !empty( $bp->action_variables[0] ) && 'send' == $bp->action_variables[0] ) {
    539539
    540540            if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) )
     
    14211421
    14221422            $group = new BP_Groups_Group( $group_id );
    1423             $user_url = bp_core_get_user_domain( $user_id );
     1423            $user_url = bp_core_get_user_domain( $bp->loggedin_user->id );
    14241424
    14251425            if ( (int)$total_items > 1 )
  • trunk/bp-groups/bp-groups-classes.php

    r3542 r3555  
    866866        global $wpdb, $bp;
    867867
    868         if ( $limit && $page )
    869             $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
     868        $pag_sql = ( !empty( $limit ) && !empty( $page ) ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
    870869       
    871         if ( $exclude )
    872             $exclude_sql = $wpdb->prepare( " AND g.id NOT IN (%s)", $exclude );
     870        $exclude_sql = !empty( $exclude ) ? $wpdb->prepare( " AND g.id NOT IN (%s)", $exclude ) : '';
    873871
    874872        $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.id = m.group_id AND g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND m.is_confirmed = 0 AND m.inviter_id != 0 AND m.invite_sent = 1 AND m.user_id = %d {$exclude_sql} ORDER BY m.date_modified ASC {$pag_sql}", $user_id ) );
  • trunk/bp-groups/bp-groups-templatetags.php

    r3543 r3555  
    18471847
    18481848        if ( !$group_id )
    1849             $group_id = ( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : $bp->groups->current_group->id;
     1849            $group_id = !empty( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : $bp->groups->current_group->id;
    18501850
    18511851        $friends = friends_get_friends_invite_list( $bp->loggedin_user->id, $group_id );
     
    18551855
    18561856            for ( $i = 0; $i < count( $friends ); $i++ ) {
    1857                 if ( $invites ) {
    1858                     if ( in_array( $friends[$i]['id'], $invites ) ) {
     1857                $checked = '';
     1858               
     1859                if ( !empty( $invites ) ) {
     1860                    if ( in_array( $friends[$i]['id'], $invites ) )
    18591861                        $checked = ' checked="checked"';
    1860                     } else {
    1861                         $checked = '';
    1862                     }
    18631862                }
    18641863
     
    22202219
    22212220    function the_invite() {
    2222         global $invite;
     2221        global $invite, $group_id;
    22232222
    22242223        $this->in_the_loop = true;
     
    22472246    if ( !$group_id ) {
    22482247        /* Backwards compatibility */
    2249         if ( $bp->groups->current_group ) $group_id = $bp->groups->current_group->id;
    2250         if ( $bp->groups->new_group_id ) $group_id = $bp->groups->new_group_id;
     2248        if ( !empty( $bp->groups->current_group ) )
     2249            $group_id = $bp->groups->current_group->id;
     2250        if ( !empty( $bp->groups->new_group_id ) )
     2251            $group_id = $bp->groups->new_group_id;
    22512252    }
    22522253
Note: See TracChangeset for help on using the changeset viewer.