Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/10/2011 06:32:02 AM (14 years ago)
Author:
djpaul
Message:

Tidy up whitespace. Fixes #3466, props cnorris23

File:
1 edited

Legend:

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

    r4907 r4961  
    294294            if ( is_array( $include ) )
    295295                $include = implode( ',', $include );
    296                
     296
    297297            $include = $wpdb->escape( $include );
    298298            $sql['include'] = " AND g.id IN ({$include})";
     
    302302            if ( is_array( $exclude ) )
    303303                $exclude = implode( ',', $exclude );
    304                
     304
    305305            $exclude = $wpdb->escape( $exclude );
    306306            $sql['exclude'] = " AND g.id NOT IN ({$exclude})";
     
    598598        return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
    599599    }
    600    
    601    
     600
     601
    602602    /**
    603603     * Get a total count of all topics of a given status, across groups/forums
     
    611611    function get_global_topic_count( $status = 'public', $search_terms = false ) {
    612612        global $bbdb, $wpdb, $bp;
    613        
     613
    614614        switch ( $status ) {
    615615            case 'all' :
    616616                $status_sql = '';
    617617                break;
    618                
     618
    619619            case 'hidden' :
    620620                $status_sql = $wpdb->prepare( "AND g.status = 'hidden'" );
    621621                break;
    622                
     622
    623623            case 'private' :
    624624                $status_sql = $wpdb->prepare( "AND g.status = 'private'" );
    625625                break;
    626                
     626
    627627            case 'public' :
    628628            default :
     
    630630                break;
    631631        }
    632        
     632
    633633        $sql = array();
    634        
     634
    635635        $sql['select'] = "SELECT COUNT(t.topic_id)";
    636        
     636
    637637        $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id";
    638        
     638
    639639        $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'";
    640        
     640
    641641        if ( $search_terms ) {
    642642            $st = like_escape( $search_terms );
    643643            $sql['where'] .= " AND (  t.topic_title LIKE '%{$st}%' )";
    644644        }
    645        
     645
    646646        return $wpdb->get_var( implode( ' ', $sql ) );
    647647    }
     
    667667        $this->__construct($user_id,$group_id,$id,$populate);
    668668    }
    669    
     669
    670670    function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
    671671        if ( $user_id && $group_id && !$id ) {
     
    772772    function ban() {
    773773        global $bp;
    774        
     774
    775775        if ( $this->is_admin )
    776776            return false;
     
    790790    function unban() {
    791791        global $bp;
    792        
     792
    793793        if ( $this->is_admin )
    794794            return false;
     
    804804    function accept_invite() {
    805805        global $bp;
    806        
     806
    807807        $this->inviter_id    = 0;
    808808        $this->is_confirmed  = 1;
     
    814814    function accept_request() {
    815815        global $bp;
    816        
     816
    817817        $this->is_confirmed = 1;
    818818        $this->date_modified = bp_core_current_time();
     
    958958        if ( !$user_id )
    959959            return false;
    960        
     960
    961961        $sql = "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0";
    962        
     962
    963963        if ( 'sent' == $type )
    964964            $sql .= " AND invite_sent = 1";
     
    12151215    function _register() {
    12161216        global $bp;
    1217        
     1217
    12181218        if ( !empty( $this->enable_create_step ) ) {
    12191219            // Insert the group creation step for the new group extension
     
    12451245                add_action( $this->display_hook, array( &$this, 'widget_display' ) );
    12461246        }
    1247        
     1247
    12481248        // Construct the admin edit tab for the new group extension
    12491249        if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
Note: See TracChangeset for help on using the changeset viewer.