Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/15/2015 06:56:24 PM (11 years ago)
Author:
tw2113
Message:

More documentation cleanup for part of BP-Core component.

See #6398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-tools.php

    r10229 r10354  
    7575        check_admin_referer( 'bp-do-counts' );
    7676
    77         // Stores messages
     77        // Stores messages.
    7878        $messages = array();
    7979
     
    104104        // Members:
    105105        // - member count
    106         // - last_activity migration (2.0)
     106        // - last_activity migration (2.0).
    107107        $repair_list[20] = array(
    108108                'bp-total-member-count',
     
    118118
    119119        // Friends:
    120         // - user friend count
     120        // - user friend count.
    121121        if ( bp_is_active( 'friends' ) ) {
    122122                $repair_list[0] = array(
     
    128128
    129129        // Groups:
    130         // - user group count
     130        // - user group count.
    131131        if ( bp_is_active( 'groups' ) ) {
    132132                $repair_list[10] = array(
     
    138138
    139139        // Blogs:
    140         // - user blog count
     140        // - user blog count.
    141141        if ( bp_is_active( 'blogs' ) ) {
    142142                $repair_list[90] = array(
     
    183183        $bp = buddypress();
    184184
    185         // Walk through all users on the site
     185        // Walk through all users on the site.
    186186        $total_users = $wpdb->get_row( "SELECT count(ID) as c FROM {$wpdb->users}" )->c;
    187187
     
    191191                $offset = 0;
    192192                while ( $offset < $total_users ) {
    193                         // Only bother updating counts for users who actually have friendships
     193                        // Only bother updating counts for users who actually have friendships.
    194194                        $friendships = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id FROM {$bp->friends->table_name} WHERE is_confirmed = 1 AND ( ( initiator_user_id > %d AND initiator_user_id <= %d ) OR ( friend_user_id > %d AND friend_user_id <= %d ) )", $offset, $offset + $per_query, $offset, $offset + $per_query ) );
    195195
    196196                        // The previous query will turn up duplicates, so we
    197                         // filter them here
     197                        // filter them here.
    198198                        foreach ( $friendships as $friendship ) {
    199199                                if ( ! isset( $updated[ $friendship->initiator_user_id ] ) ) {
     
    241241        $bp = buddypress();
    242242
    243         // Walk through all users on the site
     243        // Walk through all users on the site.
    244244        $total_users = $wpdb->get_row( "SELECT count(ID) as c FROM {$wpdb->users}" )->c;
    245245
     
    248248                $offset = 0;
    249249                while ( $offset < $total_users ) {
    250                         // But only bother to update counts for users that have groups
     250                        // But only bother to update counts for users that have groups.
    251251                        $users = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE is_confirmed = 1 AND is_banned = 0 AND user_id > %d AND user_id <= %d", $offset, $offset + $per_query ) );
    252252
     
    273273function bp_admin_repair_blog_records() {
    274274
    275         // Description of this tool, displayed to the user
     275        // Description of this tool, displayed to the user.
    276276        $statement = __( 'Repopulating Blogs records&hellip; %s', 'buddypress' );
    277277
    278         // Default to failure text
     278        // Default to failure text.
    279279        $result    = __( 'Failed!',   'buddypress' );
    280280
    281         // Default to unrepaired
     281        // Default to unrepaired.
    282282        $repair    = false;
    283283
    284         // Run function if blogs component is active
     284        // Run function if blogs component is active.
    285285        if ( bp_is_active( 'blogs' ) ) {
    286286                $repair = bp_blogs_record_existing_blogs();
    287287        }
    288288
    289         // Setup success/fail messaging
     289        // Setup success/fail messaging.
    290290        if ( true === $repair ) {
    291291                $result = __( 'Complete!', 'buddypress' );
     
    328328 * @param string      $message Feedback message.
    329329 * @param string|bool $class   Unused.
    330  *
    331330 * @return bool
    332331 */
Note: See TracChangeset for help on using the changeset viewer.