Skip to:
Content

BuddyPress.org


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-friends/bp-friends-classes.php

    r2114 r2168  
    104104    }
    105105
    106     function get_friendship_ids( $user_id, $friend_requests_only = false ) {
    107         global $wpdb, $bp;
    108 
    109         if ( $friend_requests_only ) {
    110             $oc_sql = $wpdb->prepare( "AND is_confirmed = 0" );
    111             $friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id );
    112         } else {
    113             $oc_sql = $wpdb->prepare( "AND is_confirmed = 1" );
    114             $friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
    115         }
    116 
    117         return $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->friends->table_name} $friend_sql $oc_sql" ) );
    118     }
    119 
    120106    function get_friendship_id( $user_id, $friend_id ) {
    121107        global $wpdb, $bp;
     
    124110    }
    125111
    126     function total_friend_count( $user_id = false) {
     112    function get_friendship_request_user_ids( $user_id ) {
     113        global $wpdb, $bp;
     114
     115        return $wpdb->get_col( $wpdb->prepare( "SELECT initiator_user_id FROM {$bp->friends->table_name} WHERE friend_user_id = %d AND is_confirmed = 0", $user_id ) );
     116    }
     117
     118    function total_friend_count( $user_id = false ) {
    127119        global $wpdb, $bp;
    128120
    129121        if ( !$user_id )
    130             $user_id = $bp->displayed_user->id;
     122            $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
    131123
    132124        /* This is stored in 'total_friend_count' usermeta.
Note: See TracChangeset for help on using the changeset viewer.