Skip to:
Content

BuddyPress.org

Changeset 2120


Ignore:
Timestamp:
11/25/2009 10:32:06 AM (16 years ago)
Author:
apeatling
Message:

Merging 1.1 branch r2113 through r2119 into trunk.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r2114 r2120  
    449449        return false;
    450450
     451    /* If this is a password protected post, don't record the comment */
     452    if ( !empty( $post->post_password ) )
     453        return false;
     454
    451455    $recorded_comment = new BP_Blogs_Comment;
    452456    $recorded_comment->user_id = $user_id;
  • trunk/bp-core/bp-core-avatars.php

    r2114 r2120  
    7878    }
    7979
    80     if ( !$css_id )
    81         $css_id = $object . '-' . $item_id . '-avatar';
     80    /* Add an identifying class to each item */
     81    $class .= ' ' . $object . '-' . $item_id . '-avatar';
     82
     83    if ( !empty($css_id) )
     84        $css_id = " id='{$css_id}'";
    8285
    8386    if ( $width )
     
    113116
    114117        if ( $avatar_url )
    115             return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
     118            return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params );
    116119    }
    117120
     
    138141        $gravatar = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' ) . md5( $grav_email ) . '?d=' . $default_grav . '&amp;s=' . $grav_size;
    139142
    140         return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' id='{$css_id}' class='{$class}'{$html_width}{$html_height} />", $params );
     143        return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params );
    141144
    142145    } else {
  • trunk/bp-friends.php

    r2077 r2120  
    118118    if ( isset($bp->action_variables) && 'accept' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {
    119119        /* Check the nonce */
    120         if ( !check_admin_referer( 'friends_accept_friendship' ) )
    121             return false;
     120        check_admin_referer( 'friends_accept_friendship' );
    122121
    123122        if ( friends_accept_friendship( $bp->action_variables[1] ) ) {
     
    130129    } else if ( isset($bp->action_variables) && 'reject' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {
    131130        /* Check the nonce */
    132         if ( !check_admin_referer( 'friends_reject_friendship' ) )
    133             return false;
     131        check_admin_referer( 'friends_reject_friendship' );
     132
    134133
    135134        if ( friends_reject_friendship( $bp->action_variables[1] ) ) {
     
    630629        $friend_link = bp_core_get_userlink( $friendship->friend_user_id );
    631630
    632         $primary_link = apply_filters( 'friends_activity_friendship_accepted_primary_link', bp_core_get_userlink( $friendship->initiator_user_id ), &$friendship );
     631        $primary_link = apply_filters( 'friends_activity_friendship_accepted_primary_link', bp_core_get_userurl( $friendship->initiator_user_id ), &$friendship );
    633632
    634633        /* Record in activity streams for the initiator */
  • trunk/bp-groups/bp-groups-classes.php

    r2114 r2120  
    422422        global $wpdb, $bp;
    423423
     424        // Default sql WHERE conditions are blank. TODO: generic handler function.
     425        $where_sql = null;
     426        $where_conditions = array();
     427
     428        // Limit results to public status
    424429        if ( $only_public )
    425             $public_sql = $wpdb->prepare( " AND g.status = 'public'" );
     430            $where_conditions[] = $wpdb->prepare( "g.status = 'public'" );
    426431
    427432        if ( !is_site_admin() )
    428             $hidden_sql = $wpdb->prepare( " AND g.status != 'hidden'");
     433            $where_conditions[] = $wpdb->prepare( "g.status != 'hidden'");
     434
     435        // Build where sql statement if necessary
     436        if ( !empty( $where_conditions ) )
     437            $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
    429438
    430439        if ( $limit && $page )
     
    438447            switch ( $sort_by ) {
    439448                default:
    440                     $sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g WHERE 1=1 {$public_sql} {$hidden_sql} {$order_sql} {$pag_sql}" );
     449                    $sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g {$where_sql} {$order_sql} {$pag_sql}" );
    441450                    break;
    442451                case 'members':
     
    448457            }
    449458        } else {
    450             $sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g {$public_sql} {$hidden_sql} {$order_sql} {$pag_sql}" );
     459            $sql = $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name} g {$where_sql} {$order_sql} {$pag_sql}" );
    451460        }
    452461
  • trunk/bp-groups/bp-groups-notifications.php

    r2077 r2120  
    239239        $settings_link = bp_core_get_user_domain( $invited_user_id ) . 'settings/notifications/';
    240240        $invited_link = bp_core_get_user_domain( $invited_user_id );
    241         $invites_link = $invited_link . '/' . $bp->groups->slug . '/invites';
     241        $invites_link = $invited_link . $bp->groups->slug . '/invites';
    242242
    243243        // Set up and send the message
Note: See TracChangeset for help on using the changeset viewer.