Skip to:
Content

BuddyPress.org

Ticket #8581: 8581-e.patch

File 8581-e.patch, 132.8 KB (added by vapvarun, 3 years ago)

revised patch with activity type template

  • src/bp-activity/bp-activity-filters.php

    diff --git src/bp-activity/bp-activity-filters.php src/bp-activity/bp-activity-filters.php
    index 3367e75f2..453485e30 100644
    add_filter( 'bp_get_total_mention_count_for_user', 'bp_core_number_format' ); 
    108108
    109109add_filter( 'bp_activity_get_embed_excerpt', 'bp_activity_embed_excerpt_onclick_location_filter', 9 );
    110110
     111add_filter( 'bp_get_activity_content_body', 'bp_activity_generate_content_body', 50, 2 );
     112add_filter( 'bp_activity_get_embed_excerpt', 'bp_activity_generate_embed_excerpt', 50, 2 );
     113
    111114// Personal data export.
    112115add_filter( 'wp_privacy_personal_data_exporters', 'bp_activity_register_personal_data_exporter' );
    113116
    function bp_activity_register_personal_data_exporter( $exporters ) { 
    841844
    842845        return $exporters;
    843846}
     847
     848/**
     849 * Generate a content body for specific activity types.
     850 *
     851 * @since 10.0.0
     852 *
     853 * @param string               $content  The content of the activity.
     854 * @param BP_Activity_Activity $activity The activity object.
     855 * @return string                        The content of the activity.
     856 */
     857function bp_activity_generate_content_body( $content = '', $activity = null ) {
     858       
     859        /*
     860         * New Avatar Activity Type
     861         */
     862        if ( isset( $activity->type ) && 'new_avatar' === $activity->type ) {
     863                $historical_avatar = '';               
     864               
     865                $user_url               = bp_core_get_user_domain( $activity->user_id );
     866                $user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     867                $user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     868                $action_button_text = esc_html__( 'View Profile', 'buddypress');
     869                $user_cover_image       = bp_attachments_get_attachment(
     870                                                                        'url',
     871                                                                        array(
     872                                                                                'object_dir' => 'members',
     873                                                                                'item_id'    => $activity->user_id,
     874                                                                        )
     875                                                                );
     876                $args   = array( 'r' => $user_mentionname );
     877                $url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     878                $user_mentionname_url = wp_nonce_url( $url );
     879
     880                if ( isset( $activity->historical_avatar ) && $activity->historical_avatar ) {
     881                        $historical_avatar = str_replace('\history','/history',$activity->historical_avatar);
     882                } else {
     883                        $avatars = bp_avatar_get_version_src( $activity->user_id, $activity->date_recorded );
     884
     885                        if ( $avatars && 1 === count( $avatars ) ) {
     886                                $avatar            = reset( $avatars );
     887                                $historical_avatar = trailingslashit( $avatar->parent_dir_url ) . $avatar->name;
     888                        }
     889                }
     890
     891                if ( $historical_avatar ) {
     892                        $content = '<div class="bp-member-activity-preview">';
     893                        $content .= '<a href="' . esc_url( $user_url ) . '">
     894                                                        <div class="bp-member-preview-cover">';
     895                        if ( $user_cover_image != '') {
     896                                $content .= '<img src="' . esc_url( $user_cover_image ) . '" alt="cover-image"/>';
     897                        }
     898                        $content .= '</div></a>';
     899                        $content .= '<div class="bp-member-short-description">';
     900                        $content .= '<div class="bp-member-avatar-content">';
     901                        $content .= '<img src="' . esc_url( $historical_avatar ) . '" class="profile-photo aligncenter">';
     902                        $content .= '</div>';
     903                        $content .= '<p class="bp-member-short-description-title">
     904                                                        <a href="' .esc_url( $user_url ) .'">' . esc_html( $user_displayname ) . '</a>
     905                                                </p>';
     906                        $content .= '<p class="bp-member-nickname">
     907                                                        <a href="' .esc_url( $user_mentionname_url ) . '">@' . esc_html( $user_mentionname ) . '</a>
     908                                                </p>';
     909                                               
     910                        $content .= sprintf(
     911                                        '<div class="bp-profile-button">
     912                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     913                                        </div>',
     914                                        esc_url( $user_url ),
     915                                        $action_button_text
     916                                );
     917                        $content .= '</div>';
     918                        $content .= '</div>';
     919                       
     920                }
     921        }
     922       
     923         /*
     924          * Friendship Created Activity Type
     925          */
     926         
     927         if ( isset( $activity->type ) && 'friendship_created' === $activity->type ) {                         
     928               
     929                $user_url               = bp_core_get_user_domain( $activity->secondary_item_id );
     930                $user_displayname       = bp_core_get_user_displayname( $activity->secondary_item_id );
     931                $user_mentionname       = bp_activity_get_user_mentionname( $activity->secondary_item_id );             
     932                $action_button_text = esc_html__( 'View Profile', 'buddypress');
     933                $user_cover_image       = bp_attachments_get_attachment(
     934                                                                        'url',
     935                                                                        array(
     936                                                                                'object_dir' => 'members',
     937                                                                                'item_id'    => $activity->secondary_item_id,
     938                                                                        )
     939                                                                );
     940                $args   = array( 'r' => $user_mentionname );
     941                $url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     942                $user_mentionname_url = wp_nonce_url( $url );
     943               
     944                $avatar_url = bp_core_fetch_avatar(
     945                                                                        array(
     946                                                                                'item_id' => $activity->secondary_item_id,
     947                                                                                'type'    => 'full',
     948                                                                                'width'   => 150,
     949                                                                                'height'  => 150,
     950                                                                                'class'   => 'avatar',
     951                                                                                'id'      => false,
     952                                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     953                                                                                'html'    => false
     954                                                                        )
     955                                                                );
     956               
     957
     958                if ( $avatar_url ) {
     959                        $content = '<div class="bp-member-activity-preview">';
     960                        $content .= '<a href="' . esc_url( $user_url ) . '">
     961                                                        <div class="bp-member-preview-cover">';
     962                        if ( $user_cover_image != '') {
     963                                $content .= '<img src="' . esc_url( $user_cover_image ) . '" alt="' . esc_attr__( "cover-image" ) . '"/>';
     964                        }
     965                        $content .= '</div></a>';
     966                        $content .= '<div class="bp-member-short-description">';
     967                        $content .= '<div class="bp-member-avatar-content">';
     968                        $content .= '<img src="' . esc_url( $avatar_url ) . '" class="profile-photo aligncenter">';
     969                        $content .= '</div>';
     970                        $content .= '<p class="bp-member-short-description-title">
     971                                                        <a href="' .esc_url( $user_url ) .'">' . esc_html( $user_displayname ) . '</a>
     972                                                </p>';
     973                        $content .= '<p class="bp-member-nickname">
     974                                                        <a href="' .esc_url( $user_mentionname_url ) . '">@' . esc_html( $user_mentionname ) . '</a>
     975                                                </p>';
     976                                               
     977                        $content .= sprintf(
     978                                        '<div class="bp-profile-button">
     979                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     980                                        </div>',
     981                                        esc_url( $user_url ),
     982                                        $action_button_text
     983                                );
     984                        $content .= '</div>';
     985                        $content .= '</div>';
     986                       
     987                }
     988        }
     989       
     990        /*
     991          * Joined Group Activity Type
     992          */
     993         
     994         if ( isset( $activity->type ) && 'joined_group' === $activity->type ) {       
     995         
     996                $group                          = groups_get_group( array( 'group_id' => $activity->item_id ) );
     997                $group_name                     = $group->name;
     998                $group_url              = bp_get_group_permalink( $group );
     999                $group_cover_image      = bp_get_group_cover_url( $group );             
     1000                $action_button_text = esc_html__( 'Visit Group', 'buddypress');
     1001               
     1002                $group_avatar_url       = bp_core_fetch_avatar(
     1003                                                                array(
     1004                                                                        'item_id'    => $group->id,
     1005                                                                        'avatar_dir' => 'group-avatars',
     1006                                                                        'object'     => 'group',
     1007                                                                        'type'       => 'full',
     1008                                                                        'html'       => false,                                                                 
     1009                                                                        'width'      => 150,
     1010                                                                        'height'     => 150,
     1011                                                                )
     1012                                                        );
     1013               
     1014                if ( $group_avatar_url ) {
     1015                        $content = '<div class="bp-group-activity-preview">';
     1016                        $content .= '<a href="' . esc_url( $group_url ) . '">
     1017                                                        <div class="bp-group-preview-cover">';
     1018                        if ( $group_cover_image != '') {
     1019                                $content .= '<img src="' . esc_url( $group_cover_image ) . '" alt="cover-image"/>';
     1020                        }
     1021                        $content .= '</div></a>';
     1022                        $content .= '<div class="bp-group-short-description">';
     1023                        $content .= '<div class="bp-group-avatar-content">';
     1024                        $content .= '<img src="' . esc_url( $group_avatar_url ) . '" class="group-photo aligncenter" width="150" height="150">';
     1025                        $content .= '</div>';
     1026                        $content .= '<p class="bp-group-short-description-title">
     1027                                                        <a href="' .esc_url( $group_url ) .'">' . esc_html( $group_name ) . '</a>
     1028                                                </p>';                 
     1029                                               
     1030                        $content .= sprintf(
     1031                                        '<div class="bp-profile-button">
     1032                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     1033                                        </div>',
     1034                                        esc_url( $group_url ),
     1035                                        $action_button_text
     1036                                );
     1037                        $content .= '</div>';
     1038                        $content .= '</div>';
     1039                       
     1040                }
     1041         
     1042         }
     1043
     1044        return $content;
     1045}
     1046
     1047
     1048
     1049
     1050/**
     1051 * Generate a embed content body for specific activity types.
     1052 *
     1053 * @since 10.0.0
     1054 *
     1055 * @param string               $content  The content of the activity.
     1056 * @return string                        The content of the activity.
     1057 */
     1058function bp_activity_generate_embed_excerpt( $content = '' ) {
     1059       
     1060        $activity = $GLOBALS['activities_template']->activity;
     1061       
     1062        /*
     1063         * New Avatar Activity Type
     1064         */
     1065        if ( isset( $activity->type ) && 'new_avatar' === $activity->type ) {
     1066                $historical_avatar = '';               
     1067               
     1068                $user_url               = bp_core_get_user_domain( $activity->user_id );
     1069                $user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     1070                $user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     1071                $action_button_text = esc_html__( 'View Profile', 'buddypress');
     1072                $user_cover_image       = bp_attachments_get_attachment(
     1073                                                                        'url',
     1074                                                                        array(
     1075                                                                                'object_dir' => 'members',
     1076                                                                                'item_id'    => $activity->user_id,
     1077                                                                        )
     1078                                                                );
     1079                $args   = array( 'r' => $user_mentionname );
     1080                $url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     1081                $user_mentionname_url = wp_nonce_url( $url );
     1082
     1083                if ( isset( $activity->historical_avatar ) && $activity->historical_avatar ) {
     1084                        $historical_avatar = str_replace('\history','/history',$activity->historical_avatar);
     1085                } else {
     1086                        $avatars = bp_avatar_get_version_src( $activity->user_id, $activity->date_recorded );
     1087
     1088                        if ( $avatars && 1 === count( $avatars ) ) {
     1089                                $avatar            = reset( $avatars );                         
     1090                                $historical_avatar = trailingslashit( str_replace('\history', '/history', $avatar->parent_dir_url ) )  . $avatar->name;
     1091                        }
     1092                }
     1093
     1094                if ( $historical_avatar ) {
     1095                        $content = '<div class="bp-member-activity-preview">';
     1096                        $content .= '<a href="' . esc_url( $user_url ) . '">
     1097                                                        <div class="bp-member-preview-cover">';
     1098                        if ( $user_cover_image != '') {
     1099                                $content .= '<img src="' . esc_url( $user_cover_image ) . '" alt="cover-image"/>';
     1100                        }
     1101                        $content .= '</div></a>';
     1102                        $content .= '<div class="bp-member-short-description">';
     1103                        $content .= '<div class="bp-member-avatar-content">';
     1104                        $content .= '<img src="' . esc_url( $historical_avatar ) . '" class="profile-photo aligncenter">';
     1105                        $content .= '</div>';
     1106                        $content .= '<p class="bp-member-short-description-title">
     1107                                                        <a href="' .esc_url( $user_url ) .'">' . esc_html( $user_displayname ) . '</a>
     1108                                                </p>';
     1109                        $content .= '<p class="bp-member-nickname">
     1110                                                        <a href="' .esc_url( $user_mentionname_url ) . '">@' . esc_html( $user_mentionname ) . '</a>
     1111                                                </p>';
     1112                                               
     1113                        $content .= sprintf(
     1114                                        '<div class="bp-profile-button">
     1115                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     1116                                        </div>',
     1117                                        esc_url( $user_url ),
     1118                                        $action_button_text
     1119                                );
     1120                        $content .= '</div>';
     1121                        $content .= '</div>';
     1122                       
     1123                }
     1124        }
     1125       
     1126         /*
     1127          * Friendship Created Activity Type
     1128          */
     1129         
     1130         if ( isset( $activity->type ) && 'friendship_created' === $activity->type ) {                         
     1131               
     1132                $user_url               = bp_core_get_user_domain( $activity->secondary_item_id );
     1133                $user_displayname       = bp_core_get_user_displayname( $activity->secondary_item_id );
     1134                $user_mentionname       = bp_activity_get_user_mentionname( $activity->secondary_item_id );             
     1135                $action_button_text = esc_html__( 'View Profile', 'buddypress');
     1136                $user_cover_image       = bp_attachments_get_attachment(
     1137                                                                        'url',
     1138                                                                        array(
     1139                                                                                'object_dir' => 'members',
     1140                                                                                'item_id'    => $activity->secondary_item_id,
     1141                                                                        )
     1142                                                                );
     1143                $args   = array( 'r' => $user_mentionname );
     1144                $url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     1145                $user_mentionname_url = wp_nonce_url( $url );
     1146               
     1147                $avatar_url = bp_core_fetch_avatar(
     1148                                                array(
     1149                                                        'item_id' => $activity->secondary_item_id,
     1150                                                        'type'    => 'full',
     1151                                                        'width'   => 150,
     1152                                                        'height'  => 150,
     1153                                                        'class'   => 'avatar',
     1154                                                        'id'      => false,
     1155                                                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     1156                                                        'html'    => false
     1157                                                )
     1158                                        );
     1159               
     1160
     1161                if ( $avatar_url ) {
     1162                        $content = '<div class="bp-member-activity-preview">';
     1163                        $content .= '<a href="' . esc_url( $user_url ) . '">
     1164                                                        <div class="bp-member-preview-cover">';
     1165                        if ( $user_cover_image != '') {
     1166                                $content .= '<img src="' . esc_url( $user_cover_image ) . '" alt="cover-image"/>';
     1167                        }
     1168                        $content .= '</div></a>';
     1169                        $content .= '<div class="bp-member-short-description">';
     1170                        $content .= '<div class="bp-member-avatar-content">';
     1171                        $content .= '<img src="' . esc_url( $avatar_url ) . '" class="profile-photo aligncenter">';
     1172                        $content .= '</div>';
     1173                        $content .= '<p class="bp-member-short-description-title">
     1174                                                        <a href="' .esc_url( $user_url ) .'">' . esc_html( $user_displayname ) . '</a>
     1175                                                </p>';
     1176                        $content .= '<p class="bp-member-nickname">
     1177                                                        <a href="' .esc_url( $user_mentionname_url ) . '">@' . esc_html( $user_mentionname ) . '</a>
     1178                                                </p>';
     1179                                               
     1180                        $content .= sprintf(
     1181                                        '<div class="bp-profile-button">
     1182                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     1183                                        </div>',
     1184                                        esc_url( $user_url ),
     1185                                        $action_button_text
     1186                                );
     1187                        $content .= '</div>';
     1188                        $content .= '</div>';
     1189                       
     1190                }
     1191        }
     1192       
     1193        /*
     1194          * Joined Group Activity Type
     1195          */
     1196         
     1197         if ( isset( $activity->type ) && 'joined_group' === $activity->type ) {       
     1198         
     1199                $group                          = groups_get_group( array( 'group_id' => $activity->item_id ) );
     1200                $group_name                     = $group->name;
     1201                $group_url              = bp_get_group_permalink( $group );
     1202                $group_cover_image      = bp_get_group_cover_url( $group );             
     1203                $action_button_text = esc_html__( 'Visit Group', 'buddypress');
     1204               
     1205                $group_avatar_url       = bp_core_fetch_avatar(
     1206                                                                array(
     1207                                                                        'item_id'    => $group->id,
     1208                                                                        'avatar_dir' => 'group-avatars',
     1209                                                                        'object'     => 'group',
     1210                                                                        'type'       => 'full',
     1211                                                                        'html'       => false,                                                                 
     1212                                                                        'width'      => 150,
     1213                                                                        'height'     => 150,
     1214                                                                )
     1215                                                        );
     1216               
     1217                if ( $group_avatar_url ) {
     1218                        $content = '<div class="bp-group-activity-preview">';
     1219                        $content .= '<a href="' . esc_url( $group_url ) . '">
     1220                                                        <div class="bp-group-preview-cover">';
     1221                        if ( $group_cover_image != '') {
     1222                                $content .= '<img src="' . esc_url( $group_cover_image ) . '" alt="cover-image"/>';
     1223                        }
     1224                        $content .= '</div></a>';
     1225                        $content .= '<div class="bp-group-short-description">';
     1226                        $content .= '<div class="bp-group-avatar-content">';
     1227                        $content .= '<img src="' . esc_url( $group_avatar_url ) . '" class="group-photo aligncenter" width="150" height="150">';
     1228                        $content .= '</div>';
     1229                        $content .= '<p class="bp-group-short-description-title">
     1230                                                        <a href="' .esc_url( $group_url ) .'">' . esc_html( $group_name ) . '</a>
     1231                                                </p>';                 
     1232                                               
     1233                        $content .= sprintf(
     1234                                        '<div class="bp-profile-button">
     1235                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     1236                                        </div>',
     1237                                        esc_url( $group_url ),
     1238                                        $action_button_text
     1239                                );
     1240                        $content .= '</div>';
     1241                        $content .= '</div>';
     1242                       
     1243                }
     1244         
     1245         }
     1246        return $content;       
     1247}
  • src/bp-activity/bp-activity-template.php

    diff --git src/bp-activity/bp-activity-template.php src/bp-activity/bp-activity-template.php
    index 16ee47d86..d6a38cb96 100644
    function bp_activity_content_body() { 
    14301430function bp_activity_has_content() {
    14311431        global $activities_template;
    14321432
    1433         if ( ! empty( $activities_template->activity->content ) ) {
    1434                 return true;
    1435         }
     1433        $has_content = ! empty( $activities_template->activity->content );
     1434        if ( ! $has_content ) {
     1435                if ( 'new_avatar' === bp_get_activity_type() ) {
     1436                       
     1437                        $avatars = bp_avatar_get_version_src( bp_get_activity_user_id(), bp_get_activity_date_recorded() );
     1438
     1439                        if ( $avatars && 1 === count( $avatars ) ) {
     1440                                $avatar            = reset( $avatars );
     1441                                $historical_avatar = trailingslashit( $avatar->parent_dir_url ) . $avatar->name;
     1442
     1443                                // Add historical avatar to the current activity.
     1444                                $activities_template->activity->historical_avatar = $historical_avatar;
     1445
     1446                                // Update the corresponding entry into the activities template global.
     1447                                $activity_id    = $activities_template->activity->id;
     1448                                $activity_index = 0;
     1449                                while ( (int) $activities_template->activities[ $activity_index ]->id !== (int) $activity_id ) {
     1450                                        $activity_index++;
     1451                                }
    14361452
    1437         return false;
     1453                                $activities_template->activities[ $activity_index ]->historical_avatar = $historical_avatar;
     1454
     1455                                // Force the content to be displayed.
     1456                                $has_content = true;
     1457                        }
     1458                }
     1459               
     1460                if ( 'friendship_created' === bp_get_activity_type() ) {                       
     1461                        $has_content = true;
     1462                }
     1463               
     1464                if ( 'joined_group' === bp_get_activity_type() ) {                     
     1465                        $has_content = true;
     1466                }
     1467               
     1468                if ( 'created_group' === bp_get_activity_type() ) {                     
     1469                        $has_content = true;
     1470                }
     1471               
     1472                if ( 'new_member' === bp_get_activity_type() ) {                       
     1473                        $has_content = true;
     1474                }
     1475               
     1476                if ( 'updated_profile' === bp_get_activity_type() ) {                   
     1477                        $has_content = true;
     1478                }
     1479        }
     1480       
     1481        /**
     1482         * Filter here to set activity content.
     1483         *
     1484         * @since 10.0.0
     1485         *
     1486         * @param boolean $has_content                          The activity content.
     1487         * @param array   $activities_template->activiy The current activity array.
     1488         */
     1489        return apply_filters( 'bp_activity_has_content', $has_content, $activities_template->activity );
    14381490}
    14391491
    14401492/**
  • src/bp-core/bp-core-attachments.php

    diff --git src/bp-core/bp-core-attachments.php src/bp-core/bp-core-attachments.php
    index e99ed0c14..a74069de5 100644
    function bp_attachments_create_item_type( $type = 'avatar', $args = array() ) { 
    409409
    410410        // It's an avatar, we need to crop it.
    411411        if ( 'avatar' === $type ) {
    412                 $created = bp_core_avatar_handle_crop( array(
    413                         'object'        => $r['object'],
    414                         'avatar_dir'    => trim( dirname( $attachment_data['subdir'] ), '/' ),
    415                         'item_id'       => (int) $r['item_id'],
    416                         'original_file' => trailingslashit( $attachment_data['subdir'] ) . $image_file_name,
    417                         'crop_w'        => $r['crop_w'],
    418                         'crop_h'        => $r['crop_h'],
    419                         'crop_x'        => $r['crop_x'],
    420                         'crop_y'        => $r['crop_y']
    421                 ) );
     412                $created = bp_core_avatar_handle_crop(
     413                        array(
     414                                'object'        => $r['object'],
     415                                'avatar_dir'    => trim( dirname( $attachment_data['subdir'] ), '/' ),
     416                                'item_id'       => (int) $r['item_id'],
     417                                'original_file' => trailingslashit( $attachment_data['subdir'] ) . $image_file_name,
     418                                'crop_w'        => $r['crop_w'],
     419                                'crop_h'        => $r['crop_h'],
     420                                'crop_x'        => $r['crop_x'],
     421                                'crop_y'        => $r['crop_y']
     422                        )
     423                );
    422424
    423425        // It's a cover image we need to fit it to feature's dimensions.
    424426        } elseif ( 'cover_image' === $type ) {
    425                 $cover_image = bp_attachments_cover_image_generate_file( array(
    426                         'file'            => $image_file_path,
    427                         'component'       => $r['component'],
    428                         'cover_image_dir' => $attachment_data['path']
    429                 ) );
     427                $cover_image = bp_attachments_cover_image_generate_file(
     428                        array(
     429                                'file'            => $image_file_path,
     430                                'component'       => $r['component'],
     431                                'cover_image_dir' => $attachment_data['path']
     432                        )
     433                );
    430434
    431435                $created = ! empty( $cover_image['cover_file'] );
    432436        }
    function bp_attachments_cover_image_ajax_delete() { 
    15971601        }
    15981602}
    15991603add_action( 'wp_ajax_bp_cover_image_delete', 'bp_attachments_cover_image_ajax_delete' );
     1604
     1605/**
     1606 * List the files of a directory.
     1607 *
     1608 * @since 10.0.0
     1609 *
     1610 * @param string $directory_path Absolute path of a directory.
     1611 * @return array The list of the files inside the directory.
     1612 */
     1613function bp_attachments_list_directory_files( $directory_path = '' ) {
     1614        if ( ! is_dir( $directory_path ) ) {
     1615                return array();
     1616        }
     1617
     1618        $files    = array();
     1619        $iterator = new FilesystemIterator( $directory_path, FilesystemIterator::SKIP_DOTS );
     1620
     1621        foreach ( $iterator as $file ) {
     1622                $_file = new stdClass();
     1623
     1624                $_file->name               = $file->getfilename();
     1625                $_file->path               = $file->getPathname();
     1626                $_file->size               = $file->getSize();
     1627                $_file->type               = $file->getType();
     1628                $_file->mime_type          = mime_content_type( $_file->path );
     1629                $_file->last_modified      = $file->getMTime();
     1630                $_file->latest_access_date = $file->getATime();
     1631                $_file->id                 = pathinfo( $_file->name, PATHINFO_FILENAME );
     1632                $files[ $_file->id ]       = $_file;
     1633        }
     1634
     1635        return $files;
     1636}
     1637
     1638/**
     1639 * List the files of a directory recursively and eventually find a file using its ID.
     1640 *
     1641 * @since 10.0.0
     1642 *
     1643 * @param string $directory_path Absolute path of a directory.
     1644 * @param string $find           The file ID to find into the directory or its children.
     1645 * @return array The list of the files.
     1646 */
     1647function bp_attachments_list_directory_files_recursively( $directory_path = '', $find = '' ) {
     1648        if ( ! is_dir( $directory_path ) ) {
     1649                return array();
     1650        }
     1651
     1652        $files     = array();
     1653        $directory = new RecursiveDirectoryIterator( $directory_path, FilesystemIterator::SKIP_DOTS );
     1654        $iterator  = new RecursiveIteratorIterator( $directory, RecursiveIteratorIterator::CHILD_FIRST );
     1655        $bp_upload = bp_upload_dir();
     1656
     1657        foreach ( $iterator as $file ) {
     1658                $_file = new stdClass();
     1659
     1660                $_file->name               = $file->getfilename();
     1661                $_file->path               = $file->getPathname();
     1662                $_file->size               = $file->getSize();
     1663                $_file->type               = $file->getType();
     1664                $_file->mime_type          = mime_content_type( $_file->path );
     1665                $_file->last_modified      = $file->getMTime();
     1666                $_file->latest_access_date = $file->getATime();
     1667                $_file->parent_dir_path    = dirname( $_file->path );
     1668                $_file->parent_dir_url     = str_replace( $bp_upload['basedir'], $bp_upload['baseurl'], $_file->parent_dir_path );
     1669                $_file->id                 = pathinfo( $_file->name, PATHINFO_FILENAME );
     1670
     1671                // Ensure URL is https if SSL is set/forced.
     1672                if ( is_ssl() ) {
     1673                        $_file->parent_dir_url = str_replace( 'http://', 'https://', $_file->parent_dir_url );
     1674                }
     1675
     1676                $file_id = $_file->id;
     1677                if ( $_file->parent_dir_path !== $directory_path ) {
     1678                        $file_id = trailingslashit( str_replace( trailingslashit( $directory_path ), '', $_file->parent_dir_path ) ) . $file_id;
     1679                }
     1680
     1681                $files[ $file_id ] = $_file;
     1682        }
     1683
     1684        if ( $find ) {
     1685                return wp_filter_object_list( $files, array( 'id' => $find ) );
     1686        }
     1687
     1688        return $files;
     1689}
  • src/bp-core/bp-core-avatars.php

    diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
    index 301c6bfdc..7336c6d3b 100644
    add_action( 'wp_ajax_bp_avatar_upload', 'bp_avatar_ajax_upload' ); 
    11761176 * Handle avatar webcam capture.
    11771177 *
    11781178 * @since 2.3.0
     1179 * @since 10.0.0 Adds the `$return` param to eventually return the crop result.
    11791180 *
    11801181 * @param string $data    Base64 encoded image.
    11811182 * @param int    $item_id Item to associate.
    1182  * @return bool True on success, false on failure.
     1183 * @param string $return  Whether to get the crop `array` or a `boolean`. Defaults to `boolean`.
     1184 * @return array|bool True on success, false on failure.
    11831185 */
    1184 function bp_avatar_handle_capture( $data = '', $item_id = 0 ) {
     1186function bp_avatar_handle_capture( $data = '', $item_id = 0, $return = 'boolean' ) {
    11851187        if ( empty( $data ) || empty( $item_id ) ) {
    11861188                return false;
    11871189        }
    function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { 
    12371239                // Crop to default values.
    12381240                $crop_args = array( 'item_id' => $item_id, 'original_file' => $avatar_to_crop, 'crop_x' => 0, 'crop_y' => 0 );
    12391241
     1242                if ( 'array' === $return ) {
     1243                        return bp_core_avatar_handle_crop( $crop_args, 'array' );
     1244                }
     1245
    12401246                return bp_core_avatar_handle_crop( $crop_args );
    12411247        } else {
    12421248                return false;
    function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { 
    12471253 * Crop an uploaded avatar.
    12481254 *
    12491255 * @since 1.1.0
     1256 * @since 10.0.0 Adds the `$return` param to eventually return the crop result.
    12501257 *
    12511258 * @param array|string $args {
    12521259 *     Array of function parameters.
    function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { 
    12651272 *     @type int         $crop_x        The horizontal starting point of the crop. Default: 0.
    12661273 *     @type int         $crop_y        The vertical starting point of the crop. Default: 0.
    12671274 * }
    1268  * @return bool True on success, false on failure.
     1275 * @param string       $return Whether to get the crop `array` or a `boolean`. Defaults to `boolean`.
     1276 * @return array|bool True or the crop result on success, false on failure.
    12691277 */
    1270 function bp_core_avatar_handle_crop( $args = '' ) {
     1278function bp_core_avatar_handle_crop( $args = '', $return = 'boolean' ) {
    12711279
    12721280        $r = bp_parse_args(
    12731281                $args,
    function bp_core_avatar_handle_crop( $args = '' ) { 
    13061314                return false;
    13071315        }
    13081316
     1317        if ( 'array' === $return ) {
     1318                return $cropped;
     1319        }
     1320
    13091321        return true;
    13101322}
    13111323
    function bp_avatar_ajax_set() { 
    13521364                        $webcam_avatar = base64_decode( $webcam_avatar );
    13531365                }
    13541366
    1355                 if ( ! bp_avatar_handle_capture( $webcam_avatar, $avatar_data['item_id'] ) ) {
     1367                $cropped_webcam_avatar = bp_avatar_handle_capture( $webcam_avatar, $avatar_data['item_id'], 'array' );
     1368
     1369                if ( ! $cropped_webcam_avatar ) {
    13561370                        wp_send_json_error( array(
    13571371                                'feedback_code' => 1
    13581372                        ) );
    13591373
    13601374                } else {
    13611375                        $return = array(
    1362                                 'avatar' => esc_url( bp_core_fetch_avatar( array(
    1363                                         'object'  => $avatar_data['object'],
    1364                                         'item_id' => $avatar_data['item_id'],
    1365                                         'html'    => false,
    1366                                         'type'    => 'full',
    1367                                 ) ) ),
     1376                                'avatar' => esc_url(
     1377                                        bp_core_fetch_avatar(
     1378                                                array(
     1379                                                        'object'  => $avatar_data['object'],
     1380                                                        'item_id' => $avatar_data['item_id'],
     1381                                                        'html'    => false,
     1382                                                        'type'    => 'full',
     1383                                                )
     1384                                        )
     1385                                ),
    13681386                                'feedback_code' => 2,
    13691387                                'item_id'       => $avatar_data['item_id'],
    13701388                        );
    function bp_avatar_ajax_set() { 
    13761394                         * Fires if the new avatar was successfully captured.
    13771395                         *
    13781396                         * @since 6.0.0
     1397                         * @since 10.0.0 Adds a new param: an array containing the full, thumb avatar and the timestamp.
    13791398                         *
    1380                          * @param string $item_id     Inform about the user id the avatar was set for.
    1381                          * @param string $type        Inform about the way the avatar was set ('camera').
    1382                          * @param array  $avatar_data Array of parameters passed to the avatar handler.
     1399                         * @param string $item_id               Inform about the user id the avatar was set for.
     1400                         * @param string $type                  Inform about the way the avatar was set ('camera').
     1401                         * @param array  $avatar_data           Array of parameters passed to the crop handler.
     1402                         * @param array  $cropped_webcam_avatar Array containing the full, thumb avatar and the timestamp.
    13831403                         */
    1384                         do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data );
     1404                        do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $avatar_data, $cropped_webcam_avatar );
    13851405
    13861406                        wp_send_json_success( $return );
    13871407                }
    function bp_avatar_ajax_set() { 
    14131433        );
    14141434
    14151435        // Handle crop.
    1416         if ( bp_core_avatar_handle_crop( $r ) ) {
     1436        $cropped_avatar = bp_core_avatar_handle_crop( $r, 'array' );
     1437
     1438        if ( $cropped_avatar ) {
    14171439                $return = array(
    1418                         'avatar' => esc_url( bp_core_fetch_avatar( array(
    1419                                 'object'  => $avatar_data['object'],
    1420                                 'item_id' => $avatar_data['item_id'],
    1421                                 'html'    => false,
    1422                                 'type'    => 'full',
    1423                         ) ) ),
     1440                        'avatar' => esc_url(
     1441                                bp_core_fetch_avatar(
     1442                                        array(
     1443                                                'object'  => $avatar_data['object'],
     1444                                                'item_id' => $avatar_data['item_id'],
     1445                                                'html'    => false,
     1446                                                'type'    => 'full',
     1447                                        )
     1448                                )
     1449                        ),
    14241450                        'feedback_code' => 2,
    14251451                        'item_id'       => $avatar_data['item_id'],
    14261452                );
    function bp_avatar_ajax_set() { 
    14301456                        do_action_deprecated( 'xprofile_avatar_uploaded', array( (int) $avatar_data['item_id'], $avatar_data['type'], $r ), '6.0.0', 'bp_members_avatar_uploaded' );
    14311457
    14321458                        /** This action is documented in bp-core/bp-core-avatars.php */
    1433                         do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
     1459                        do_action( 'bp_members_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r, $cropped_avatar );
    14341460                } elseif ( 'group' === $avatar_data['object'] ) {
    14351461                        /** This action is documented in bp-groups/bp-groups-screens.php */
    1436                         do_action( 'groups_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r );
     1462                        do_action( 'groups_avatar_uploaded', (int) $avatar_data['item_id'], $avatar_data['type'], $r, $cropped_avatar );
    14371463                }
    14381464
    14391465                wp_send_json_success( $return );
    function bp_avatar_template_check() { 
    21222148                bp_attachments_get_template_part( 'avatars/index' );
    21232149        }
    21242150}
     2151
     2152/**
     2153 * Get a specific version of an avatar from its history
     2154 *
     2155 * @since 10.0.0
     2156 *
     2157 * @param int        $user_id   The user ID we need the avatar version for.
     2158 * @param int|string $timestamp An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'.
     2159 * @param string     $type      The type of avatar we need. Possible values are `thumb` and `full`.
     2160 * @return array                A list of matching results, an empty array if no avatars were found.
     2161 */
     2162function bp_avatar_get_version_src( $user_id = 0, $timestamp = '', $type = 'full' ) {
     2163        if ( ! $user_id || ! $timestamp ) {
     2164                return array();
     2165        }
     2166
     2167        if ( ! is_numeric( $timestamp ) ) {
     2168                $timestamp = strtotime( $timestamp );
     2169        }
     2170
     2171        $avatar_id = $timestamp . '-bpfull';
     2172        if ( 'full' !== $type ) {
     2173                $avatar_id = $timestamp . '-bpthumb';
     2174        }
     2175
     2176        // The user avatar directory we are looking into to get the avatar url.
     2177        $user_avatar_dir = trailingslashit( bp_core_avatar_upload_path() ) . 'avatars/' . $user_id;
     2178
     2179        return bp_attachments_list_directory_files_recursively( $user_avatar_dir, $avatar_id );
     2180}
  • src/bp-core/classes/class-bp-attachment-avatar.php

    diff --git src/bp-core/classes/class-bp-attachment-avatar.php src/bp-core/classes/class-bp-attachment-avatar.php
    index d95ad4c4c..f13188bdd 100644
    class BP_Attachment_Avatar extends BP_Attachment { 
    199199         * @see  BP_Attachment::crop for the list of parameters
    200200         *
    201201         * @param array $args Array of arguments for the cropping.
    202          * @return array The cropped avatars (full and thumb).
     202         * @return array The cropped avatars (full, thumb and the timestamp).
    203203         */
    204204        public function crop( $args = array() ) {
    205205                // Bail if the original file is missing.
    class BP_Attachment_Avatar extends BP_Attachment { 
    255255
    256256                /**
    257257                 * Check that the new avatar doesn't have the same name as the
    258                  * old one before deleting
     258                 * old one before moving the previous one into history.
    259259                 */
    260260                if ( ! empty( $existing_avatar ) && $existing_avatar !== $this->url . $relative_path ) {
    261                         bp_core_delete_existing_avatar( array( 'object' => $args['object'], 'item_id' => $args['item_id'], 'avatar_path' => $avatar_folder_dir ) );
     261                        // Add a new revision for the existing avatar.
     262                        $avatars = bp_attachments_list_directory_files( $avatar_folder_dir );
     263
     264                        if ( $avatars ) {
     265                                foreach ( $avatars as $avatar_file ) {
     266                                        if ( ! isset( $avatar_file->name, $avatar_file->id, $avatar_file->path ) ) {
     267                                                continue;
     268                                        }
     269
     270                                        $is_full  = preg_match( "/-bpfull/", $avatar_file->name );
     271                                        $is_thumb = preg_match( "/-bpthumb/", $avatar_file->name );
     272
     273                                        if ( $is_full || $is_thumb ) {
     274                                                $revision = $this->add_revision(
     275                                                        'avatar',
     276                                                        array(
     277                                                                'file_abspath' => $avatar_file->path,
     278                                                                'file_id'      => $avatar_file->id,
     279                                                        )
     280                                                );
     281
     282                                                if ( is_wp_error( $revision ) ) {
     283                                                        error_log( $revision->get_error_message() );
     284                                                }
     285                                        }
     286                                }
     287                        }
    262288                }
    263289
    264290                // Make sure we at least have minimal data for cropping.
    class BP_Attachment_Avatar extends BP_Attachment { 
    272298
    273299                // Get the file extension.
    274300                $data = @getimagesize( $absolute_path );
    275                 $ext  = $data['mime'] == 'image/png' ? 'png' : 'jpg';
     301                $ext  = $data['mime'] === 'image/png' ? 'png' : 'jpg';
    276302
    277303                $args['original_file'] = $absolute_path;
    278304                $args['src_abs']       = false;
    279                 $avatar_types = array( 'full' => '', 'thumb' => '' );
     305
     306                $avatar_types = array(
     307                        'full'  => '',
     308                        'thumb' => '',
     309                );
     310                $timestamp   = bp_core_current_time( false, 'timestamp' );
    280311
    281312                foreach ( $avatar_types as $key_type => $type ) {
    282313                        if ( 'thumb' === $key_type ) {
    class BP_Attachment_Avatar extends BP_Attachment { 
    287318                                $args['dst_h'] = bp_core_avatar_full_height();
    288319                        }
    289320
    290                         $filename         = wp_unique_filename( $avatar_folder_dir, uniqid() . "-bp{$key_type}.{$ext}" );
     321                        $filename         = wp_unique_filename( $avatar_folder_dir, $timestamp . "-bp{$key_type}.{$ext}" );
    291322                        $args['dst_file'] = $avatar_folder_dir . '/' . $filename;
    292323
    293324                        $avatar_types[ $key_type ] = parent::crop( $args );
    class BP_Attachment_Avatar extends BP_Attachment { 
    296327                // Remove the original.
    297328                @unlink( $absolute_path );
    298329
    299                 // Return the full and thumb cropped avatars.
    300                 return $avatar_types;
     330                // Return the full, thumb cropped avatars and the timestamp.
     331                return array_merge(
     332                        $avatar_types,
     333                        array(
     334                                'timestamp' => $timestamp,
     335                        )
     336                );
    301337        }
    302338
    303339        /**
  • src/bp-core/classes/class-bp-attachment.php

    diff --git src/bp-core/classes/class-bp-attachment.php src/bp-core/classes/class-bp-attachment.php
    index 9362a6c12..248c44946 100644
    abstract class BP_Attachment { 
    559559                return $script_data;
    560560        }
    561561
     562        /**
     563         * Adds a new revision of a file.
     564         *
     565         * @since 10.0.0
     566         *
     567         * @param string $attachment_type The attachement type (eg: avatar).
     568         * @param array $args {
     569         *     @type string $file_abspath The source file (absolute path) for the attachment.
     570         *     @type string $file_id      Optional. The file ID to use as a suffix for the revision directory.
     571         * }
     572         * @return object|WP_Error An object informing about the URL an Path to a revision file, a WP_Error object on failure.
     573         */
     574        public function add_revision( $attachment_type, $args = array() ) {
     575                $r = bp_parse_args(
     576                        $args,
     577                        array(
     578                                'file_abspath' => '',
     579                                'file_id'      => '',
     580                        ),
     581                        'attachment_' . $attachment_type . '_add_revision'
     582                );
     583
     584                if ( ! $r['file_abspath'] ) {
     585                        return new WP_Error( 'missing_parameter', __( 'The absolute path to your file is missing.', 'buddypress' ) );
     586
     587                        // Make sure it's coming from an uploaded file.
     588                } elseif ( false === strpos( $r['file_abspath'], $this->upload_path ) ) {
     589                        return new WP_Error( 'forbidden_path', __( 'The absolute path to your file is not allowed.', 'buddypress' ) );
     590
     591                } else {
     592                        $filepath = $r['file_abspath'];
     593                }
     594
     595                $dirname  = trailingslashit( dirname( $filepath ) );
     596                $filename = sanitize_file_name( wp_basename( $filepath ) );
     597
     598                if ( ! $r['file_id'] ) {
     599                        $r['file_id'] = $filename;
     600                }
     601
     602                $file_id = wp_hash( $r['file_id'] );
     603
     604                // Set the revision name & dir.
     605                $revision_name = '';
     606                $revision_dir  = $dirname . '._revisions_' . $file_id;
     607
     608                // Avatars and Cover Images are specific attachments.
     609                if ( 'avatar' === $attachment_type || 'cover_image' === $attachment_type ) {
     610                        $revision_dir  = $dirname . 'history';
     611                }
     612
     613                // Create the revision directory if it doesn't exist yet.
     614                if ( ! is_dir( $revision_dir ) ) {
     615                        mkdir( $revision_dir );
     616                }
     617
     618                $revision_name = wp_unique_filename( $revision_dir, $filename );
     619                $revision_path = trailingslashit( $revision_dir ) . $revision_name;
     620
     621                if ( ! rename( $filepath, $revision_path ) ) {
     622                        return new WP_Error( 'missing_parameter', __( 'An unexpected error occured while adding the revision.', 'buddypress' ) );
     623                }
     624
     625                return (object) array(
     626                        'url'  => str_replace( trailingslashit( $this->upload_path ), trailingslashit( $this->url ), $revision_path ),
     627                        'path' => $revision_path,
     628                );
     629        }
     630
    562631        /**
    563632         * Get full data for an image
    564633         *
  • src/bp-groups/actions/create.php

    diff --git src/bp-groups/actions/create.php src/bp-groups/actions/create.php
    index 132429bd1..54e2cc589 100644
    function groups_action_create_group() { 
    270270                                'crop_h'        => $_POST['h']
    271271                        );
    272272
    273                         if ( ! bp_core_avatar_handle_crop( $args ) ) {
     273                        $cropped_avatar = bp_core_avatar_handle_crop( $args, 'array' );
     274
     275                        if ( ! $cropped_avatar ) {
    274276                                bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' );
    275277                        } else {
    276278                                /**
    277279                                 * Fires after a group avatar is uploaded.
    278280                                 *
    279281                                 * @since 2.8.0
     282                                 * @since 10.0.0 Adds a new param: an array containing the full, thumb avatar and the timestamp.
    280283                                 *
    281                                  * @param int    $group_id ID of the group.
    282                                  * @param string $type     Avatar type. 'crop' or 'full'.
    283                                  * @param array  $args     Array of parameters passed to the avatar handler.
     284                                 * @param int    $group_id       ID of the group.
     285                                 * @param string $type           Avatar type. 'crop' or 'camera'.
     286                                 * @param array  $args           Array of parameters passed to the crop handler.
     287                                 * @param array  $cropped_avatar Array containing the full, thumb avatar and the timestamp.
    284288                                 */
    285                                 do_action( 'groups_avatar_uploaded', bp_get_current_group_id(), 'crop', $args );
     289                                do_action( 'groups_avatar_uploaded', bp_get_current_group_id(), 'crop', $args, $cropped_avatar );
    286290
    287291                                bp_core_add_message( __( 'The group profile photo was uploaded successfully.', 'buddypress' ) );
    288292                        }
  • src/bp-groups/screens/single/admin/group-avatar.php

    diff --git src/bp-groups/screens/single/admin/group-avatar.php src/bp-groups/screens/single/admin/group-avatar.php
    index 3e2927a1e..57fc59451 100644
    function groups_screen_group_admin_avatar() { 
    7474                        'crop_h'        => $_POST['h']
    7575                );
    7676
    77                 if ( !bp_core_avatar_handle_crop( $args ) ) {
     77                $cropped_avatar = bp_core_avatar_handle_crop( $args, 'array' );
     78
     79                if ( ! $cropped_avatar ) {
    7880                        bp_core_add_message( __( 'There was a problem cropping the group profile photo.', 'buddypress' ), 'error' );
    7981                } else {
    8082                        /**
    8183                         * Fires after a group avatar is uploaded.
    8284                         *
    8385                         * @since 2.8.0
     86                         * @since 10.0.0 Adds a new param: an array containing the full, thumb avatar and the timestamp.
    8487                         *
    85                          * @param int    $group_id ID of the group.
    86                          * @param string $type     Avatar type. 'crop' or 'full'.
    87                          * @param array  $args     Array of parameters passed to the avatar handler.
     88                         * @param int    $group_id       ID of the group.
     89                         * @param string $type           Avatar type. 'crop' or 'camera'.
     90                         * @param array  $args           Array of parameters passed to the avatar handler.
     91                         * @param array  $cropped_avatar Array containing the full, thumb avatar and the timestamp.
    8892                         */
    89                         do_action( 'groups_avatar_uploaded', bp_get_current_group_id(), 'crop', $args );
     93                        do_action( 'groups_avatar_uploaded', bp_get_current_group_id(), 'crop', $args, $cropped_avatar );
    9094                        bp_core_add_message( __( 'The new group profile photo was uploaded successfully.', 'buddypress' ) );
    9195                }
    9296        }
    function groups_screen_group_admin_avatar() { 
    109113         */
    110114        bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) );
    111115}
    112 add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
    113  No newline at end of file
     116add_action( 'bp_screens', 'groups_screen_group_admin_avatar' );
  • src/bp-members/bp-members-activity.php

    diff --git src/bp-members/bp-members-activity.php src/bp-members/bp-members-activity.php
    index 890ff2317..1645c1542 100644
    add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' ); 
    166166 * Adds an activity stream item when a user has uploaded a new avatar.
    167167 *
    168168 * @since 8.0.0
     169 * @since 10.0.0 Adds the `$type`, `$crop_data` and `$cropped_avatar` parameters.
    169170 *
    170  * @param int $user_id The user id the avatar was set for.
     171 * @param int    $user_id        The user id the avatar was set for.
     172 * @param string $type           The way the avatar was set ('camera' or `crop`).
     173 * @param array  $crop_data      Array of parameters passed to the crop handler.
     174 * @param array  $cropped_avatar Array containing the full, thumb avatar and the timestamp.
    171175 */
    172 function bp_members_new_avatar_activity( $user_id = 0 ) {
     176function bp_members_new_avatar_activity( $user_id = 0, $type = '', $crop_data = array(), $cropped_avatar = array() ) {
    173177
    174178        // Bail if activity component is not active.
    175179        if ( ! bp_is_active( 'activity' ) ) {
    function bp_members_new_avatar_activity( $user_id = 0 ) { 
    230234                }
    231235        }
    232236
     237        $recorded_time = '';
     238        if ( isset( $cropped_avatar['timestamp'] ) && $cropped_avatar['timestamp'] ) {
     239                $recorded_time = date( 'Y-m-d H:i:s', $cropped_avatar['timestamp'] );
     240        }
     241
    233242        // Add the activity.
    234         bp_activity_add(
     243        $activity_id = bp_activity_add(
    235244                array(
    236                         'user_id'   => $user_id,
    237                         'component' => $bp->members->id,
    238                         'type'      => 'new_avatar',
     245                        'user_id'       => $user_id,
     246                        'component'     => $bp->members->id,
     247                        'type'          => 'new_avatar',
     248                        'recorded_time' => $recorded_time,
    239249                )
    240250        );
    241251}
    242 add_action( 'bp_members_avatar_uploaded', 'bp_members_new_avatar_activity' );
     252add_action( 'bp_members_avatar_uploaded', 'bp_members_new_avatar_activity', 10, 4 );
  • src/bp-members/screens/change-avatar.php

    diff --git src/bp-members/screens/change-avatar.php src/bp-members/screens/change-avatar.php
    index 5c4bcf440..6a421ec77 100644
    function bp_members_screen_change_avatar() { 
    6161                        'crop_h'        => $_POST['h']
    6262                );
    6363
    64                 if ( ! bp_core_avatar_handle_crop( $args ) ) {
     64                // Handle crop.
     65                $cropped_avatar = bp_core_avatar_handle_crop( $r, 'array' );
     66
     67                if ( ! $cropped_avatar ) {
    6568                        bp_core_add_message( __( 'There was a problem cropping your profile photo.', 'buddypress' ), 'error' );
    6669                } else {
    6770
    function bp_members_screen_change_avatar() { 
    7275                         * Fires right before the redirect, after processing a new avatar.
    7376                         *
    7477                         * @since 6.0.0
     78                         * @since 10.0.0 Adds a new param: an array containing the full, thumb avatar and the timestamp.
    7579                         *
    76                          * @param string $item_id Inform about the user id the avatar was set for.
    77                          * @param string $value   Inform about the way the avatar was set ('crop').
     80                         * @param string $item_id        Inform about the user id the avatar was set for.
     81                         * @param string $type           Inform about the way the avatar was set ('camera').
     82                         * @param array  $args           Array of parameters passed to the crop handler.
     83                         * @param array  $cropped_avatar Array containing the full, thumb avatar and the timestamp.
    7884                         */
    79                         do_action( 'bp_members_avatar_uploaded', (int) $args['item_id'], 'crop' );
     85                        do_action( 'bp_members_avatar_uploaded', (int) $args['item_id'], 'crop', $args, $cropped_avatar );
    8086
    8187                        bp_core_add_message( __( 'Your new profile photo was uploaded successfully.', 'buddypress' ) );
    8288                        bp_core_redirect( bp_displayed_user_domain() );
  • src/bp-templates/bp-legacy/buddypress/activity/entry.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/entry.php src/bp-templates/bp-legacy/buddypress/activity/entry.php
    index 6386939a2..3d46d6dcd 100644
    do_action( 'bp_before_activity_entry' ); ?> 
    3737                <?php if ( bp_activity_has_content() ) : ?>
    3838
    3939                        <div class="activity-inner">
    40 
    41                                 <?php bp_activity_content_body(); ?>
     40                               
     41                                <?php bp_get_template_part( 'activity/type-parts/activity-content',  bp_get_activity_type() ); ?>
    4242
    4343                        </div>
    4444
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-created_group.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-created_group.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-created_group.php
    new file mode 100644
    index 000000000..143d25c6c
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for created group
     4 *
     5 * This template is used by activity.php and show the created group activity content
     6 * each created group activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13
     14$activity                       = $activities_template->activity;
     15$group                          = groups_get_group( array( 'group_id' => $activity->item_id ) );
     16$group_name             = $group->name;
     17$group_url              = bp_get_group_permalink( $group );
     18$group_cover_image      = bp_get_group_cover_url( $group );             
     19$action_button_text = esc_html__( 'Visit Group', 'buddypress');
     20
     21$group_avatar_url       = bp_core_fetch_avatar(
     22                                                array(
     23                                                        'item_id'    => $group->id,
     24                                                        'avatar_dir' => 'group-avatars',
     25                                                        'object'     => 'group',
     26                                                        'type'       => 'full',
     27                                                        'html'       => false,                                                                 
     28                                                        'width'      => 150,
     29                                                        'height'     => 150,
     30                                                )
     31                                        );
     32
     33if ( $group_avatar_url ) : ?>
     34        <div class="bp-group-activity-preview">
     35       
     36                <a href="<?php echo esc_url( $group_url ); ?>">
     37               
     38                        <div class="bp-group-preview-cover">
     39                       
     40                        <?php if ( $group_cover_image != '') : ?>
     41                       
     42                                <img src="<?php echo esc_url( $group_cover_image ) ;?>" alt="cover-image"/>
     43                               
     44                        <?php endif; ?>
     45                       
     46                        </div>
     47                       
     48                </a>
     49               
     50                <div class="bp-group-short-description">
     51                       
     52                        <div class="bp-group-avatar-content">
     53                       
     54                                <img src="<?php echo esc_url( $group_avatar_url ); ?>" class="group-photo aligncenter" width="150" height="150">
     55                               
     56                        </div>
     57                       
     58                        <p class="bp-group-short-description-title">
     59                       
     60                                <a href="<?php echo esc_url( $group_url ); ?>"><?php echo esc_html( $group_name );?></a>
     61                               
     62                        </p>
     63       
     64                        <?php
     65                        echo sprintf(
     66                                '<div class="bp-profile-button">
     67                                        <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     68                                </div>',
     69                                esc_url( $group_url ),
     70                                $action_button_text
     71                        ); ?>
     72                       
     73                </div>
     74               
     75        </div>
     76       
     77<?php endif;
     78 No newline at end of file
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-friendship_created.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-friendship_created.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-friendship_created.php
    new file mode 100644
    index 000000000..ee6befb5a
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for friendship created
     4 *
     5 * This template is used by activity.php and show the friendship created activity content
     6 * each friendship created activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13$activity                       = $activities_template->activity;
     14$friend_url             = bp_core_get_user_domain( $activity->user_id );
     15$friend_displayname = bp_core_get_user_displayname( $activity->user_id );
     16$friend_mentionname = bp_activity_get_user_mentionname( $activity->user_id );           
     17
     18$friend_avatar_url = bp_core_fetch_avatar(
     19                                                        array(
     20                                                                'item_id' => $activity->user_id,
     21                                                                'type'    => 'full',
     22                                                                'width'   => 150,
     23                                                                'height'  => 150,
     24                                                                'class'   => 'avatar',
     25                                                                'id'      => false,
     26                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $friend_displayname ) ),
     27                                                                'html'    => false
     28                                                        )
     29                                                );
     30                                               
     31                                               
     32$user_url               = bp_core_get_user_domain( $activity->secondary_item_id );
     33$user_displayname       = bp_core_get_user_displayname( $activity->secondary_item_id );
     34$user_mentionname       = bp_activity_get_user_mentionname( $activity->secondary_item_id );             
     35$action_button_text = esc_html__( 'View Profile', 'buddypress');
     36$user_cover_image       = bp_attachments_get_attachment(
     37                                                        'url',
     38                                                        array(
     39                                                                'object_dir' => 'members',
     40                                                                'item_id'    => $activity->secondary_item_id,
     41                                                        )
     42                                                );
     43$args   = array( 'r' => $user_mentionname );
     44$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     45$user_mentionname_url = wp_nonce_url( $url );
     46
     47$avatar_url = bp_core_fetch_avatar(
     48                                                        array(
     49                                                                'item_id' => $activity->secondary_item_id,
     50                                                                'type'    => 'full',
     51                                                                'width'   => 150,
     52                                                                'height'  => 150,
     53                                                                'class'   => 'avatar',
     54                                                                'id'      => false,
     55                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     56                                                                'html'    => false
     57                                                        )
     58                                                );
     59
     60
     61if ( $avatar_url ) : ?>
     62
     63        <div class="bp-member-activity-preview">
     64       
     65                <a href="<?php echo esc_url( $user_url ); ?>">
     66               
     67                        <div class="bp-member-preview-cover">
     68                       
     69                                <?php if ( $user_cover_image != '') :?>
     70                               
     71                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="<?php esc_attr_e( "cover-image" , 'buddypress' );?>"/>
     72                                <?php endif; ?>
     73                               
     74                        </div>
     75                       
     76                </a>
     77               
     78                <div class="bp-member-short-description">
     79               
     80                        <div class="bp-members-avatar-wrapper">
     81               
     82                                <div class="bp-members-avatar-content-inner">
     83                               
     84                                        <div class="bp-member-avatar-content">
     85                                       
     86                                                <img src="<?php echo esc_url( $friend_avatar_url );?>" class="profile-photo aligncenter">
     87                                               
     88                                        </div>
     89                                       
     90                                        <p class="bp-member-short-description-title">
     91                                       
     92                                                <a href="<?php echo esc_url( $friend_url ); ?>"><?php echo esc_html( $friend_displayname );?></a>
     93                                               
     94                                        </p>
     95                                       
     96                                </div>
     97                               
     98                                <div class="bp-members-avatar-content-inner">
     99                               
     100                                        <div class="bp-member-avatar-content">
     101                                       
     102                                                <img src="<?php echo esc_url( $avatar_url );?>" class="profile-photo aligncenter">
     103                                               
     104                                        </div>
     105                                       
     106                                        <p class="bp-member-short-description-title">
     107                                       
     108                                                <a href="<?php echo esc_url( $user_url ); ?>"><?php echo esc_html( $user_displayname );?></a>
     109                                               
     110                                        </p>
     111                                       
     112                                </div>
     113                               
     114                        </div>
     115                       
     116                </div>
     117               
     118        </div>
     119       
     120<?php endif;
     121
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-joined_group.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-joined_group.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-joined_group.php
    new file mode 100644
    index 000000000..144524b33
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for joined group
     4 *
     5 * This template is used by activity.php and show the joined group activity content
     6 * each joined group activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13
     14$activity                       = $activities_template->activity;
     15$group                          = groups_get_group( array( 'group_id' => $activity->item_id ) );
     16$group_name             = $group->name;
     17$group_url              = bp_get_group_permalink( $group );
     18$group_cover_image      = bp_get_group_cover_url( $group );             
     19$action_button_text = esc_html__( 'Visit Group', 'buddypress');
     20
     21$group_avatar_url       = bp_core_fetch_avatar(
     22                                                array(
     23                                                        'item_id'    => $group->id,
     24                                                        'avatar_dir' => 'group-avatars',
     25                                                        'object'     => 'group',
     26                                                        'type'       => 'full',
     27                                                        'html'       => false,                                                                 
     28                                                        'width'      => 150,
     29                                                        'height'     => 150,
     30                                                )
     31                                        );
     32
     33if ( $group_avatar_url ) : ?>
     34        <div class="bp-group-activity-preview">
     35       
     36                <a href="<?php echo esc_url( $group_url ); ?>">
     37               
     38                        <div class="bp-group-preview-cover">
     39                       
     40                        <?php if ( $group_cover_image != '') : ?>
     41                       
     42                                <img src="<?php echo esc_url( $group_cover_image ) ;?>" alt="cover-image"/>
     43                               
     44                        <?php endif; ?>
     45                       
     46                        </div>
     47                       
     48                </a>
     49               
     50                <div class="bp-group-short-description">
     51                       
     52                        <div class="bp-group-avatar-content">
     53                       
     54                                <img src="<?php echo esc_url( $group_avatar_url ); ?>" class="group-photo aligncenter" width="150" height="150">
     55                               
     56                        </div>
     57                       
     58                        <p class="bp-group-short-description-title">
     59                       
     60                                <a href="<?php echo esc_url( $group_url ); ?>"><?php echo esc_html( $group_name );?></a>
     61                               
     62                        </p>
     63       
     64                        <?php
     65                        echo sprintf(
     66                                '<div class="bp-profile-button">
     67                                        <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     68                                </div>',
     69                                esc_url( $group_url ),
     70                                $action_button_text
     71                        ); ?>
     72                       
     73                </div>
     74               
     75        </div>
     76       
     77<?php endif;
     78 No newline at end of file
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-new_avatar.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-new_avatar.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-new_avatar.php
    new file mode 100644
    index 000000000..03e4618b8
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for new avatar
     4 *
     5 * This template is used by activity.php and show the new avatar activity content
     6 * each new avatar activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13
     14$historical_avatar      = '';
     15$activity                       = $activities_template->activity;
     16$user_url               = bp_core_get_user_domain( $activity->user_id );
     17$user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     18$user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     19$action_button_text = esc_html__( 'View Profile', 'buddypress');
     20$user_cover_image       = bp_attachments_get_attachment(
     21                                                        'url',
     22                                                        array(
     23                                                                'object_dir' => 'members',
     24                                                                'item_id'    => $activity->user_id,
     25                                                        )
     26                                                );
     27$args   = array( 'r' => $user_mentionname );
     28$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     29$user_mentionname_url = wp_nonce_url( $url );
     30
     31if ( isset( $activity->historical_avatar ) && $activity->historical_avatar ) {
     32        $historical_avatar = str_replace('\history','/history',$activity->historical_avatar);
     33} else {
     34        $avatars = bp_avatar_get_version_src( $activity->user_id, $activity->date_recorded );
     35
     36        if ( $avatars && 1 === count( $avatars ) ) {
     37                $avatar            = reset( $avatars );
     38                $historical_avatar = trailingslashit( $avatar->parent_dir_url ) . $avatar->name;
     39        }
     40}
     41
     42if ( $historical_avatar ) : ?>
     43
     44        <div class="bp-member-activity-preview">
     45       
     46                <a href="<?php echo esc_url( $user_url ); ?>">
     47               
     48                        <div class="bp-member-preview-cover">
     49                       
     50                                <?php if ( $user_cover_image != '') : ?>
     51                               
     52                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="cover-image"/>
     53                                       
     54                                <?php endif; ?>
     55                               
     56                        </div>
     57                       
     58                </a>
     59               
     60                <div class="bp-member-short-description">
     61               
     62                        <div class="bp-member-avatar-content">
     63                               
     64                                <img src="<?php echo esc_url( $historical_avatar ); ?>" class="profile-photo aligncenter">
     65                               
     66                        </div>
     67                       
     68                        <p class="bp-member-short-description-title">
     69                       
     70                                <a href="<?php echo esc_url( $user_url );?>"><?php echo esc_html( $user_displayname ); ?> </a>
     71                                       
     72                        </p>
     73                               
     74                        <p class="bp-member-nickname">
     75                               
     76                                <a href="<?php echo esc_url( $user_mentionname_url ); ?>">@<?php echo esc_html( $user_mentionname ); ?></a>
     77                               
     78                        </p>
     79                               
     80                        <?php
     81                       
     82                        echo sprintf(
     83                                                '<div class="bp-profile-button">
     84                                                        <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     85                                                </div>',
     86                                                esc_url( $user_url ),
     87                                                $action_button_text
     88                                        );
     89                        ?>
     90                       
     91                </div>
     92               
     93        </div>
     94       
     95<?php endif;
     96 No newline at end of file
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-new_member.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-new_member.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-new_member.php
    new file mode 100644
    index 000000000..2476f520b
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for friendship created
     4 *
     5 * This template is used by activity.php and show the friendship created activity content
     6 * each friendship created activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13$activity                       = $activities_template->activity;
     14$user_url               = bp_core_get_user_domain( $activity->user_id );
     15$user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     16$user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     17$action_button_text = esc_html__( 'View Profile', 'buddypress');
     18$user_cover_image       = bp_attachments_get_attachment(
     19                                                        'url',
     20                                                        array(
     21                                                                'object_dir' => 'members',
     22                                                                'item_id'    => $activity->user_id,
     23                                                        )
     24                                                );
     25$args   = array( 'r' => $user_mentionname );
     26$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     27$user_mentionname_url = wp_nonce_url( $url );
     28
     29$avatar_url = bp_core_fetch_avatar(
     30                                                        array(
     31                                                                'item_id' => $activity->user_id,
     32                                                                'type'    => 'full',
     33                                                                'width'   => 150,
     34                                                                'height'  => 150,
     35                                                                'class'   => 'avatar',
     36                                                                'id'      => false,
     37                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     38                                                                'html'    => false
     39                                                        )
     40                                                );
     41
     42
     43if ( $avatar_url ) : ?>
     44
     45        <div class="bp-member-activity-preview">
     46       
     47                <a href="<?php echo esc_url( $user_url ); ?>">
     48               
     49                        <div class="bp-member-preview-cover">
     50                       
     51                                <?php if ( $user_cover_image != '') :?>
     52                               
     53                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="<?php esc_attr_e( "cover-image" , 'buddypress' );?>"/>
     54                                <?php endif; ?>
     55                               
     56                        </div>
     57                       
     58                </a>
     59               
     60                <div class="bp-member-short-description">
     61               
     62                        <div class="bp-member-avatar-content">
     63                       
     64                                <img src="<?php echo esc_url( $avatar_url );?>" class="profile-photo aligncenter">
     65                               
     66                        </div>
     67                       
     68                        <p class="bp-member-short-description-title">
     69                       
     70                                <a href="<?php echo esc_url( $user_url ); ?>"><?php echo esc_html( $user_displayname );?></a>
     71                               
     72                        </p>
     73                       
     74                        <p class="bp-member-nickname">
     75                       
     76                                <a href="<?php echo esc_url( $user_mentionname_url );?>">@<?php echo esc_html( $user_mentionname ); ?></a>
     77                        </p>
     78                               
     79                        <?php
     80                        echo sprintf(
     81                                        '<div class="bp-profile-button">
     82                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     83                                        </div>',
     84                                        esc_url( $user_url ),
     85                                        $action_button_text
     86                                );
     87                        ?>
     88                       
     89                </div>
     90               
     91        </div>
     92       
     93<?php endif;
     94
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-updated_profile.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-updated_profile.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content-updated_profile.php
    new file mode 100644
    index 000000000..2476f520b
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for friendship created
     4 *
     5 * This template is used by activity.php and show the friendship created activity content
     6 * each friendship created activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13$activity                       = $activities_template->activity;
     14$user_url               = bp_core_get_user_domain( $activity->user_id );
     15$user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     16$user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     17$action_button_text = esc_html__( 'View Profile', 'buddypress');
     18$user_cover_image       = bp_attachments_get_attachment(
     19                                                        'url',
     20                                                        array(
     21                                                                'object_dir' => 'members',
     22                                                                'item_id'    => $activity->user_id,
     23                                                        )
     24                                                );
     25$args   = array( 'r' => $user_mentionname );
     26$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     27$user_mentionname_url = wp_nonce_url( $url );
     28
     29$avatar_url = bp_core_fetch_avatar(
     30                                                        array(
     31                                                                'item_id' => $activity->user_id,
     32                                                                'type'    => 'full',
     33                                                                'width'   => 150,
     34                                                                'height'  => 150,
     35                                                                'class'   => 'avatar',
     36                                                                'id'      => false,
     37                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     38                                                                'html'    => false
     39                                                        )
     40                                                );
     41
     42
     43if ( $avatar_url ) : ?>
     44
     45        <div class="bp-member-activity-preview">
     46       
     47                <a href="<?php echo esc_url( $user_url ); ?>">
     48               
     49                        <div class="bp-member-preview-cover">
     50                       
     51                                <?php if ( $user_cover_image != '') :?>
     52                               
     53                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="<?php esc_attr_e( "cover-image" , 'buddypress' );?>"/>
     54                                <?php endif; ?>
     55                               
     56                        </div>
     57                       
     58                </a>
     59               
     60                <div class="bp-member-short-description">
     61               
     62                        <div class="bp-member-avatar-content">
     63                       
     64                                <img src="<?php echo esc_url( $avatar_url );?>" class="profile-photo aligncenter">
     65                               
     66                        </div>
     67                       
     68                        <p class="bp-member-short-description-title">
     69                       
     70                                <a href="<?php echo esc_url( $user_url ); ?>"><?php echo esc_html( $user_displayname );?></a>
     71                               
     72                        </p>
     73                       
     74                        <p class="bp-member-nickname">
     75                       
     76                                <a href="<?php echo esc_url( $user_mentionname_url );?>">@<?php echo esc_html( $user_mentionname ); ?></a>
     77                        </p>
     78                               
     79                        <?php
     80                        echo sprintf(
     81                                        '<div class="bp-profile-button">
     82                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     83                                        </div>',
     84                                        esc_url( $user_url ),
     85                                        $action_button_text
     86                                );
     87                        ?>
     88                       
     89                </div>
     90               
     91        </div>
     92       
     93<?php endif;
     94
  • new file src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content.php src/bp-templates/bp-legacy/buddypress/activity/type-parts/activity-content.php
    new file mode 100644
    index 000000000..9716118ad
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content
     4 *
     5 * This template is used by activity.php and show the activity content
     6 * each activity content.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11
     12bp_activity_content_body();
     13 No newline at end of file
  • src/bp-templates/bp-legacy/css/buddypress-rtl.css

    diff --git src/bp-templates/bp-legacy/css/buddypress-rtl.css src/bp-templates/bp-legacy/css/buddypress-rtl.css
    index d99591d63..f08797e2d 100644
    Hello, this is the BuddyPress Legacy stylesheet. 
    3030        4.1 - Smartphones Landscape
    3131        4.2 - Smartphones Portrait
    3232        4.3 - Smartphones - smaller screen sizes
     335.0 - Activity Types.
    3334--------------------------------------------------------------*/
    3435
    3536/*--------------------------------------------------------------
    body.register #buddypress div.page ul { 
    22812282                margin: 10px 0 20px;
    22822283        }
    22832284}
     2285
     2286/*--------------------------------------------------------------
     22875.0 - Activity Types
     2288--------------------------------------------------------------*/
     2289.bp-member-preview-cover,
     2290.bp-group-preview-cover {
     2291        position: relative;
     2292        min-height: 150px;
     2293        background: #c5c5c5;
     2294}
     2295
     2296.bp-member-preview-cover img,
     2297.bp-group-preview-cover img {
     2298        background: #c5c5c5;
     2299        object-fit: cover;
     2300        border: 0;
     2301        display: block;
     2302        margin: 0;
     2303        padding: 0;
     2304        width: 100%;
     2305        z-index: 1;
     2306        height: 150px;
     2307}
     2308
     2309.bp-member-avatar-content,
     2310.bp-group-avatar-content {
     2311    float: right;
     2312        width: 200px;
     2313        margin-top: -75px;
     2314        position: relative;
     2315        z-index: 2;
     2316}
     2317
     2318.bp-member-avatar-content img.profile-photo,
     2319.bp-group-avatar-content img.group-photo {
     2320        border: solid 2px #fff;
     2321        background: rgba(255, 255, 255, 0.8);
     2322        margin-right: 20px;
     2323}
     2324
     2325.bp-member-short-description-title a,
     2326.bp-group-short-description-title a {
     2327        font-weight: 600;
     2328}
     2329
     2330@media screen and (max-width: 46.8em) {
     2331        .bp-member-short-description,
     2332        .bp-group-short-description {
     2333                text-align: center;
     2334        }
     2335        .bp-member-avatar-content,
     2336        .bp-group-avatar-content {
     2337        float: none;
     2338                width: 100%;
     2339        margin-right: auto;
     2340                margin-left: auto;
     2341                margin-bottom: 15px;
     2342        }
     2343        .bp-member-avatar-content img.profile-photo,
     2344        .bp-group-avatar-content img.group-photo {
     2345                margin: auto;
     2346        }
     2347        .bp-profile-button {
     2348                margin-top: 15px;
     2349        }
     2350}
     2351
     2352@media screen and (min-width: 46.8em) {
     2353        .bp-profile-button {
     2354                text-align: left;
     2355        }
     2356}
  • src/bp-templates/bp-legacy/css/buddypress.css

    diff --git src/bp-templates/bp-legacy/css/buddypress.css src/bp-templates/bp-legacy/css/buddypress.css
    index be7270d71..adaf3146a 100644
    Hello, this is the BuddyPress Legacy stylesheet. 
    3030        4.1 - Smartphones Landscape
    3131        4.2 - Smartphones Portrait
    3232        4.3 - Smartphones - smaller screen sizes
     335.0 - Activity Types.
    3334--------------------------------------------------------------*/
    3435
    3536/*--------------------------------------------------------------
    body.register #buddypress div.page ul { 
    22812282                margin: 10px 0 20px;
    22822283        }
    22832284}
     2285
     2286/*--------------------------------------------------------------
     22875.0 - Activity Types
     2288--------------------------------------------------------------*/
     2289.bp-member-preview-cover,
     2290.bp-group-preview-cover {
     2291        position: relative;
     2292        min-height: 150px;
     2293        background: #c5c5c5;
     2294}
     2295
     2296.bp-member-preview-cover img,
     2297.bp-group-preview-cover img {
     2298        background: #c5c5c5;
     2299        object-fit: cover;
     2300        border: 0;
     2301        display: block;
     2302        margin: 0;
     2303        padding: 0;
     2304        width: 100%;
     2305        z-index: 1;
     2306        height: 150px;
     2307}
     2308
     2309.bp-member-avatar-content,
     2310.bp-group-avatar-content {
     2311    float: left;
     2312        width: 200px;
     2313        margin-top: -75px;
     2314        position: relative;
     2315        z-index: 2;
     2316}
     2317
     2318.bp-member-avatar-content img.profile-photo,
     2319.bp-group-avatar-content img.group-photo {
     2320        border: solid 2px #fff;
     2321        background: rgba(255, 255, 255, 0.8);
     2322        margin-left: 20px;
     2323}
     2324
     2325.bp-member-short-description-title a,
     2326.bp-group-short-description-title a {
     2327        font-weight: 600;
     2328}
     2329
     2330@media screen and (max-width: 46.8em) {
     2331        .bp-member-short-description,
     2332        .bp-group-short-description {
     2333                text-align: center;
     2334        }
     2335        .bp-member-avatar-content,
     2336        .bp-group-avatar-content {
     2337        float: none;
     2338                width: 100%;
     2339        margin-left: auto;
     2340                margin-right: auto;
     2341                margin-bottom: 15px;
     2342        }
     2343        .bp-member-avatar-content img.profile-photo,
     2344        .bp-group-avatar-content img.group-photo {
     2345                margin: auto;
     2346        }
     2347        .bp-profile-button {
     2348                margin-top: 15px;
     2349        }
     2350}
     2351
     2352@media screen and (min-width: 46.8em) {
     2353        .bp-profile-button {
     2354                text-align: right;
     2355        }
     2356}
  • src/bp-templates/bp-legacy/css/embeds-activity-rtl.css

    diff --git src/bp-templates/bp-legacy/css/embeds-activity-rtl.css src/bp-templates/bp-legacy/css/embeds-activity-rtl.css
    index ac6fda0ee..ed6f56efa 100644
    a.play-btn:hover { 
    154154                width: 35px;
    155155        }
    156156}
     157
     158/**
     159*-------------------------------------------------------------------------------
     160* Activity Types
     161*-------------------------------------------------------------------------------
     162*/
     163.bp-member-preview-cover,
     164.bp-group-preview-cover {
     165        position: relative;
     166        min-height: 150px;
     167        background: #c5c5c5;
     168}
     169
     170.bp-member-activity-preview a,
     171.bp-group-activity-preview a {
     172    display: block;
     173    max-width: 100%;
     174}
     175
     176.bp-member-preview-cover img,
     177.bp-group-preview-cover img {
     178        background: #c5c5c5;
     179        object-fit: cover;
     180        border: 0;
     181        display: block;
     182        margin: 0;
     183        padding: 0;
     184        width: 100%;
     185        z-index: 1;
     186        height: 150px;
     187}
     188
     189.bp-member-avatar-content,
     190.bp-group-avatar-content {
     191    float: right;
     192        width: 200px;
     193        margin-top: -75px;
     194        position: relative;
     195        z-index: 2;
     196}
     197
     198.bp-member-avatar-content img.profile-photo,
     199.bp-group-avatar-content img.group-photo {
     200        border: solid 2px #fff;
     201        background: rgba(255, 255, 255, 0.8);
     202        margin-right: 20px;
     203}
     204
     205.bp-member-short-description-title a,
     206.bp-group-short-description-title a {
     207        font-weight: 600;
     208}
     209
     210@media screen and (max-width: 46.8em) {
     211        .bp-member-short-description,
     212        .bp-group-short-description {
     213                text-align: center;
     214        }
     215        .bp-member-avatar-content,
     216        .bp-group-avatar-content {
     217        float: none;
     218                width: 100%;
     219        margin-right: auto;
     220                margin-left: auto;
     221                margin-bottom: 15px;
     222        }
     223        .bp-member-avatar-content img.profile-photo,
     224        .bp-group-avatar-content img.group-photo {
     225                margin: auto;
     226        }
     227        .bp-profile-button {
     228                margin-top: 15px;
     229        }
     230}
     231
     232@media screen and (min-width: 46.8em) {
     233        .bp-profile-button {
     234                text-align: left;
     235        }
     236}
  • src/bp-templates/bp-legacy/css/embeds-activity.css

    diff --git src/bp-templates/bp-legacy/css/embeds-activity.css src/bp-templates/bp-legacy/css/embeds-activity.css
    index 9e0b465d9..ce0aa99c9 100644
    a.play-btn:hover { 
    154154                width: 35px;
    155155        }
    156156}
     157
     158/**
     159*-------------------------------------------------------------------------------
     160* Activity Types
     161*-------------------------------------------------------------------------------
     162*/
     163.bp-member-preview-cover,
     164.bp-group-preview-cover {
     165        position: relative;
     166        min-height: 150px;
     167        background: #c5c5c5;
     168}
     169
     170.bp-member-activity-preview a,
     171.bp-group-activity-preview a {
     172    display: block;
     173    max-width: 100%;
     174}
     175
     176.bp-member-preview-cover img,
     177.bp-group-preview-cover img {
     178        background: #c5c5c5;
     179        object-fit: cover;
     180        border: 0;
     181        display: block;
     182        margin: 0;
     183        padding: 0;
     184        width: 100%;
     185        z-index: 1;
     186        height: 150px;
     187}
     188
     189.bp-member-avatar-content,
     190.bp-group-avatar-content {
     191    float: left;
     192        width: 200px;
     193        margin-top: -75px;
     194        position: relative;
     195        z-index: 2;
     196}
     197
     198.bp-member-avatar-content img.profile-photo,
     199.bp-group-avatar-content img.group-photo {
     200        border: solid 2px #fff;
     201        background: rgba(255, 255, 255, 0.8);
     202        margin-left: 20px;
     203}
     204
     205.bp-member-short-description-title a,
     206.bp-group-short-description-title a {
     207        font-weight: 600;
     208}
     209
     210@media screen and (max-width: 46.8em) {
     211        .bp-member-short-description,
     212        .bp-group-short-description {
     213                text-align: center;
     214        }
     215        .bp-member-avatar-content,
     216        .bp-group-avatar-content {
     217        float: none;
     218                width: 100%;
     219        margin-left: auto;
     220                margin-right: auto;
     221                margin-bottom: 15px;
     222        }
     223        .bp-member-avatar-content img.profile-photo,
     224        .bp-group-avatar-content img.group-photo {
     225                margin: auto;
     226        }
     227        .bp-profile-button {
     228                margin-top: 15px;
     229        }
     230}
     231
     232@media screen and (min-width: 46.8em) {
     233        .bp-profile-button {
     234                text-align: right;
     235        }
     236}
  • src/bp-templates/bp-nouveau/buddypress/activity/entry.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/entry.php src/bp-templates/bp-nouveau/buddypress/activity/entry.php
    index 471944678..188755030 100644
    bp_nouveau_activity_hook( 'before', 'entry' ); ?> 
    3535
    3636                        <div class="activity-inner">
    3737
    38                                 <?php bp_nouveau_activity_content(); ?>
     38                                <?php bp_get_template_part( 'activity/type-parts/activity-content',  bp_get_activity_type() ); ?>
    3939
    4040                        </div>
    4141
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-created_group.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-created_group.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-created_group.php
    new file mode 100644
    index 000000000..143d25c6c
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for created group
     4 *
     5 * This template is used by activity.php and show the created group activity content
     6 * each created group activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13
     14$activity                       = $activities_template->activity;
     15$group                          = groups_get_group( array( 'group_id' => $activity->item_id ) );
     16$group_name             = $group->name;
     17$group_url              = bp_get_group_permalink( $group );
     18$group_cover_image      = bp_get_group_cover_url( $group );             
     19$action_button_text = esc_html__( 'Visit Group', 'buddypress');
     20
     21$group_avatar_url       = bp_core_fetch_avatar(
     22                                                array(
     23                                                        'item_id'    => $group->id,
     24                                                        'avatar_dir' => 'group-avatars',
     25                                                        'object'     => 'group',
     26                                                        'type'       => 'full',
     27                                                        'html'       => false,                                                                 
     28                                                        'width'      => 150,
     29                                                        'height'     => 150,
     30                                                )
     31                                        );
     32
     33if ( $group_avatar_url ) : ?>
     34        <div class="bp-group-activity-preview">
     35       
     36                <a href="<?php echo esc_url( $group_url ); ?>">
     37               
     38                        <div class="bp-group-preview-cover">
     39                       
     40                        <?php if ( $group_cover_image != '') : ?>
     41                       
     42                                <img src="<?php echo esc_url( $group_cover_image ) ;?>" alt="cover-image"/>
     43                               
     44                        <?php endif; ?>
     45                       
     46                        </div>
     47                       
     48                </a>
     49               
     50                <div class="bp-group-short-description">
     51                       
     52                        <div class="bp-group-avatar-content">
     53                       
     54                                <img src="<?php echo esc_url( $group_avatar_url ); ?>" class="group-photo aligncenter" width="150" height="150">
     55                               
     56                        </div>
     57                       
     58                        <p class="bp-group-short-description-title">
     59                       
     60                                <a href="<?php echo esc_url( $group_url ); ?>"><?php echo esc_html( $group_name );?></a>
     61                               
     62                        </p>
     63       
     64                        <?php
     65                        echo sprintf(
     66                                '<div class="bp-profile-button">
     67                                        <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     68                                </div>',
     69                                esc_url( $group_url ),
     70                                $action_button_text
     71                        ); ?>
     72                       
     73                </div>
     74               
     75        </div>
     76       
     77<?php endif;
     78 No newline at end of file
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-friendship_created.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-friendship_created.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-friendship_created.php
    new file mode 100644
    index 000000000..96d7119e0
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for friendship created
     4 *
     5 * This template is used by activity.php and show the friendship created activity content
     6 * each friendship created activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13$activity                       = $activities_template->activity;
     14
     15$friend_url             = bp_core_get_user_domain( $activity->user_id );
     16$friend_displayname = bp_core_get_user_displayname( $activity->user_id );
     17$friend_mentionname = bp_activity_get_user_mentionname( $activity->user_id );           
     18
     19$friend_avatar_url = bp_core_fetch_avatar(
     20                                                        array(
     21                                                                'item_id' => $activity->user_id,
     22                                                                'type'    => 'full',
     23                                                                'width'   => 150,
     24                                                                'height'  => 150,
     25                                                                'class'   => 'avatar',
     26                                                                'id'      => false,
     27                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $friend_displayname ) ),
     28                                                                'html'    => false
     29                                                        )
     30                                                );
     31
     32
     33$user_url               = bp_core_get_user_domain( $activity->secondary_item_id );
     34$user_displayname       = bp_core_get_user_displayname( $activity->secondary_item_id );
     35$user_mentionname       = bp_activity_get_user_mentionname( $activity->secondary_item_id );             
     36
     37
     38$user_cover_image       = bp_attachments_get_attachment(
     39                                                        'url',
     40                                                        array(
     41                                                                'object_dir' => 'members',
     42                                                                'item_id'    => $activity->secondary_item_id,
     43                                                        )
     44                                                );
     45
     46$avatar_url             = bp_core_fetch_avatar(
     47                                                        array(
     48                                                                'item_id' => $activity->secondary_item_id,
     49                                                                'type'    => 'full',
     50                                                                'width'   => 150,
     51                                                                'height'  => 150,
     52                                                                'class'   => 'avatar',
     53                                                                'id'      => false,
     54                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     55                                                                'html'    => false
     56                                                        )
     57                                                );
     58
     59
     60if ( $avatar_url ) : ?>
     61
     62        <div class="bp-member-activity-preview">
     63       
     64                <a href="<?php echo esc_url( $user_url ); ?>">
     65               
     66                        <div class="bp-member-preview-cover">
     67                       
     68                                <?php if ( $user_cover_image != '') :?>
     69                               
     70                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="<?php esc_attr_e( "cover-image" , 'buddypress' );?>"/>
     71                                <?php endif; ?>
     72                               
     73                        </div>
     74                       
     75                </a>
     76               
     77                <div class="bp-member-short-description">
     78               
     79                        <div class="bp-members-avatar-wrapper">
     80               
     81                                <div class="bp-members-avatar-content-inner">
     82                               
     83                                        <div class="bp-member-avatar-content">
     84                                       
     85                                                <img src="<?php echo esc_url( $friend_avatar_url );?>" class="profile-photo aligncenter">
     86                                               
     87                                        </div>
     88                                       
     89                                        <p class="bp-member-short-description-title">
     90                                       
     91                                                <a href="<?php echo esc_url( $friend_url ); ?>"><?php echo esc_html( $friend_displayname );?></a>
     92                                               
     93                                        </p>
     94                                       
     95                                </div>
     96                               
     97                                <div class="bp-members-avatar-content-inner">
     98                               
     99                                        <div class="bp-member-avatar-content">
     100                                       
     101                                                <img src="<?php echo esc_url( $avatar_url );?>" class="profile-photo aligncenter">
     102                                               
     103                                        </div>
     104                                       
     105                                        <p class="bp-member-short-description-title">
     106                                       
     107                                                <a href="<?php echo esc_url( $user_url ); ?>"><?php echo esc_html( $user_displayname );?></a>
     108                                               
     109                                        </p>
     110                                       
     111                                </div>
     112                               
     113                        </div>
     114                       
     115                </div>
     116               
     117        </div>
     118       
     119<?php endif;
     120
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-joined_group.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-joined_group.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-joined_group.php
    new file mode 100644
    index 000000000..049f879ad
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for joined group
     4 *
     5 * This template is used by activity.php and show the joined group activity content
     6 * each joined group activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13
     14$activity                       = $activities_template->activity;
     15$group                          = groups_get_group( array( 'group_id' => $activity->item_id ) );
     16$group_name             = $group->name;
     17$group_url              = bp_get_group_permalink( $group );
     18$group_cover_image      = bp_get_group_cover_url( $group );             
     19$action_button_text = esc_html__( 'Visit Group', 'buddypress');
     20
     21$group_avatar_url       = bp_core_fetch_avatar(
     22                                                array(
     23                                                        'item_id'    => $group->id,
     24                                                        'avatar_dir' => 'group-avatars',
     25                                                        'object'     => 'group',
     26                                                        'type'       => 'full',
     27                                                        'html'       => false,                                                                 
     28                                                        'width'      => 150,
     29                                                        'height'     => 150,
     30                                                )
     31                                        );
     32
     33if ( $group_avatar_url ) : ?>
     34        <div class="bp-group-activity-preview">
     35       
     36                <a href="<?php echo esc_url( $group_url ); ?>">
     37               
     38                        <div class="bp-group-preview-cover">
     39                       
     40                        <?php if ( $group_cover_image != '') : ?>
     41                       
     42                                <img src="<?php echo esc_url( $group_cover_image ) ;?>" alt="cover-image"/>
     43                               
     44                        <?php endif; ?>
     45                       
     46                        </div>
     47                       
     48                </a>
     49               
     50                <div class="bp-group-short-description">
     51                       
     52                        <div class="bp-group-avatar-content">
     53                       
     54                                <img src="<?php echo esc_url( $group_avatar_url ); ?>" class="group-photo aligncenter" width="150" height="150">
     55                               
     56                        </div>
     57                       
     58                        <p class="bp-group-short-description-title">
     59                       
     60                                <a href="<?php esc_url( $group_url ); ?>"><?php echo esc_html( $group_name );?></a>
     61                               
     62                        </p>
     63       
     64                        <?php
     65                        echo sprintf(
     66                                '<div class="bp-profile-button">
     67                                        <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     68                                </div>',
     69                                esc_url( $group_url ),
     70                                $action_button_text
     71                        ); ?>
     72                       
     73                </div>
     74               
     75        </div>
     76       
     77<?php endif;
     78 No newline at end of file
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-new_avatar.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-new_avatar.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-new_avatar.php
    new file mode 100644
    index 000000000..03e4618b8
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for new avatar
     4 *
     5 * This template is used by activity.php and show the new avatar activity content
     6 * each new avatar activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13
     14$historical_avatar      = '';
     15$activity                       = $activities_template->activity;
     16$user_url               = bp_core_get_user_domain( $activity->user_id );
     17$user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     18$user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     19$action_button_text = esc_html__( 'View Profile', 'buddypress');
     20$user_cover_image       = bp_attachments_get_attachment(
     21                                                        'url',
     22                                                        array(
     23                                                                'object_dir' => 'members',
     24                                                                'item_id'    => $activity->user_id,
     25                                                        )
     26                                                );
     27$args   = array( 'r' => $user_mentionname );
     28$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     29$user_mentionname_url = wp_nonce_url( $url );
     30
     31if ( isset( $activity->historical_avatar ) && $activity->historical_avatar ) {
     32        $historical_avatar = str_replace('\history','/history',$activity->historical_avatar);
     33} else {
     34        $avatars = bp_avatar_get_version_src( $activity->user_id, $activity->date_recorded );
     35
     36        if ( $avatars && 1 === count( $avatars ) ) {
     37                $avatar            = reset( $avatars );
     38                $historical_avatar = trailingslashit( $avatar->parent_dir_url ) . $avatar->name;
     39        }
     40}
     41
     42if ( $historical_avatar ) : ?>
     43
     44        <div class="bp-member-activity-preview">
     45       
     46                <a href="<?php echo esc_url( $user_url ); ?>">
     47               
     48                        <div class="bp-member-preview-cover">
     49                       
     50                                <?php if ( $user_cover_image != '') : ?>
     51                               
     52                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="cover-image"/>
     53                                       
     54                                <?php endif; ?>
     55                               
     56                        </div>
     57                       
     58                </a>
     59               
     60                <div class="bp-member-short-description">
     61               
     62                        <div class="bp-member-avatar-content">
     63                               
     64                                <img src="<?php echo esc_url( $historical_avatar ); ?>" class="profile-photo aligncenter">
     65                               
     66                        </div>
     67                       
     68                        <p class="bp-member-short-description-title">
     69                       
     70                                <a href="<?php echo esc_url( $user_url );?>"><?php echo esc_html( $user_displayname ); ?> </a>
     71                                       
     72                        </p>
     73                               
     74                        <p class="bp-member-nickname">
     75                               
     76                                <a href="<?php echo esc_url( $user_mentionname_url ); ?>">@<?php echo esc_html( $user_mentionname ); ?></a>
     77                               
     78                        </p>
     79                               
     80                        <?php
     81                       
     82                        echo sprintf(
     83                                                '<div class="bp-profile-button">
     84                                                        <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     85                                                </div>',
     86                                                esc_url( $user_url ),
     87                                                $action_button_text
     88                                        );
     89                        ?>
     90                       
     91                </div>
     92               
     93        </div>
     94       
     95<?php endif;
     96 No newline at end of file
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-new_member.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-new_member.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-new_member.php
    new file mode 100644
    index 000000000..2476f520b
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for friendship created
     4 *
     5 * This template is used by activity.php and show the friendship created activity content
     6 * each friendship created activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13$activity                       = $activities_template->activity;
     14$user_url               = bp_core_get_user_domain( $activity->user_id );
     15$user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     16$user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     17$action_button_text = esc_html__( 'View Profile', 'buddypress');
     18$user_cover_image       = bp_attachments_get_attachment(
     19                                                        'url',
     20                                                        array(
     21                                                                'object_dir' => 'members',
     22                                                                'item_id'    => $activity->user_id,
     23                                                        )
     24                                                );
     25$args   = array( 'r' => $user_mentionname );
     26$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     27$user_mentionname_url = wp_nonce_url( $url );
     28
     29$avatar_url = bp_core_fetch_avatar(
     30                                                        array(
     31                                                                'item_id' => $activity->user_id,
     32                                                                'type'    => 'full',
     33                                                                'width'   => 150,
     34                                                                'height'  => 150,
     35                                                                'class'   => 'avatar',
     36                                                                'id'      => false,
     37                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     38                                                                'html'    => false
     39                                                        )
     40                                                );
     41
     42
     43if ( $avatar_url ) : ?>
     44
     45        <div class="bp-member-activity-preview">
     46       
     47                <a href="<?php echo esc_url( $user_url ); ?>">
     48               
     49                        <div class="bp-member-preview-cover">
     50                       
     51                                <?php if ( $user_cover_image != '') :?>
     52                               
     53                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="<?php esc_attr_e( "cover-image" , 'buddypress' );?>"/>
     54                                <?php endif; ?>
     55                               
     56                        </div>
     57                       
     58                </a>
     59               
     60                <div class="bp-member-short-description">
     61               
     62                        <div class="bp-member-avatar-content">
     63                       
     64                                <img src="<?php echo esc_url( $avatar_url );?>" class="profile-photo aligncenter">
     65                               
     66                        </div>
     67                       
     68                        <p class="bp-member-short-description-title">
     69                       
     70                                <a href="<?php echo esc_url( $user_url ); ?>"><?php echo esc_html( $user_displayname );?></a>
     71                               
     72                        </p>
     73                       
     74                        <p class="bp-member-nickname">
     75                       
     76                                <a href="<?php echo esc_url( $user_mentionname_url );?>">@<?php echo esc_html( $user_mentionname ); ?></a>
     77                        </p>
     78                               
     79                        <?php
     80                        echo sprintf(
     81                                        '<div class="bp-profile-button">
     82                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     83                                        </div>',
     84                                        esc_url( $user_url ),
     85                                        $action_button_text
     86                                );
     87                        ?>
     88                       
     89                </div>
     90               
     91        </div>
     92       
     93<?php endif;
     94
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-updated_profile.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-updated_profile.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content-updated_profile.php
    new file mode 100644
    index 000000000..c3040f1d3
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content for friendship created
     4 *
     5 * This template is used by activity.php and show the friendship created activity content
     6 * each friendship created activity.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11 
     12global $activities_template;
     13$activity                       = $activities_template->activity;
     14$user_url               = bp_core_get_user_domain( $activity->user_id );
     15$user_displayname       = bp_core_get_user_displayname( $activity->user_id );
     16$user_mentionname       = bp_activity_get_user_mentionname( $activity->user_id );               
     17$action_button_text = esc_html__( 'View Profile', 'buddypress');
     18$user_cover_image       = bp_attachments_get_attachment(
     19                                                        'url',
     20                                                        array(
     21                                                                'object_dir' => 'members',
     22                                                                'item_id'    => $activity->user_id,
     23                                                        )
     24                                                );
     25$args   = array( 'r' => $user_mentionname );
     26$url    = add_query_arg( $args, bp_get_activity_directory_permalink() );
     27$user_mentionname_url = wp_nonce_url( $url );
     28
     29$avatar_url = bp_core_fetch_avatar(
     30                                                        array(
     31                                                                'item_id' => $activity->user_id,
     32                                                                'type'    => 'full',
     33                                                                'width'   => 150,
     34                                                                'height'  => 150,
     35                                                                'class'   => 'avatar',
     36                                                                'id'      => false,
     37                                                                'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), esc_html( $user_displayname ) ),
     38                                                                'html'    => false
     39                                                        )
     40                                                );
     41
     42
     43if ( $avatar_url ) : ?>
     44
     45        <div class="bp-member-activity-preview">
     46       
     47                <a href="<?php echo esc_url( $user_url ); ?>">
     48               
     49                        <div class="bp-member-preview-cover">
     50                       
     51                                <?php if ( $user_cover_image != '') :?>
     52                               
     53                                        <img src="<?php echo esc_url( $user_cover_image ); ?>" alt="<?php esc_attr_e( "cover-image" , 'buddypress' );?>"/>
     54                                <?php endif; ?>
     55                               
     56                        </div>
     57                       
     58                </a>
     59               
     60                <div class="bp-member-short-description">
     61               
     62                        <div class="bp-member-avatar-content">
     63                       
     64                                <img src="<?php echo esc_url( $avatar_url );?>" class="profile-photo aligncenter">
     65                               
     66                        </div>
     67                       
     68                        <p class="bp-member-short-description-title">
     69                       
     70                                <a href="<?php esc_url( $user_url ); ?>"><?php echo esc_html( $user_displayname );?></a>
     71                               
     72                        </p>
     73                       
     74                        <p class="bp-member-nickname">
     75                       
     76                                <a href="<?php echo esc_url( $user_mentionname_url );?>">@<?php echo esc_html( $user_mentionname ); ?></a>
     77                        </p>
     78                               
     79                        <?php
     80                        echo sprintf(
     81                                        '<div class="bp-profile-button">
     82                                                <a href="%1$s" class="button large primary button-primary" role="button">%2$s</a>
     83                                        </div>',
     84                                        esc_url( $user_url ),
     85                                        $action_button_text
     86                                );
     87                        ?>
     88                       
     89                </div>
     90               
     91        </div>
     92       
     93<?php endif;
     94
  • new file src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content.php src/bp-templates/bp-nouveau/buddypress/activity/type-parts/activity-content.php
    new file mode 100644
    index 000000000..a44309fa4
    - +  
     1<?php
     2/**
     3 * BuddyPress - Activity content
     4 *
     5 * This template is used by activity.php and show the activity content
     6 * each activity content.
     7 *
     8 * @since 3.0.0
     9 * @version 10.0.0
     10 */
     11
     12bp_nouveau_activity_content();
     13 No newline at end of file
  • src/bp-templates/bp-nouveau/common-styles/_bp_activity_entries.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp_activity_entries.scss src/bp-templates/bp-nouveau/common-styles/_bp_activity_entries.scss
    index edd598f92..39e500d75 100644
    body.activity-permalink { 
    436436
    437437        }
    438438}
     439
     440// Activity Types Entry View
     441.bp-member-preview-cover,
     442.bp-group-preview-cover {
     443        position: relative;
     444        min-height: 150px;
     445        background: #c5c5c5;
     446       
     447        img {
     448                background: #c5c5c5;
     449                object-fit: cover;
     450                border: 0;
     451                display: block;
     452                margin: 0;
     453                padding: 0;
     454                width: 100%;
     455                z-index: 1;
     456                height: 150px;
     457        }
     458}
     459
     460.bp-member-short-description,
     461.bp-group-short-description {
     462    position: relative;
     463    text-align: center;
     464}
     465
     466.bp-members-avatar-wrapper {
     467    display: flex;
     468    justify-content: center;
     469    padding: 0 15px;
     470}
     471
     472.bp-members-avatar-content-inner {
     473    margin: 0 5px;
     474}
     475
     476.bp-member-avatar-content,
     477.bp-group-avatar-content {
     478        width: 200px;
     479    margin: auto;
     480    margin-top: -75px;
     481    margin-bottom: 15px;
     482    position: relative;
     483    z-index: 2;
     484       
     485        img.profile-photo,
     486        img.group-photo {
     487                width: 100%;
     488                max-width: 150px;
     489                background: rgba(255, 255, 255, 0.8);
     490                border: 5px solid #fff;
     491                border-radius: 100px;
     492        }
     493}
     494
     495.bp-member-short-description-title a,
     496.bp-group-short-description-title a {
     497        font-weight: 600;
     498}
     499
     500@include medium-max() {
     501       
     502        .bp-member-avatar-content,
     503        .bp-group-avatar-content {
     504                width: 100%;
     505                margin-bottom: 15px;
     506               
     507                img.profile-photo,
     508                img.group-photo {
     509                        margin: auto;
     510                }
     511        }
     512       
     513        .bp-profile-button {
     514                margin-top: 15px;
     515                position: relative;
     516        }
     517       
     518} // close @media
     519
     520@include medium-up {
     521
     522        .bp-profile-button {
     523                position: absolute;
     524                top: 100px;
     525                right: 0;
     526        }
     527       
     528} // close @media
  • src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css
    index e67c2b8f0..f7eaf7f37 100644
    body #buddypress select, 
    6969body #buddypress input[type="search"],
    7070body #buddypress input[type="submit"],
    7171body #buddypress input[type="reset"] {
     72        -webkit-border-radius: 2px;
     73        -moz-border-radius: 2px;
     74        -ms-border-radius: 2px;
    7275        border-radius: 2px;
    7376        background-clip: padding-box;
    7477}
    body #buddypress .bp-lists blockquote { 
    7982}
    8083
    8184body #buddypress .bp-list .action {
     85        -webkit-box-sizing: border-box;
     86        -moz-box-sizing: border-box;
    8287        box-sizing: border-box;
    8388}
    8489
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    375380        .buddypress-wrap.bp-dir-hori-nav:not(.bp-vertical-navs) nav:not(.tabbed-links) {
    376381                border-bottom: 1px solid #eee;
    377382                border-top: 1px solid #eee;
     383                -webkit-box-shadow: 0 2px 12px 0 #fafafa;
     384                -moz-box-shadow: 0 2px 12px 0 #fafafa;
    378385                box-shadow: 0 2px 12px 0 #fafafa;
    379386        }
    380387}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    868875}
    869876
    870877.bp-list {
     878        -webkit-box-sizing: border-box;
     879        -moz-box-sizing: border-box;
    871880        box-sizing: border-box;
    872881        border-top: 1px solid #eaeaea;
    873882        clear: both;
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    10181027.activity-list.bp-list .activity-item {
    10191028        background: #fff;
    10201029        border: 1px solid #b7b7b7;
     1030        -webkit-box-shadow: 0 0 6px #d2d2d2;
     1031        -moz-box-shadow: 0 0 6px #d2d2d2;
    10211032        box-shadow: 0 0 6px #d2d2d2;
    10221033        margin: 20px 0;
    10231034}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    10381049@media screen and (min-width: 46.8em) {
    10391050        .friends-request-list li,
    10401051        .membership-requests-list li {
     1052                display: -webkit-flex;
    10411053                display: -moz-flex;
    10421054                display: -ms-flex;
    10431055                display: -o-flex;
    10441056                display: flex;
     1057                -webkit-flex-flow: row nowrap;
     1058                -moz-flex-flow: row nowrap;
     1059                -ms-flex-flow: row nowrap;
    10451060                -o-flex-flow: row nowrap;
    10461061                flex-flow: row nowrap;
    10471062        }
    10481063        .friends-request-list li .item,
    10491064        .membership-requests-list li .item {
     1065                -webkit-flex: 1 1 auto;
    10501066                -moz-flex: 1 1 auto;
     1067                -ms-flex: 1 1 auto;
    10511068                -o-flex: 1 1 auto;
    10521069                flex: 1 1 auto;
    10531070        }
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11031120
    11041121.activity-update-form {
    11051122        border: 1px solid #ccc;
     1123        -webkit-box-shadow: inset 0 0 6px #eee;
     1124        -moz-box-shadow: inset 0 0 6px #eee;
    11061125        box-shadow: inset 0 0 6px #eee;
    11071126        margin: 15px 0;
    11081127}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11251144
    11261145.activity-update-form #whats-new-textarea textarea {
    11271146        background: #fff;
     1147        -webkit-box-sizing: border-box;
     1148        -moz-box-sizing: border-box;
    11281149        box-sizing: border-box;
    11291150        color: #333;
    11301151        font-family: inherit;
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11361157}
    11371158
    11381159.activity-update-form #whats-new-textarea textarea:focus {
     1160        -webkit-box-shadow: 0 0 6px 0 #d6d6d6;
     1161        -moz-box-shadow: 0 0 6px 0 #d6d6d6;
    11391162        box-shadow: 0 0 6px 0 #d6d6d6;
    11401163}
    11411164
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11641187}
    11651188
    11661189.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object {
     1190        display: -webkit-box;
     1191        display: -ms-flexbox;
     1192        display: -webkit-flex;
    11671193        display: flex;
     1194        -ms-flex-align: center;
     1195        -webkit-align-items: center;
     1196        -webkit-box-align: center;
    11681197        align-items: center;
    11691198        padding: 0.2em;
    11701199}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    15121541.buddypress-wrap .activity-list .load-newest:focus,
    15131542.buddypress-wrap .activity-list .load-newest:hover {
    15141543        border-color: #e1e1e1;
     1544        -webkit-box-shadow: 0 0 6px 0 #eaeaea;
     1545        -moz-box-shadow: 0 0 6px 0 #eaeaea;
    15151546        box-shadow: 0 0 6px 0 #eaeaea;
    15161547}
    15171548
    body.activity-permalink .activity-list .activity-comments { 
    15771608                top: -20px;
    15781609        }
    15791610        body.activity-permalink .activity-list .activity-avatar img {
     1611                -webkit-box-shadow: 0 0 0 8px #fff;
    15801612                box-shadow: 0 0 0 8px #fff;
    15811613        }
    15821614        body.activity-permalink .activity-list .activity-content {
    body.activity-permalink .activity-list .activity-comments { 
    15871619        }
    15881620}
    15891621
     1622.bp-member-preview-cover,
     1623.bp-group-preview-cover {
     1624        position: relative;
     1625        min-height: 150px;
     1626        background: #c5c5c5;
     1627}
     1628
     1629.bp-member-preview-cover img,
     1630.bp-group-preview-cover img {
     1631        background: #c5c5c5;
     1632        object-fit: cover;
     1633        border: 0;
     1634        display: block;
     1635        margin: 0;
     1636        padding: 0;
     1637        width: 100%;
     1638        z-index: 1;
     1639        height: 150px;
     1640}
     1641
     1642.bp-member-short-description,
     1643.bp-group-short-description {
     1644        position: relative;
     1645        text-align: center;
     1646}
     1647
     1648.bp-members-avatar-wrapper {
     1649        display: flex;
     1650        justify-content: center;
     1651        padding: 0 15px;
     1652}
     1653
     1654.bp-members-avatar-content-inner {
     1655        margin: 0 5px;
     1656}
     1657
     1658.bp-member-avatar-content,
     1659.bp-group-avatar-content {
     1660        width: 200px;
     1661        margin: auto;
     1662        margin-top: -75px;
     1663        margin-bottom: 15px;
     1664        position: relative;
     1665        z-index: 2;
     1666}
     1667
     1668.bp-member-avatar-content img.profile-photo,
     1669.bp-member-avatar-content img.group-photo,
     1670.bp-group-avatar-content img.profile-photo,
     1671.bp-group-avatar-content img.group-photo {
     1672        width: 100%;
     1673        max-width: 150px;
     1674        background: rgba(255, 255, 255, 0.8);
     1675        border: 5px solid #fff;
     1676        border-radius: 100px;
     1677}
     1678
     1679.bp-member-short-description-title a,
     1680.bp-group-short-description-title a {
     1681        font-weight: 600;
     1682}
     1683
     1684@media screen and (max-width: 46.8em) {
     1685        .bp-member-avatar-content,
     1686        .bp-group-avatar-content {
     1687                width: 100%;
     1688                margin-bottom: 15px;
     1689        }
     1690        .bp-member-avatar-content img.profile-photo,
     1691        .bp-member-avatar-content img.group-photo,
     1692        .bp-group-avatar-content img.profile-photo,
     1693        .bp-group-avatar-content img.group-photo {
     1694                margin: auto;
     1695        }
     1696        .bp-profile-button {
     1697                margin-top: 15px;
     1698                position: relative;
     1699        }
     1700}
     1701
     1702@media screen and (min-width: 46.8em) {
     1703        .bp-profile-button {
     1704                position: absolute;
     1705                top: 100px;
     1706                left: 0;
     1707        }
     1708}
     1709
    15901710/**
    15911711*-----------------------------------------------------
    15921712* @section 3.1.3 - Activity Comments
    form.ac-form .ac-reply-content .ac-textarea textarea { 
    17571877}
    17581878
    17591879form.ac-form .ac-reply-content .ac-textarea textarea:focus {
     1880        -webkit-box-shadow: 0 0 6px #d6d6d6;
     1881        -moz-box-shadow: 0 0 6px #d6d6d6;
    17601882        box-shadow: 0 0 6px #d6d6d6;
    17611883}
    17621884
    form.ac-form .ac-reply-content input { 
    18201942
    18211943.buddypress-wrap .groups-list li .group-desc {
    18221944        border: 1px solid #eaeaea;
     1945        -webkit-border-radius: 10px;
     1946        -moz-border-radius: 10px;
     1947        -ms-border-radius: 10px;
    18231948        border-radius: 10px;
    18241949        background-clip: padding-box;
    18251950        font-size: 13px;
    form.ac-form .ac-reply-content input { 
    18952020
    18962021.buddypress-wrap .members-list li .user-update {
    18972022        border: 1px solid #eaeaea;
     2023        -webkit-border-radius: 10px;
     2024        -moz-border-radius: 10px;
     2025        -ms-border-radius: 10px;
    18982026        border-radius: 10px;
    18992027        background-clip: padding-box;
    19002028        color: #737373;
    form.ac-form .ac-reply-content input { 
    19442072*-------------------------------------------------------------------------------
    19452073*/
    19462074.register-page .register-section {
     2075        -webkit-box-sizing: border-box;
     2076        -moz-box-sizing: border-box;
    19472077        box-sizing: border-box;
    19482078}
    19492079
    body.no-js .single-item-header .js-self-profile-button { 
    23532483}
    23542484
    23552485.groups-header .moderators-lists img.avatar {
     2486        -moz-box-shadow: none;
     2487        -webkit-box-shadow: none;
    23562488        box-shadow: none;
    23572489        float: none;
    23582490        height: 30px;
    body.no-js .single-item-header .js-self-profile-button { 
    23902522
    23912523.groups-header .desc-wrap .group-description {
    23922524        background: #fafafa;
     2525        -webkit-box-shadow: inset 0 0 9px #ccc;
     2526        -moz-box-shadow: inset 0 0 9px #ccc;
    23932527        box-shadow: inset 0 0 9px #ccc;
    23942528        padding: 1em;
    23952529        text-align: right;
    body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * { 
    26682802}
    26692803
    26702804.buddypress .bp-invites-content ul.item-list li.selected {
     2805        -webkit-box-shadow: inset 0 0 12px 0 rgba(237, 187, 52, 0.2);
     2806        -moz-box-shadow: inset 0 0 12px 0 rgba(237, 187, 52, 0.2);
    26712807        box-shadow: inset 0 0 12px 0 rgba(237, 187, 52, 0.2);
    26722808}
    26732809
    body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * { 
    27392875
    27402876@media screen and (min-width: 46.8em) {
    27412877        .buddypress .bp-invites-content ul.item-list > li {
     2878                -webkit-box-sizing: border-box;
     2879                -moz-box-sizing: border-box;
    27422880                box-sizing: border-box;
    27432881                border: 1px solid #eaeaea;
    27442882                float: right;
    body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * { 
    27602898
    27612899@media screen and (min-width: 46.8em) {
    27622900        :not(.vertical) + .item-body #group-invites-container {
     2901                display: -ms-grid;
    27632902                display: grid;
     2903                -ms-grid-columns: 25% auto;
    27642904                grid-template-columns: 25% auto;
    27652905                grid-template-areas: "group-invites-nav group-invites-column";
    27662906        }
    body.register .buddypress-wrap .page ul { 
    30193159}
    30203160
    30213161.bp-messages-content .avatar {
     3162        -moz-box-shadow: none;
     3163        -webkit-box-shadow: none;
    30223164        box-shadow: none;
    30233165}
    30243166
    body.register .buddypress-wrap .page ul { 
    30493191
    30503192#message-threads li {
    30513193        border-bottom: 1px solid #eaeaea;
     3194        display: -webkit-flex;
    30523195        display: -moz-flex;
    30533196        display: -ms-flex;
    30543197        display: -o-flex;
    30553198        display: flex;
     3199        -webkit-flex-flow: row nowrap;
     3200        -moz-flex-flow: row nowrap;
     3201        -ms-flex-flow: row nowrap;
    30563202        -o-flex-flow: row nowrap;
    30573203        flex-flow: row nowrap;
    30583204        margin: 0;
    body.register .buddypress-wrap .page ul { 
    30613207}
    30623208
    30633209#message-threads li .thread-cb {
     3210        display: -webkit-box;
     3211        display: -ms-flexbox;
     3212        display: -webkit-flex;
    30643213        display: flex;
     3214        -ms-flex-align: center;
     3215        -webkit-align-items: center;
     3216        -webkit-box-align: center;
    30653217        align-items: center;
     3218        -webkit-flex: 1 2 5%;
    30663219        -moz-flex: 1 2 5%;
     3220        -ms-flex: 1 2 5%;
    30673221        -o-flex: 1 2 5%;
    30683222        flex: 1 2 5%;
    30693223}
    30703224
    30713225#message-threads li .thread-from,
    30723226#message-threads li .thread-to {
     3227        -webkit-flex: 1 2 20%;
    30733228        -moz-flex: 1 2 20%;
     3229        -ms-flex: 1 2 20%;
    30743230        -o-flex: 1 2 20%;
    30753231        flex: 1 2 20%;
    30763232}
    body.register .buddypress-wrap .page ul { 
    30963252}
    30973253
    30983254#message-threads li .thread-content {
     3255        -webkit-flex: 1 2 60%;
    30993256        -moz-flex: 1 2 60%;
     3257        -ms-flex: 1 2 60%;
    31003258        -o-flex: 1 2 60%;
    31013259        flex: 1 2 60%;
    31023260}
    31033261
    31043262#message-threads li .thread-date {
     3263        -webkit-flex: 1 2 15%;
    31053264        -moz-flex: 1 2 15%;
     3265        -ms-flex: 1 2 15%;
    31063266        -o-flex: 1 2 15%;
    31073267        flex: 1 2 15%;
    31083268}
    body.register .buddypress-wrap .page ul { 
    32043364
    32053365.bp-messages-content #bp-message-thread-list .message-metadata {
    32063366        border-bottom: 1px solid #ccc;
     3367        -webkit-box-shadow: 2px 1px 9px 0 #eee;
     3368        -moz-box-shadow: 2px 1px 9px 0 #eee;
    32073369        box-shadow: 2px 1px 9px 0 #eee;
    32083370        display: table;
    32093371        padding: 0.2em;
    body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { 
    34473609.buddypress-wrap input[type="url"]:focus,
    34483610.buddypress-wrap input[type="tel"]:focus,
    34493611.buddypress-wrap input[type="password"]:focus {
     3612        -webkit-box-shadow: 0 0 8px #eaeaea;
     3613        -moz-box-shadow: 0 0 8px #eaeaea;
    34503614        box-shadow: 0 0 8px #eaeaea;
    34513615}
    34523616
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    36863850}
    36873851
    36883852.buddypress-wrap .select-wrap select {
     3853        -moz-appearance: none;
    36893854        -webkit-appearance: none;
    36903855        -o-appearance: none;
    36913856        appearance: none;
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    37803945.buddypress-wrap form#group-members-search button[type="submit"] {
    37813946        background: none;
    37823947        border: 0;
     3948        -webkit-border-radius: 0;
     3949        -moz-border-radius: 0;
     3950        -ms-border-radius: 0;
    37833951        border-radius: 0;
    37843952        background-clip: padding-box;
    37853953}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    40564224}
    40574225
    40584226.center-vert {
     4227        display: -ms-flexbox;
     4228        display: -webkit-flex;
    40594229        display: flex;
     4230        -ms-flex-align: center;
     4231        -webkit-align-items: center;
     4232        -webkit-box-align: center;
    40604233        align-items: center;
    40614234}
    40624235
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    41704343.buddypress .buddypress-wrap input.text-button {
    41714344        background: none;
    41724345        border: 0;
     4346        -moz-box-shadow: none;
     4347        -webkit-box-shadow: none;
    41734348        box-shadow: none;
    41744349        color: #767676;
    41754350}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    42654440
    42664441.buddypress #buddypress .create-button a {
    42674442        border: 1px solid #ccc;
     4443        -webkit-border-radius: 5px;
     4444        -moz-border-radius: 5px;
     4445        -ms-border-radius: 5px;
    42684446        border-radius: 5px;
    42694447        background-clip: padding-box;
     4448        -webkit-box-shadow: inset 0 0 6px 0 #eaeaea;
     4449        -moz-box-shadow: inset 0 0 6px 0 #eaeaea;
    42704450        box-shadow: inset 0 0 6px 0 #eaeaea;
    42714451        margin: 0.2em 0;
    42724452        width: auto;
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    42754455.buddypress #buddypress .create-button a:focus, .buddypress #buddypress .create-button a:hover {
    42764456        background: none;
    42774457        border-color: #ccc;
     4458        -webkit-box-shadow: inset 0 0 12px 0 #eaeaea;
     4459        -moz-box-shadow: inset 0 0 12px 0 #eaeaea;
    42784460        box-shadow: inset 0 0 12px 0 #eaeaea;
    42794461}
    42804462
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    42964478.buddypress #buddypress.bp-dir-hori-nav .create-button a:hover {
    42974479        background: none;
    42984480        border: 0;
     4481        -moz-box-shadow: none;
     4482        -webkit-box-shadow: none;
    42994483        box-shadow: none;
    43004484        margin: 0;
    43014485}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    43964580.buddypress-wrap #group-create-body .bp-cover-image-status p.warning {
    43974581        background: #0b80a4;
    43984582        border: 0;
     4583        -webkit-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.2);
     4584        -moz-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.2);
    43994585        box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.2);
    44004586        color: #fff;
    44014587}
    44024588
    44034589.buddypress-wrap .bp-feedback:not(.custom-homepage-info) {
     4590        display: -webkit-flex;
    44044591        display: -moz-flex;
    44054592        display: -ms-flex;
    44064593        display: -o-flex;
    44074594        display: flex;
     4595        -webkit-flex-flow: row nowrap;
     4596        -moz-flex-flow: row nowrap;
     4597        -ms-flex-flow: row nowrap;
    44084598        -o-flex-flow: row nowrap;
    44094599        flex-flow: row nowrap;
     4600        -ms-flex-align: stretch;
     4601        -webkit-align-items: stretch;
     4602        -webkit-box-align: stretch;
    44104603        align-items: stretch;
    44114604        align-items: center;
    44124605}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    44144607.buddypress-wrap .bp-feedback {
    44154608        background: #fff;
    44164609        color: #807f7f;
     4610        -webkit-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
     4611        -moz-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    44174612        box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    44184613        color: #737373;
    44194614        margin: 10px 0;
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    44924687.buddypress-wrap .bp-feedback.loading .bp-icon,
    44934688.buddypress-wrap .bp-feedback.success .bp-icon,
    44944689.buddypress-wrap .bp-feedback.updated .bp-icon {
     4690        display: -webkit-box;
     4691        display: -ms-flexbox;
     4692        display: -webkit-flex;
    44954693        display: flex;
     4694        -ms-flex-align: center;
     4695        -webkit-align-items: center;
     4696        -webkit-box-align: center;
    44964697        align-items: center;
    44974698        align-self: stretch;
    44984699}
    body.create-blog #buddypress .error, 
    46154816body.create-blog #buddypress .success {
    46164817        background: #fff;
    46174818        color: #807f7f;
     4819        -webkit-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
     4820        -moz-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    46184821        box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    46194822        color: #737373;
    46204823        padding: 10px 15px;
    body.create-blog #buddypress .success { 
    47344937}
    47354938
    47364939.buddypress.widget .avatar-block {
     4940        display: -webkit-flex;
    47374941        display: -moz-flex;
    47384942        display: -ms-flex;
    47394943        display: -o-flex;
    47404944        display: flex;
     4945        -webkit-flex-flow: row wrap;
     4946        -moz-flex-flow: row wrap;
     4947        -ms-flex-flow: row wrap;
    47414948        -o-flex-flow: row wrap;
    47424949        flex-flow: row wrap;
    47434950}
    body.create-blog #buddypress .success { 
    47844991.buddypress-wrap .buddypress.widget ul#friends-list,
    47854992.buddypress-wrap .buddypress.widget ul#groups-list,
    47864993.buddypress-wrap .buddypress.widget ul#members-list {
     4994        display: -webkit-flex;
    47874995        display: -moz-flex;
    47884996        display: -ms-flex;
    47894997        display: -o-flex;
    47904998        display: flex;
     4999        -webkit-flex-flow: column nowrap;
     5000        -moz-flex-flow: column nowrap;
     5001        -ms-flex-flow: column nowrap;
    47915002        -o-flex-flow: column nowrap;
    47925003        flex-flow: column nowrap;
    47935004}
    body.create-blog #buddypress .success { 
    47965007        .buddypress-wrap .buddypress.widget ul#friends-list,
    47975008        .buddypress-wrap .buddypress.widget ul#groups-list,
    47985009        .buddypress-wrap .buddypress.widget ul#members-list {
     5010                display: -webkit-flex;
    47995011                display: -moz-flex;
    48005012                display: -ms-flex;
    48015013                display: -o-flex;
    48025014                display: flex;
     5015                -webkit-flex-flow: row wrap;
     5016                -moz-flex-flow: row wrap;
     5017                -ms-flex-flow: row wrap;
    48035018                -o-flex-flow: row wrap;
    48045019                flex-flow: row wrap;
    48055020        }
    body.create-blog #buddypress .success { 
    48095024.buddypress-wrap .buddypress.widget ul#groups-list li,
    48105025.buddypress-wrap .buddypress.widget ul#members-list li {
    48115026        border: 1px solid #eee;
     5027        -ms-flex-align: stretch;
     5028        -webkit-align-items: stretch;
     5029        -webkit-box-align: stretch;
    48125030        align-items: stretch;
     5031        -webkit-flex: 1 1 46%;
    48135032        -moz-flex: 1 1 46%;
     5033        -ms-flex: 1 1 46%;
    48145034        -o-flex: 1 1 46%;
    48155035        flex: 1 1 46%;
    48165036        margin: 2%;
    body.create-blog #buddypress .success { 
    48205040        .buddypress-wrap .buddypress.widget ul#friends-list li,
    48215041        .buddypress-wrap .buddypress.widget ul#groups-list li,
    48225042        .buddypress-wrap .buddypress.widget ul#members-list li {
     5043                -webkit-flex: 0 1 20%;
    48235044                -moz-flex: 0 1 20%;
     5045                -ms-flex: 0 1 20%;
    48245046                -o-flex: 0 1 20%;
    48255047                flex: 0 1 20%;
    48265048        }
    body.create-blog #buddypress .success { 
    48565078        .buddypress-wrap .buddypress.widget ul#friends-list li,
    48575079        .buddypress-wrap .buddypress.widget ul#groups-list li,
    48585080        .buddypress-wrap .buddypress.widget ul#members-list li {
     5081                -webkit-flex: 0 1 auto;
    48595082                -moz-flex: 0 1 auto;
     5083                -ms-flex: 0 1 auto;
    48605084                -o-flex: 0 1 auto;
    48615085                flex: 0 1 auto;
    48625086                margin: 10px 2% 1%;
    body.create-blog #buddypress .success { 
    48845108
    48855109.buddypress-wrap a.loading,
    48865110.buddypress-wrap input.loading {
     5111        -moz-animation: loader-pulsate 0.5s infinite ease-in-out alternate;
     5112        -webkit-animation: loader-pulsate 0.5s infinite ease-in-out alternate;
    48875113        animation: loader-pulsate 0.5s infinite ease-in-out alternate;
    48885114        border-color: #aaa;
    48895115}
    48905116
     5117@-webkit-keyframes loader-pulsate {
     5118        from {
     5119                border-color: #aaa;
     5120                -webkit-box-shadow: 0 0 6px #ccc;
     5121                box-shadow: 0 0 6px #ccc;
     5122        }
     5123        to {
     5124                border-color: #ccc;
     5125                -webkit-box-shadow: 0 0 6px #f8f8f8;
     5126                box-shadow: 0 0 6px #f8f8f8;
     5127        }
     5128}
     5129
     5130@-moz-keyframes loader-pulsate {
     5131        from {
     5132                border-color: #aaa;
     5133                -moz-box-shadow: 0 0 6px #ccc;
     5134                box-shadow: 0 0 6px #ccc;
     5135        }
     5136        to {
     5137                border-color: #ccc;
     5138                -moz-box-shadow: 0 0 6px #f8f8f8;
     5139                box-shadow: 0 0 6px #f8f8f8;
     5140        }
     5141}
     5142
    48915143@keyframes loader-pulsate {
    48925144        from {
    48935145                border-color: #aaa;
     5146                -moz-box-shadow: 0 0 6px #ccc;
    48945147                box-shadow: 0 0 6px #ccc;
    48955148        }
    48965149        to {
    48975150                border-color: #ccc;
     5151                -moz-box-shadow: 0 0 6px #f8f8f8;
    48985152                box-shadow: 0 0 6px #f8f8f8;
    48995153        }
    49005154}
    body.create-blog #buddypress .success { 
    49135167        display: none;
    49145168        opacity: 0;
    49155169        position: absolute;
     5170        -webkit-transform: translate3d(0, 0, 0);
     5171        -ms-transform: translate3d(0, 0, 0);
    49165172        transform: translate3d(0, 0, 0);
    49175173        visibility: hidden;
    49185174}
    body.create-blog #buddypress .success { 
    49335189        pointer-events: none;
    49345190        text-shadow: none;
    49355191        text-transform: none;
     5192        -webkit-transition: all 1.5s ease;
     5193        -ms-transition: all 1.5s ease;
    49365194        transition: all 1.5s ease;
    49375195        white-space: nowrap;
    49385196        word-wrap: break-word;
    body.create-blog #buddypress .success { 
    49565214        right: 50%;
    49575215        margin-top: 7px;
    49585216        top: 110%;
     5217        -webkit-transform: translate(50%, 0);
     5218        -ms-transform: translate(50%, 0);
    49595219        transform: translate(50%, 0);
    49605220}
    49615221
    49625222.user-list .bp-tooltip:after {
    49635223        right: 0;
     5224        -webkit-transform: translate(0, 0);
     5225        -ms-transform: translate(0, 0);
    49645226        transform: translate(0, 0);
    49655227}
    49665228
    body.create-blog #buddypress .success { 
    49685230        .user-list .bp-tooltip:after {
    49695231                right: auto;
    49705232                left: 0;
     5233                -webkit-transform: translate(0, 0);
     5234                -ms-transform: translate(0, 0);
    49715235                transform: translate(0, 0);
    49725236        }
    49735237}
    body.create-blog #buddypress .success { 
    49785242.notification-actions .bp-tooltip:after,
    49795243.participants-list .bp-tooltip:after {
    49805244        right: 0;
     5245        -webkit-transform: translate(0, 0);
     5246        -ms-transform: translate(0, 0);
    49815247        transform: translate(0, 0);
    49825248}
    49835249
    body.create-blog #buddypress .success { 
    49865252.single-message-thread-header .actions .bp-tooltip:after {
    49875253        right: auto;
    49885254        left: 0;
     5255        -webkit-transform: translate(0, 0);
     5256        -ms-transform: translate(0, 0);
    49895257        transform: translate(0, 0);
    49905258}
    49915259
    body.create-blog #buddypress .success { 
    50015269*/
    50025270#item-body,
    50035271.single-screen-navs {
     5272        -webkit-box-sizing: border-box;
     5273        -moz-box-sizing: border-box;
    50045274        box-sizing: border-box;
    50055275}
    50065276
    50075277.grid > li,
    50085278.grid > li .generic-button a {
     5279        -webkit-box-sizing: border-box;
     5280        -moz-box-sizing: border-box;
    50095281        box-sizing: border-box;
    50105282}
    50115283
  • src/bp-templates/bp-nouveau/css/buddypress.css

    diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css
    index 526ff907e..4c20d1f71 100644
    body #buddypress select, 
    6969body #buddypress input[type="search"],
    7070body #buddypress input[type="submit"],
    7171body #buddypress input[type="reset"] {
     72        -webkit-border-radius: 2px;
     73        -moz-border-radius: 2px;
     74        -ms-border-radius: 2px;
    7275        border-radius: 2px;
    7376        background-clip: padding-box;
    7477}
    body #buddypress .bp-lists blockquote { 
    7982}
    8083
    8184body #buddypress .bp-list .action {
     85        -webkit-box-sizing: border-box;
     86        -moz-box-sizing: border-box;
    8287        box-sizing: border-box;
    8388}
    8489
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    375380        .buddypress-wrap.bp-dir-hori-nav:not(.bp-vertical-navs) nav:not(.tabbed-links) {
    376381                border-bottom: 1px solid #eee;
    377382                border-top: 1px solid #eee;
     383                -webkit-box-shadow: 0 2px 12px 0 #fafafa;
     384                -moz-box-shadow: 0 2px 12px 0 #fafafa;
    378385                box-shadow: 0 2px 12px 0 #fafafa;
    379386        }
    380387}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    868875}
    869876
    870877.bp-list {
     878        -webkit-box-sizing: border-box;
     879        -moz-box-sizing: border-box;
    871880        box-sizing: border-box;
    872881        border-top: 1px solid #eaeaea;
    873882        clear: both;
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    10181027.activity-list.bp-list .activity-item {
    10191028        background: #fff;
    10201029        border: 1px solid #b7b7b7;
     1030        -webkit-box-shadow: 0 0 6px #d2d2d2;
     1031        -moz-box-shadow: 0 0 6px #d2d2d2;
    10211032        box-shadow: 0 0 6px #d2d2d2;
    10221033        margin: 20px 0;
    10231034}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    10381049@media screen and (min-width: 46.8em) {
    10391050        .friends-request-list li,
    10401051        .membership-requests-list li {
     1052                display: -webkit-flex;
    10411053                display: -moz-flex;
    10421054                display: -ms-flex;
    10431055                display: -o-flex;
    10441056                display: flex;
     1057                -webkit-flex-flow: row nowrap;
     1058                -moz-flex-flow: row nowrap;
     1059                -ms-flex-flow: row nowrap;
    10451060                -o-flex-flow: row nowrap;
    10461061                flex-flow: row nowrap;
    10471062        }
    10481063        .friends-request-list li .item,
    10491064        .membership-requests-list li .item {
     1065                -webkit-flex: 1 1 auto;
    10501066                -moz-flex: 1 1 auto;
     1067                -ms-flex: 1 1 auto;
    10511068                -o-flex: 1 1 auto;
    10521069                flex: 1 1 auto;
    10531070        }
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11031120
    11041121.activity-update-form {
    11051122        border: 1px solid #ccc;
     1123        -webkit-box-shadow: inset 0 0 6px #eee;
     1124        -moz-box-shadow: inset 0 0 6px #eee;
    11061125        box-shadow: inset 0 0 6px #eee;
    11071126        margin: 15px 0;
    11081127}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11251144
    11261145.activity-update-form #whats-new-textarea textarea {
    11271146        background: #fff;
     1147        -webkit-box-sizing: border-box;
     1148        -moz-box-sizing: border-box;
    11281149        box-sizing: border-box;
    11291150        color: #333;
    11301151        font-family: inherit;
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11361157}
    11371158
    11381159.activity-update-form #whats-new-textarea textarea:focus {
     1160        -webkit-box-shadow: 0 0 6px 0 #d6d6d6;
     1161        -moz-box-shadow: 0 0 6px 0 #d6d6d6;
    11391162        box-shadow: 0 0 6px 0 #d6d6d6;
    11401163}
    11411164
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    11641187}
    11651188
    11661189.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object {
     1190        display: -webkit-box;
     1191        display: -ms-flexbox;
     1192        display: -webkit-flex;
    11671193        display: flex;
     1194        -ms-flex-align: center;
     1195        -webkit-align-items: center;
     1196        -webkit-box-align: center;
    11681197        align-items: center;
    11691198        padding: 0.2em;
    11701199}
    body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en 
    15121541.buddypress-wrap .activity-list .load-newest:focus,
    15131542.buddypress-wrap .activity-list .load-newest:hover {
    15141543        border-color: #e1e1e1;
     1544        -webkit-box-shadow: 0 0 6px 0 #eaeaea;
     1545        -moz-box-shadow: 0 0 6px 0 #eaeaea;
    15151546        box-shadow: 0 0 6px 0 #eaeaea;
    15161547}
    15171548
    body.activity-permalink .activity-list .activity-comments { 
    15771608                top: -20px;
    15781609        }
    15791610        body.activity-permalink .activity-list .activity-avatar img {
     1611                -webkit-box-shadow: 0 0 0 8px #fff;
    15801612                box-shadow: 0 0 0 8px #fff;
    15811613        }
    15821614        body.activity-permalink .activity-list .activity-content {
    body.activity-permalink .activity-list .activity-comments { 
    15871619        }
    15881620}
    15891621
     1622.bp-member-preview-cover,
     1623.bp-group-preview-cover {
     1624        position: relative;
     1625        min-height: 150px;
     1626        background: #c5c5c5;
     1627}
     1628
     1629.bp-member-preview-cover img,
     1630.bp-group-preview-cover img {
     1631        background: #c5c5c5;
     1632        object-fit: cover;
     1633        border: 0;
     1634        display: block;
     1635        margin: 0;
     1636        padding: 0;
     1637        width: 100%;
     1638        z-index: 1;
     1639        height: 150px;
     1640}
     1641
     1642.bp-member-short-description,
     1643.bp-group-short-description {
     1644        position: relative;
     1645        text-align: center;
     1646}
     1647
     1648.bp-members-avatar-wrapper {
     1649        display: flex;
     1650        justify-content: center;
     1651        padding: 0 15px;
     1652}
     1653
     1654.bp-members-avatar-content-inner {
     1655        margin: 0 5px;
     1656}
     1657
     1658.bp-member-avatar-content,
     1659.bp-group-avatar-content {
     1660        width: 200px;
     1661        margin: auto;
     1662        margin-top: -75px;
     1663        margin-bottom: 15px;
     1664        position: relative;
     1665        z-index: 2;
     1666}
     1667
     1668.bp-member-avatar-content img.profile-photo,
     1669.bp-member-avatar-content img.group-photo,
     1670.bp-group-avatar-content img.profile-photo,
     1671.bp-group-avatar-content img.group-photo {
     1672        width: 100%;
     1673        max-width: 150px;
     1674        background: rgba(255, 255, 255, 0.8);
     1675        border: 5px solid #fff;
     1676        border-radius: 100px;
     1677}
     1678
     1679.bp-member-short-description-title a,
     1680.bp-group-short-description-title a {
     1681        font-weight: 600;
     1682}
     1683
     1684@media screen and (max-width: 46.8em) {
     1685        .bp-member-avatar-content,
     1686        .bp-group-avatar-content {
     1687                width: 100%;
     1688                margin-bottom: 15px;
     1689        }
     1690        .bp-member-avatar-content img.profile-photo,
     1691        .bp-member-avatar-content img.group-photo,
     1692        .bp-group-avatar-content img.profile-photo,
     1693        .bp-group-avatar-content img.group-photo {
     1694                margin: auto;
     1695        }
     1696        .bp-profile-button {
     1697                margin-top: 15px;
     1698                position: relative;
     1699        }
     1700}
     1701
     1702@media screen and (min-width: 46.8em) {
     1703        .bp-profile-button {
     1704                position: absolute;
     1705                top: 100px;
     1706                right: 0;
     1707        }
     1708}
     1709
    15901710/**
    15911711*-----------------------------------------------------
    15921712* @section 3.1.3 - Activity Comments
    form.ac-form .ac-reply-content .ac-textarea textarea { 
    17571877}
    17581878
    17591879form.ac-form .ac-reply-content .ac-textarea textarea:focus {
     1880        -webkit-box-shadow: 0 0 6px #d6d6d6;
     1881        -moz-box-shadow: 0 0 6px #d6d6d6;
    17601882        box-shadow: 0 0 6px #d6d6d6;
    17611883}
    17621884
    form.ac-form .ac-reply-content input { 
    18201942
    18211943.buddypress-wrap .groups-list li .group-desc {
    18221944        border: 1px solid #eaeaea;
     1945        -webkit-border-radius: 10px;
     1946        -moz-border-radius: 10px;
     1947        -ms-border-radius: 10px;
    18231948        border-radius: 10px;
    18241949        background-clip: padding-box;
    18251950        font-size: 13px;
    form.ac-form .ac-reply-content input { 
    18952020
    18962021.buddypress-wrap .members-list li .user-update {
    18972022        border: 1px solid #eaeaea;
     2023        -webkit-border-radius: 10px;
     2024        -moz-border-radius: 10px;
     2025        -ms-border-radius: 10px;
    18982026        border-radius: 10px;
    18992027        background-clip: padding-box;
    19002028        color: #737373;
    form.ac-form .ac-reply-content input { 
    19442072*-------------------------------------------------------------------------------
    19452073*/
    19462074.register-page .register-section {
     2075        -webkit-box-sizing: border-box;
     2076        -moz-box-sizing: border-box;
    19472077        box-sizing: border-box;
    19482078}
    19492079
    body.no-js .single-item-header .js-self-profile-button { 
    23532483}
    23542484
    23552485.groups-header .moderators-lists img.avatar {
     2486        -moz-box-shadow: none;
     2487        -webkit-box-shadow: none;
    23562488        box-shadow: none;
    23572489        float: none;
    23582490        height: 30px;
    body.no-js .single-item-header .js-self-profile-button { 
    23902522
    23912523.groups-header .desc-wrap .group-description {
    23922524        background: #fafafa;
     2525        -webkit-box-shadow: inset 0 0 9px #ccc;
     2526        -moz-box-shadow: inset 0 0 9px #ccc;
    23932527        box-shadow: inset 0 0 9px #ccc;
    23942528        padding: 1em;
    23952529        text-align: left;
    body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * { 
    26682802}
    26692803
    26702804.buddypress .bp-invites-content ul.item-list li.selected {
     2805        -webkit-box-shadow: inset 0 0 12px 0 rgba(237, 187, 52, 0.2);
     2806        -moz-box-shadow: inset 0 0 12px 0 rgba(237, 187, 52, 0.2);
    26712807        box-shadow: inset 0 0 12px 0 rgba(237, 187, 52, 0.2);
    26722808}
    26732809
    body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * { 
    27392875
    27402876@media screen and (min-width: 46.8em) {
    27412877        .buddypress .bp-invites-content ul.item-list > li {
     2878                -webkit-box-sizing: border-box;
     2879                -moz-box-sizing: border-box;
    27422880                box-sizing: border-box;
    27432881                border: 1px solid #eaeaea;
    27442882                float: left;
    body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * { 
    27602898
    27612899@media screen and (min-width: 46.8em) {
    27622900        :not(.vertical) + .item-body #group-invites-container {
     2901                display: -ms-grid;
    27632902                display: grid;
     2903                -ms-grid-columns: 25% auto;
    27642904                grid-template-columns: 25% auto;
    27652905                grid-template-areas: "group-invites-nav group-invites-column";
    27662906        }
    body.register .buddypress-wrap .page ul { 
    30193159}
    30203160
    30213161.bp-messages-content .avatar {
     3162        -moz-box-shadow: none;
     3163        -webkit-box-shadow: none;
    30223164        box-shadow: none;
    30233165}
    30243166
    body.register .buddypress-wrap .page ul { 
    30493191
    30503192#message-threads li {
    30513193        border-bottom: 1px solid #eaeaea;
     3194        display: -webkit-flex;
    30523195        display: -moz-flex;
    30533196        display: -ms-flex;
    30543197        display: -o-flex;
    30553198        display: flex;
     3199        -webkit-flex-flow: row nowrap;
     3200        -moz-flex-flow: row nowrap;
     3201        -ms-flex-flow: row nowrap;
    30563202        -o-flex-flow: row nowrap;
    30573203        flex-flow: row nowrap;
    30583204        margin: 0;
    body.register .buddypress-wrap .page ul { 
    30613207}
    30623208
    30633209#message-threads li .thread-cb {
     3210        display: -webkit-box;
     3211        display: -ms-flexbox;
     3212        display: -webkit-flex;
    30643213        display: flex;
     3214        -ms-flex-align: center;
     3215        -webkit-align-items: center;
     3216        -webkit-box-align: center;
    30653217        align-items: center;
     3218        -webkit-flex: 1 2 5%;
    30663219        -moz-flex: 1 2 5%;
     3220        -ms-flex: 1 2 5%;
    30673221        -o-flex: 1 2 5%;
    30683222        flex: 1 2 5%;
    30693223}
    30703224
    30713225#message-threads li .thread-from,
    30723226#message-threads li .thread-to {
     3227        -webkit-flex: 1 2 20%;
    30733228        -moz-flex: 1 2 20%;
     3229        -ms-flex: 1 2 20%;
    30743230        -o-flex: 1 2 20%;
    30753231        flex: 1 2 20%;
    30763232}
    body.register .buddypress-wrap .page ul { 
    30963252}
    30973253
    30983254#message-threads li .thread-content {
     3255        -webkit-flex: 1 2 60%;
    30993256        -moz-flex: 1 2 60%;
     3257        -ms-flex: 1 2 60%;
    31003258        -o-flex: 1 2 60%;
    31013259        flex: 1 2 60%;
    31023260}
    31033261
    31043262#message-threads li .thread-date {
     3263        -webkit-flex: 1 2 15%;
    31053264        -moz-flex: 1 2 15%;
     3265        -ms-flex: 1 2 15%;
    31063266        -o-flex: 1 2 15%;
    31073267        flex: 1 2 15%;
    31083268}
    body.register .buddypress-wrap .page ul { 
    32043364
    32053365.bp-messages-content #bp-message-thread-list .message-metadata {
    32063366        border-bottom: 1px solid #ccc;
     3367        -webkit-box-shadow: -2px 1px 9px 0 #eee;
     3368        -moz-box-shadow: -2px 1px 9px 0 #eee;
    32073369        box-shadow: -2px 1px 9px 0 #eee;
    32083370        display: table;
    32093371        padding: 0.2em;
    body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { 
    34473609.buddypress-wrap input[type="url"]:focus,
    34483610.buddypress-wrap input[type="tel"]:focus,
    34493611.buddypress-wrap input[type="password"]:focus {
     3612        -webkit-box-shadow: 0 0 8px #eaeaea;
     3613        -moz-box-shadow: 0 0 8px #eaeaea;
    34503614        box-shadow: 0 0 8px #eaeaea;
    34513615}
    34523616
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    36863850}
    36873851
    36883852.buddypress-wrap .select-wrap select {
     3853        -moz-appearance: none;
    36893854        -webkit-appearance: none;
    36903855        -o-appearance: none;
    36913856        appearance: none;
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    37803945.buddypress-wrap form#group-members-search button[type="submit"] {
    37813946        background: none;
    37823947        border: 0;
     3948        -webkit-border-radius: 0;
     3949        -moz-border-radius: 0;
     3950        -ms-border-radius: 0;
    37833951        border-radius: 0;
    37843952        background-clip: padding-box;
    37853953}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    40564224}
    40574225
    40584226.center-vert {
     4227        display: -ms-flexbox;
     4228        display: -webkit-flex;
    40594229        display: flex;
     4230        -ms-flex-align: center;
     4231        -webkit-align-items: center;
     4232        -webkit-box-align: center;
    40604233        align-items: center;
    40614234}
    40624235
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    41704343.buddypress .buddypress-wrap input.text-button {
    41714344        background: none;
    41724345        border: 0;
     4346        -moz-box-shadow: none;
     4347        -webkit-box-shadow: none;
    41734348        box-shadow: none;
    41744349        color: #767676;
    41754350}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    42654440
    42664441.buddypress #buddypress .create-button a {
    42674442        border: 1px solid #ccc;
     4443        -webkit-border-radius: 5px;
     4444        -moz-border-radius: 5px;
     4445        -ms-border-radius: 5px;
    42684446        border-radius: 5px;
    42694447        background-clip: padding-box;
     4448        -webkit-box-shadow: inset 0 0 6px 0 #eaeaea;
     4449        -moz-box-shadow: inset 0 0 6px 0 #eaeaea;
    42704450        box-shadow: inset 0 0 6px 0 #eaeaea;
    42714451        margin: 0.2em 0;
    42724452        width: auto;
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    42754455.buddypress #buddypress .create-button a:focus, .buddypress #buddypress .create-button a:hover {
    42764456        background: none;
    42774457        border-color: #ccc;
     4458        -webkit-box-shadow: inset 0 0 12px 0 #eaeaea;
     4459        -moz-box-shadow: inset 0 0 12px 0 #eaeaea;
    42784460        box-shadow: inset 0 0 12px 0 #eaeaea;
    42794461}
    42804462
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    42964478.buddypress #buddypress.bp-dir-hori-nav .create-button a:hover {
    42974479        background: none;
    42984480        border: 0;
     4481        -moz-box-shadow: none;
     4482        -webkit-box-shadow: none;
    42994483        box-shadow: none;
    43004484        margin: 0;
    43014485}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    43964580.buddypress-wrap #group-create-body .bp-cover-image-status p.warning {
    43974581        background: #0b80a4;
    43984582        border: 0;
     4583        -webkit-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.2);
     4584        -moz-box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.2);
    43994585        box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.2);
    44004586        color: #fff;
    44014587}
    44024588
    44034589.buddypress-wrap .bp-feedback:not(.custom-homepage-info) {
     4590        display: -webkit-flex;
    44044591        display: -moz-flex;
    44054592        display: -ms-flex;
    44064593        display: -o-flex;
    44074594        display: flex;
     4595        -webkit-flex-flow: row nowrap;
     4596        -moz-flex-flow: row nowrap;
     4597        -ms-flex-flow: row nowrap;
    44084598        -o-flex-flow: row nowrap;
    44094599        flex-flow: row nowrap;
     4600        -ms-flex-align: stretch;
     4601        -webkit-align-items: stretch;
     4602        -webkit-box-align: stretch;
    44104603        align-items: stretch;
    44114604        align-items: center;
    44124605}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    44144607.buddypress-wrap .bp-feedback {
    44154608        background: #fff;
    44164609        color: #807f7f;
     4610        -webkit-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
     4611        -moz-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    44174612        box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    44184613        color: #737373;
    44194614        margin: 10px 0;
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    44924687.buddypress-wrap .bp-feedback.loading .bp-icon,
    44934688.buddypress-wrap .bp-feedback.success .bp-icon,
    44944689.buddypress-wrap .bp-feedback.updated .bp-icon {
     4690        display: -webkit-box;
     4691        display: -ms-flexbox;
     4692        display: -webkit-flex;
    44954693        display: flex;
     4694        -ms-flex-align: center;
     4695        -webkit-align-items: center;
     4696        -webkit-box-align: center;
    44964697        align-items: center;
    44974698        align-self: stretch;
    44984699}
    body.create-blog #buddypress .error, 
    46154816body.create-blog #buddypress .success {
    46164817        background: #fff;
    46174818        color: #807f7f;
     4819        -webkit-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
     4820        -moz-box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    46184821        box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
    46194822        color: #737373;
    46204823        padding: 10px 15px;
    body.create-blog #buddypress .success { 
    47344937}
    47354938
    47364939.buddypress.widget .avatar-block {
     4940        display: -webkit-flex;
    47374941        display: -moz-flex;
    47384942        display: -ms-flex;
    47394943        display: -o-flex;
    47404944        display: flex;
     4945        -webkit-flex-flow: row wrap;
     4946        -moz-flex-flow: row wrap;
     4947        -ms-flex-flow: row wrap;
    47414948        -o-flex-flow: row wrap;
    47424949        flex-flow: row wrap;
    47434950}
    body.create-blog #buddypress .success { 
    47844991.buddypress-wrap .buddypress.widget ul#friends-list,
    47854992.buddypress-wrap .buddypress.widget ul#groups-list,
    47864993.buddypress-wrap .buddypress.widget ul#members-list {
     4994        display: -webkit-flex;
    47874995        display: -moz-flex;
    47884996        display: -ms-flex;
    47894997        display: -o-flex;
    47904998        display: flex;
     4999        -webkit-flex-flow: column nowrap;
     5000        -moz-flex-flow: column nowrap;
     5001        -ms-flex-flow: column nowrap;
    47915002        -o-flex-flow: column nowrap;
    47925003        flex-flow: column nowrap;
    47935004}
    body.create-blog #buddypress .success { 
    47965007        .buddypress-wrap .buddypress.widget ul#friends-list,
    47975008        .buddypress-wrap .buddypress.widget ul#groups-list,
    47985009        .buddypress-wrap .buddypress.widget ul#members-list {
     5010                display: -webkit-flex;
    47995011                display: -moz-flex;
    48005012                display: -ms-flex;
    48015013                display: -o-flex;
    48025014                display: flex;
     5015                -webkit-flex-flow: row wrap;
     5016                -moz-flex-flow: row wrap;
     5017                -ms-flex-flow: row wrap;
    48035018                -o-flex-flow: row wrap;
    48045019                flex-flow: row wrap;
    48055020        }
    body.create-blog #buddypress .success { 
    48095024.buddypress-wrap .buddypress.widget ul#groups-list li,
    48105025.buddypress-wrap .buddypress.widget ul#members-list li {
    48115026        border: 1px solid #eee;
     5027        -ms-flex-align: stretch;
     5028        -webkit-align-items: stretch;
     5029        -webkit-box-align: stretch;
    48125030        align-items: stretch;
     5031        -webkit-flex: 1 1 46%;
    48135032        -moz-flex: 1 1 46%;
     5033        -ms-flex: 1 1 46%;
    48145034        -o-flex: 1 1 46%;
    48155035        flex: 1 1 46%;
    48165036        margin: 2%;
    body.create-blog #buddypress .success { 
    48205040        .buddypress-wrap .buddypress.widget ul#friends-list li,
    48215041        .buddypress-wrap .buddypress.widget ul#groups-list li,
    48225042        .buddypress-wrap .buddypress.widget ul#members-list li {
     5043                -webkit-flex: 0 1 20%;
    48235044                -moz-flex: 0 1 20%;
     5045                -ms-flex: 0 1 20%;
    48245046                -o-flex: 0 1 20%;
    48255047                flex: 0 1 20%;
    48265048        }
    body.create-blog #buddypress .success { 
    48565078        .buddypress-wrap .buddypress.widget ul#friends-list li,
    48575079        .buddypress-wrap .buddypress.widget ul#groups-list li,
    48585080        .buddypress-wrap .buddypress.widget ul#members-list li {
     5081                -webkit-flex: 0 1 auto;
    48595082                -moz-flex: 0 1 auto;
     5083                -ms-flex: 0 1 auto;
    48605084                -o-flex: 0 1 auto;
    48615085                flex: 0 1 auto;
    48625086                margin: 10px 2% 1%;
    body.create-blog #buddypress .success { 
    48845108
    48855109.buddypress-wrap a.loading,
    48865110.buddypress-wrap input.loading {
     5111        -moz-animation: loader-pulsate 0.5s infinite ease-in-out alternate;
     5112        -webkit-animation: loader-pulsate 0.5s infinite ease-in-out alternate;
    48875113        animation: loader-pulsate 0.5s infinite ease-in-out alternate;
    48885114        border-color: #aaa;
    48895115}
    48905116
     5117@-webkit-keyframes loader-pulsate {
     5118        from {
     5119                border-color: #aaa;
     5120                -webkit-box-shadow: 0 0 6px #ccc;
     5121                box-shadow: 0 0 6px #ccc;
     5122        }
     5123        to {
     5124                border-color: #ccc;
     5125                -webkit-box-shadow: 0 0 6px #f8f8f8;
     5126                box-shadow: 0 0 6px #f8f8f8;
     5127        }
     5128}
     5129
     5130@-moz-keyframes loader-pulsate {
     5131        from {
     5132                border-color: #aaa;
     5133                -moz-box-shadow: 0 0 6px #ccc;
     5134                box-shadow: 0 0 6px #ccc;
     5135        }
     5136        to {
     5137                border-color: #ccc;
     5138                -moz-box-shadow: 0 0 6px #f8f8f8;
     5139                box-shadow: 0 0 6px #f8f8f8;
     5140        }
     5141}
     5142
    48915143@keyframes loader-pulsate {
    48925144        from {
    48935145                border-color: #aaa;
     5146                -moz-box-shadow: 0 0 6px #ccc;
    48945147                box-shadow: 0 0 6px #ccc;
    48955148        }
    48965149        to {
    48975150                border-color: #ccc;
     5151                -moz-box-shadow: 0 0 6px #f8f8f8;
    48985152                box-shadow: 0 0 6px #f8f8f8;
    48995153        }
    49005154}
    body.create-blog #buddypress .success { 
    49135167        display: none;
    49145168        opacity: 0;
    49155169        position: absolute;
     5170        -webkit-transform: translate3d(0, 0, 0);
     5171        -ms-transform: translate3d(0, 0, 0);
    49165172        transform: translate3d(0, 0, 0);
    49175173        visibility: hidden;
    49185174}
    body.create-blog #buddypress .success { 
    49335189        pointer-events: none;
    49345190        text-shadow: none;
    49355191        text-transform: none;
     5192        -webkit-transition: all 1.5s ease;
     5193        -ms-transition: all 1.5s ease;
    49365194        transition: all 1.5s ease;
    49375195        white-space: nowrap;
    49385196        word-wrap: break-word;
    body.create-blog #buddypress .success { 
    49565214        left: 50%;
    49575215        margin-top: 7px;
    49585216        top: 110%;
     5217        -webkit-transform: translate(-50%, 0);
     5218        -ms-transform: translate(-50%, 0);
    49595219        transform: translate(-50%, 0);
    49605220}
    49615221
    49625222.user-list .bp-tooltip:after {
    49635223        left: 0;
     5224        -webkit-transform: translate(0, 0);
     5225        -ms-transform: translate(0, 0);
    49645226        transform: translate(0, 0);
    49655227}
    49665228
    body.create-blog #buddypress .success { 
    49685230        .user-list .bp-tooltip:after {
    49695231                left: auto;
    49705232                right: 0;
     5233                -webkit-transform: translate(0, 0);
     5234                -ms-transform: translate(0, 0);
    49715235                transform: translate(0, 0);
    49725236        }
    49735237}
    body.create-blog #buddypress .success { 
    49785242.notification-actions .bp-tooltip:after,
    49795243.participants-list .bp-tooltip:after {
    49805244        left: 0;
     5245        -webkit-transform: translate(0, 0);
     5246        -ms-transform: translate(0, 0);
    49815247        transform: translate(0, 0);
    49825248}
    49835249
    body.create-blog #buddypress .success { 
    49865252.single-message-thread-header .actions .bp-tooltip:after {
    49875253        left: auto;
    49885254        right: 0;
     5255        -webkit-transform: translate(0, 0);
     5256        -ms-transform: translate(0, 0);
    49895257        transform: translate(0, 0);
    49905258}
    49915259
    body.create-blog #buddypress .success { 
    50015269*/
    50025270#item-body,
    50035271.single-screen-navs {
     5272        -webkit-box-sizing: border-box;
     5273        -moz-box-sizing: border-box;
    50045274        box-sizing: border-box;
    50055275}
    50065276
    50075277.grid > li,
    50085278.grid > li .generic-button a {
     5279        -webkit-box-sizing: border-box;
     5280        -moz-box-sizing: border-box;
    50095281        box-sizing: border-box;
    50105282}
    50115283
  • tests/phpunit/testcases/core/class-bp-attachment.php

    diff --git tests/phpunit/testcases/core/class-bp-attachment.php tests/phpunit/testcases/core/class-bp-attachment.php
    index fae4e150d..6bb1c308b 100644
    class BP_Tests_BP_Attachment_TestCases extends BP_UnitTestCase { 
    406406                $this->clean_files( 'shrink' );
    407407        }
    408408
     409        /**
     410         * @group add_revision
     411         */
     412        public function test_bp_attachment_add_revision() {
     413                if ( false === _wp_image_editor_choose() || version_compare( phpversion(), '7.0' , '<' ) ) {
     414                        $this->markTestSkipped( 'This test requires PHP >= 7.0 and to have a valid image editor that is compatible with WordPress.' );
     415                }
     416
     417                $image = BP_TESTS_DIR . 'assets/upside-down.jpg';
     418
     419                $attachment = new BPTest_Attachment_Extension(
     420                        array(
     421                                'base_dir'   => 'add_revision',
     422                                'action'     => 'attachment_action',
     423                                'file_input' => 'attachment_file_input',
     424                        )
     425                );
     426
     427                $abs_path_copy = $attachment->upload_path . '/upside-down.jpg';
     428                copy( $image, $abs_path_copy );
     429
     430                $revision = $attachment->add_revision(
     431                        'media',
     432                        array(
     433                                'file_abspath' => $abs_path_copy,
     434                                'file_id'      => 'media',
     435                        )
     436                );
     437
     438                $this->assertFalse( file_exists( $abs_path_copy ) );
     439                $this->assertTrue( file_exists( $revision->path ) );
     440
     441                // Cleanup
     442                @unlink( $revision->path );
     443                @rmdir( dirname( $revision->path ) );
     444                $this->clean_files( 'add_revision' );
     445        }
     446
     447        /**
     448         * @group add_revision
     449         * @group avatars
     450         */
     451        public function test_bp_attachment_add_avatar_history() {
     452                if ( false === _wp_image_editor_choose() || version_compare( phpversion(), '7.0' , '<' ) ) {
     453                        $this->markTestSkipped( 'This test requires PHP >= 7.0 and to have a valid image editor that is compatible with WordPress.' );
     454                }
     455
     456                $image = BP_TESTS_DIR . 'assets/upside-down.jpg';
     457
     458                $attachment = new BPTest_Attachment_Extension(
     459                        array(
     460                                'base_dir'   => 'add_history',
     461                                'action'     => 'attachment_action',
     462                                'file_input' => 'attachment_file_input',
     463                        )
     464                );
     465
     466                $abs_path_copy = $attachment->upload_path . '/upside-down.jpg';
     467                copy( $image, $abs_path_copy );
     468
     469                $revision = $attachment->add_revision(
     470                        'avatar',
     471                        array(
     472                                'file_abspath' => $abs_path_copy,
     473                                'file_id'      => 'avatar',
     474                        )
     475                );
     476
     477                $this->assertFalse( file_exists( $abs_path_copy ) );
     478                $this->assertTrue( file_exists( $revision->path ) );
     479                $this->assertSame( $attachment->url . '/history/upside-down.jpg', $revision->url );
     480
     481                // Cleanup
     482                @unlink( $revision->path );
     483                @rmdir( dirname( $revision->path ) );
     484                $this->clean_files( 'add_history' );
     485        }
     486
    409487        public function limit_to_50px( $max_width ) {
    410488                return 50;
    411489        }