Changeset 2622 for trunk/bp-groups/bp-groups-classes.php
- Timestamp:
- 02/08/2010 12:33:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r2619 r2622 258 258 /* TODO: Merge all these get_() functions into one. */ 259 259 260 function get_newest( $limit = null, $page = null, $user_id = false, $search_terms = false ) {260 function get_newest( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) { 261 261 global $wpdb, $bp; 262 262 … … 281 281 } 282 282 283 if ( empty( $user_id) ) {283 if ( !empty( $populate_extras ) ) { 284 284 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 285 285 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 290 290 } 291 291 292 function get_active( $limit = null, $page = null, $user_id = false, $search_terms = false ) {292 function get_active( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) { 293 293 global $wpdb, $bp; 294 294 … … 313 313 } 314 314 315 if ( empty( $user_id) ) {315 if ( !empty( $populate_extras ) ) { 316 316 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 317 317 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 322 322 } 323 323 324 function get_popular( $limit = null, $page = null, $user_id = false, $search_terms = false ) {324 function get_popular( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) { 325 325 global $wpdb, $bp; 326 326 … … 346 346 } 347 347 348 if ( empty( $user_id) ) {348 if ( !empty( $populate_extras ) ) { 349 349 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 350 350 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 355 355 } 356 356 357 function get_alphabetically( $limit = null, $page = null, $user_id = false, $search_terms = false ) {357 function get_alphabetically( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) { 358 358 global $wpdb, $bp; 359 359 … … 378 378 } 379 379 380 if ( empty( $user_id) ) {380 if ( !empty( $populate_extras ) ) { 381 381 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 382 382 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 387 387 } 388 388 389 function get_by_most_forum_topics( $limit = null, $page = null, $user_id = false, $search_terms = false ) {389 function get_by_most_forum_topics( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) { 390 390 global $wpdb, $bp, $bbdb; 391 391 … … 414 414 } 415 415 416 if ( empty( $user_id) ) {416 if ( !empty( $populate_extras ) ) { 417 417 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 418 418 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 423 423 } 424 424 425 function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false ) {425 function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true ) { 426 426 global $wpdb, $bp, $bbdb; 427 427 … … 450 450 } 451 451 452 if ( empty( $user_id) ) {452 if ( !empty( $populate_extras ) ) { 453 453 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 454 454 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 503 503 } 504 504 505 function get_by_letter( $letter, $limit = null, $page = null ) {505 function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true ) { 506 506 global $wpdb, $bp; 507 507 … … 521 521 $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} g WHERE 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 g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} ORDER BY g.name ASC {$pag_sql}" ) ); 522 522 523 if ( empty( $user_id) ) {523 if ( !empty( $populate_extras ) ) { 524 524 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 525 525 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 530 530 } 531 531 532 function get_random( $limit = null, $page = null, $user_id = false, $search_terms = false ) {532 function get_random( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) { 533 533 global $wpdb, $bp; 534 534 … … 553 553 } 554 554 555 if ( empty( $user_id) ) {555 if ( !empty( $populate_extras ) ) { 556 556 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 557 557 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 765 765 $this->inviter_id = 0; 766 766 $this->is_confirmed = 1; 767 $this->date_modified = time();767 $this->date_modified = gmdate( "Y-m-d H:i:s" ); 768 768 } 769 769 770 770 function accept_request() { 771 771 $this->is_confirmed = 1; 772 $this->date_modified = time();772 $this->date_modified = gmdate( "Y-m-d H:i:s" ); 773 773 } 774 774
Note: See TracChangeset
for help on using the changeset viewer.