Changeset 430
- Timestamp:
- 10/23/2008 04:15:30 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
bp-blogs/bp-blogs-classes.php (modified) (2 diffs)
-
bp-core.php (modified) (1 diff)
-
bp-core/bp-core-catchuri.php (modified) (1 diff)
-
bp-core/bp-core-classes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-classes.php
r387 r430 83 83 84 84 $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM " . $bp['blogs']['table_name'] . " WHERE user_id = %d", $user_id) ); 85 $total_blog_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(blog_id) FROM " . $bp['blogs']['table_name'] . " WHERE user_id = %d", $user_id));85 $total_blog_count = BP_Blogs_Blog::total_blog_count( $user_id ); 86 86 87 87 for ( $i = 0; $i < count($blog_ids); $i++ ) { … … 96 96 return array( 'blogs' => $blogs, 'count' => $total_blog_count ); 97 97 } 98 99 function total_blog_count( $user_id = null ) { 100 global $bp, $wpdb; 101 102 if ( !$user_id ) 103 $user_id = $bp['current_userid']; 104 105 return $wpdb->get_var( $wpdb->prepare( "SELECT count(blog_id) FROM " . $bp['blogs']['table_name'] . " WHERE user_id = %d", $user_id) ); 106 } 98 107 } 99 108 -
trunk/bp-core.php
r429 r430 2 2 /* Define the current version number for checking if DB tables are up to date. */ 3 3 define( 'BP_CORE_VERSION', '0.2.6.1' ); 4 5 /* Load the language file */ 6 if ( file_exists(ABSPATH . 'wp-content/mu-plugins/bp-languages/buddypress-' . get_locale() . '.mo') ) 7 load_textdomain( 'buddypress', ABSPATH . 'wp-content/mu-plugins/bp-languages/buddypress-' . get_locale() . '.mo' ); 4 8 5 9 /* These components are accessed via the root, and not under a blog name or home base. -
trunk/bp-core/bp-core-catchuri.php
r394 r430 15 15 * 16 16 * The URI's are broken down as follows: 17 * - VHOST: http:// andy.domain.com / [current_component] / [current_action] / [action_variables] / [action_variables] / ... 18 * - NO VHOST: http:// domain.com / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... 19 * - OUTSIDE ROOT: http:// domain.com / sites / buddypress / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... 17 * - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... 18 * - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... 20 19 * 21 20 * Example: 22 * - http:// andy.domain.com/profile/edit/group/5/21 * - http://domain.com/members/andy/profile/edit/group/5/ 23 22 * - $current_component: string 'profile' 24 23 * - $current_action: string 'edit' -
trunk/bp-core/bp-core-classes.php
r394 r430 30 30 var $status_last_updated; 31 31 32 var $content_last_updated; 32 /* Extras */ 33 var $total_friends; 34 var $total_blogs; 35 var $total_groups; 33 36 34 function bp_core_user( $user_id ) {37 function bp_core_user( $user_id, $populate_extras = false ) { 35 38 if ( $user_id ) { 36 39 $this->id = $user_id; 37 $this->populate( $this->id ); 40 $this->populate(); 41 42 if ( $populate_extras ) 43 $this->populate_extras(); 38 44 } 39 45 } … … 54 60 */ 55 61 function populate() { 56 global $userdata;57 58 62 $this->user_url = bp_core_get_userurl( $this->id ); 59 63 $this->user_link = bp_core_get_userlink( $this->id ); … … 72 76 $this->status = null; // TODO: Fetch status updates. 73 77 $this->status_last_updated = null; 78 } 79 } 80 81 function populate_extras() { 82 $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id ); 83 84 if ( $this->total_friends ) { 85 if ( $this->total_friends == 1 ) 86 $this->total_friends .= ' ' . __( 'friend', 'buddypress' ); 87 else 88 $this->total_friends .= ' ' . __( 'friends', 'buddypress' ); 89 } 90 91 if ( $this->total_blogs ) { 92 if ( $this->total_blogs == 1 ) 93 $this->total_blogs .= ' ' . __( 'blog', 'buddypress' ); 94 else 95 $this->total_blogs .= ' ' . __( 'blogs', 'buddypress' ); 96 } 97 98 if ( function_exists('groups_install') ) { 99 $this->total_groups = BP_Groups_Member::total_group_count( $this->id ); 100 101 if ( $this->total_groups ) { 102 if ( $this->total_groups == 1 ) 103 $this->total_groups .= ' ' . __( 'group', 'buddypress' ); 104 else 105 $this->total_groups .= ' ' . __( 'groups', 'buddypress' ); 106 } 74 107 } 75 108 }
Note: See TracChangeset
for help on using the changeset viewer.