Skip to:
Content

BuddyPress.org

Changeset 12734


Ignore:
Timestamp:
09/25/2020 03:13:24 AM (4 years ago)
Author:
imath
Message:

Blogs: renovate the create a blog form

This blog form let logged in users create sites. It aged badly since version 1.0 and we were unnecessarily resetting the blog domain for subdomain installs though wpmu_validate_blog_signup() is already generating this domain.

Fixes #8365

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r12606 r12734  
    14771477}
    14781478add_action( 'bp_make_ham_user', 'bp_blogs_restore_data', 10, 1 );
     1479
     1480/**
     1481 * Checks whether blog creation is enabled.
     1482 *
     1483 * Returns true when blog creation is enabled for logged-in users only, or
     1484 * when it's enabled for new registrations.
     1485 *
     1486 * @since 1.0.0
     1487 * @since 7.0.0 The function has been moved into `bp-blogs/bp-blogs-functions.php`.
     1488 *
     1489 * @return bool True if blog registration is enabled.
     1490 */
     1491function bp_blog_signup_enabled() {
     1492    $bp            = buddypress();
     1493    $retval        = true;
     1494    $active_signup = 'all';
     1495
     1496    if ( isset( $bp->site_options['registration'] ) ) {
     1497        $active_signup = $bp->site_options['registration'];
     1498    }
     1499
     1500    /**
     1501     * Filters whether or not blog creation is enabled.
     1502     *
     1503     * Return "all", "none", "blog" or "user".
     1504     *
     1505     * @since 1.0.0
     1506     *
     1507     * @param string $active_signup Value of the registration site option creation status.
     1508     */
     1509    $active_signup = apply_filters( 'wpmu_active_signup', $active_signup );
     1510
     1511    if ( 'none' === $active_signup || 'user' === $active_signup ) {
     1512        $retval = false;
     1513    }
     1514
     1515    return $retval;
     1516}
     1517
     1518/**
     1519 * Returns the Blog signup's submitted vars.
     1520 *
     1521 * @since 7.0.0
     1522 *
     1523 * @return array An associative array containing the Blog signup's submitted vars.
     1524 */
     1525function bp_blogs_get_signup_form_submitted_vars() {
     1526    $exprected_vars = array(
     1527        'blogname'    => '',
     1528        'blog_title'  => '',
     1529        'blog_public' => 0,
     1530    );
     1531
     1532    $submitted_vars = wp_parse_args( $_POST, $exprected_vars );
     1533
     1534    return array_map( 'wp_unslash', array_intersect_key( $submitted_vars, $exprected_vars ) );
     1535}
     1536
     1537/**
     1538 * Validate a blog creation submission.
     1539 *
     1540 * Essentially, a wrapper for {@link wpmu_validate_blog_signup()}.
     1541 *
     1542 * @since 1.0.0
     1543 * @since 7.0.0 Add the blog_name and blog_title parameters.
     1544 *              The function has been moved into `bp-blogs/bp-blogs-functions.php`.
     1545 *
     1546 * @return array Contains the new site data and error messages.
     1547 */
     1548function bp_blogs_validate_blog_form( $blog_name = '', $blog_title = '' ) {
     1549    $user = '';
     1550
     1551    if ( is_user_logged_in() ) {
     1552        $user = wp_get_current_user();
     1553    }
     1554
     1555    if ( ! $blog_name && ! $blog_title ) {
     1556        $submitted_vars = bp_blogs_get_signup_form_submitted_vars();
     1557
     1558        if ( array_filter( $submitted_vars ) ) {
     1559            $blog_name  = $submitted_vars['blogname'];
     1560            $blog_title = $submitted_vars['blog_title'];
     1561        }
     1562    }
     1563
     1564    return wpmu_validate_blog_signup( $blog_name, $blog_title, $user );
     1565}
  • trunk/src/bp-blogs/bp-blogs-template.php

    r12636 r12734  
    10031003
    10041004/**
    1005  * Checks whether blog creation is enabled.
    1006  *
    1007  * Returns true when blog creation is enabled for logged-in users only, or
    1008  * when it's enabled for new registrations.
    1009  *
    1010  * @return bool True if blog registration is enabled.
    1011  */
    1012 function bp_blog_signup_enabled() {
    1013     $bp = buddypress();
    1014 
    1015     $active_signup = isset( $bp->site_options['registration'] )
    1016         ? $bp->site_options['registration']
    1017         : 'all';
    1018 
    1019     /**
    1020      * Filters whether or not blog creation is enabled.
    1021      *
    1022      * Return "all", "none", "blog" or "user".
    1023      *
    1024      * @since 1.0.0
    1025      *
    1026      * @param string $active_signup Value of the registration site option creation status.
    1027      */
    1028     $active_signup = apply_filters( 'wpmu_active_signup', $active_signup );
    1029 
    1030     if ( 'none' == $active_signup || 'user' == $active_signup )
    1031         return false;
    1032 
    1033     return true;
    1034 }
    1035 
    1036 /**
    10371005 * Output the wrapper markup for the blog signup form.
     1006 *
     1007 * @since 1.0.0
    10381008 *
    10391009 * @param string          $blogname   Optional. The default blog name (path or domain).
     
    10421012 *                                    submission attempt.
    10431013 */
    1044 function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') {
    1045     global $current_user;
    1046 
    1047     if ( isset($_POST['submit']) ) {
    1048         bp_blogs_validate_blog_signup();
    1049     } else {
    1050         if ( ! is_wp_error($errors) ) {
     1014function bp_show_blog_signup_form( $blogname = '', $blog_title = '', $errors = '' ) {
     1015    $blog_id = bp_blogs_validate_blog_signup();
     1016
     1017    // Display the signup form.
     1018    if ( false === $blog_id || is_wp_error( $blog_id ) ) {
     1019        if ( is_wp_error( $blog_id ) ) {
     1020            $errors = $blog_id;
     1021        } else {
    10511022            $errors = new WP_Error();
    10521023        }
     
    10641035         */
    10651036        $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
    1066         $blogname = $filtered_results['blogname'];
    1067         $blog_title = $filtered_results['blog_title'];
    1068         $errors = $filtered_results['errors'];
     1037        $blogname         = $filtered_results['blogname'];
     1038        $blog_title       = $filtered_results['blog_title'];
     1039        $errors           = $filtered_results['errors'];
    10691040
    10701041        if ( $errors->get_error_code() ) {
    1071             echo "<p>" . __('There was a problem; please correct the form below and try again.', 'buddypress') . "</p>";
    1072         }
     1042            if ( in_array( $errors->get_error_code(), array( 'blogname', 'blog_title' ), true ) ) {
     1043                printf(
     1044                    '<p class="error">%s</p>',
     1045                    esc_html__( 'There was a problem; please correct the form below and try again.', 'buddypress' )
     1046                );
     1047            } else {
     1048                printf(
     1049                    '<p class="error">%s</p>',
     1050                    $errors->get_error_message()
     1051                );
     1052            }
     1053        }
     1054
     1055        printf(
     1056            '<p>%1$s <strong>%2$s</strong>. %3$s</p>',
     1057            esc_html__( 'By filling out the form below, you can', 'buddypress' ),
     1058            esc_html__( 'add a site to your account', 'buddypress' ),
     1059            esc_html__( 'There is no limit to the number of sites that you can have, so create to your heart’s content, but blog responsibly!', 'buddypress' )
     1060        );
    10731061        ?>
    1074         <p><?php printf(__("By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!", 'buddypress'), $current_user->display_name) ?></p>
    1075 
    1076         <p><?php _e("If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!", 'buddypress') ?></p>
     1062
     1063        <p>
     1064            <?php esc_html_e( 'If you’re not going to use a great domain, leave it for a new user. Now have at it!', 'buddypress' ); ?>
     1065        </p>
    10771066
    10781067        <form class="standard-form" id="setupform" method="post" action="">
     
    10881077            do_action( 'signup_hidden_fields' ); ?>
    10891078
    1090             <?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
     1079            <?php bp_blogs_signup_blog( $blogname, $blog_title, $errors ); ?>
    10911080            <p>
    1092                 <input id="submit" type="submit" name="submit" class="submit" value="<?php esc_attr_e('Create Site', 'buddypress') ?>" />
     1081                <input id="submit" type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site', 'buddypress' ); ?>" />
    10931082            </p>
    10941083
     
    10961085        </form>
    10971086        <?php
     1087
     1088        // Display the confirmation form.
     1089    } elseif ( is_numeric( $blog_id ) ) {
     1090        // Validate the site.
     1091        $site = get_site( $blog_id );
     1092
     1093        if ( isset( $site->id ) && $site->id ) {
     1094            $current_user = wp_get_current_user();
     1095
     1096            bp_blogs_confirm_blog_signup(
     1097                $site->domain,
     1098                $site->path,
     1099                $site->blogname,
     1100                $current_user->user_login,
     1101                $current_user->user_email,
     1102                '',
     1103                $site->id
     1104            );
     1105        }
    10981106    }
    10991107}
     
    11011109/**
    11021110 * Output the input fields for the blog creation form.
     1111 *
     1112 * @since 1.0.0
    11031113 *
    11041114 * @param string          $blogname   Optional. The default blog name (path or domain).
     
    11081118 */
    11091119function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
    1110     global $current_site;
    1111 
    1112     // Blog name.
    1113     if( !is_subdomain_install() )
    1114         echo '<label for="blogname">' . __('Site Name:', 'buddypress') . '</label>';
    1115     else
    1116         echo '<label for="blogname">' . __('Site Domain:', 'buddypress') . '</label>';
    1117 
    1118     if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
    1119 
    1120         <p class="error"><?php echo $errmsg ?></p>
    1121 
    1122     <?php }
    1123 
    1124     if ( !is_subdomain_install() )
    1125         echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />';
    1126     else
    1127         echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" ' . bp_get_form_field_attributes( 'blogname' ) . '/> <span class="suffix_address">.' . bp_signup_get_subdomain_base() . '</span><br />';
    1128 
    1129     if ( !is_user_logged_in() ) {
    1130         print '(<strong>' . __( 'Your address will be ' , 'buddypress');
    1131 
    1132         if ( !is_subdomain_install() ) {
    1133             print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress');
     1120    $current_site = get_current_site();
     1121
     1122    if ( ! $blogname && ! $blog_title ) {
     1123        $submitted_vars = bp_blogs_get_signup_form_submitted_vars();
     1124
     1125        if ( array_filter( $submitted_vars ) ) {
     1126            $blogname   = $submitted_vars['blogname'];
     1127            $blog_title = $submitted_vars['blog_title'];
     1128        }
     1129    }
     1130    ?>
     1131
     1132    <p>
     1133        <?php
     1134        // Blog name.
     1135        if ( ! is_subdomain_install() ) {
     1136            printf( '<label for="blogname">%s</label>', esc_html__( 'Site Name:', 'buddypress' ) );
    11341137        } else {
    1135             print __( 'domain.' , 'buddypress') . $current_site->domain . $current_site->path;
    1136         }
    1137 
    1138         echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddypress') . '</p>';
     1138            printf( '<label for="blogname">%s</label>', esc_html__( 'Site Domain:', 'buddypress' ) );
     1139        }
     1140
     1141        if ( ! is_subdomain_install() ) {
     1142            printf(
     1143                '<span class="prefix_address">%1$s</span> <input name="blogname" type="text" id="blogname" value="%2$s" maxlength="63" style="width: auto!important" /><br />',
     1144                esc_html( $current_site->domain . $current_site->path ),
     1145                esc_attr( $blogname )
     1146            );
     1147        } else {
     1148            printf(
     1149                '<input name="blogname" type="text" id="blogname" value="%1$s" maxlength="63" style="width: auto!important" %2$s/> <span class="suffix_address">.%3$s</span><br />',
     1150                esc_attr( $blogname ),
     1151                bp_get_form_field_attributes( 'blogname' ),
     1152                bp_signup_get_subdomain_base()
     1153            );
     1154        }
     1155        if ( is_wp_error( $errors ) && $errors->get_error_message( 'blogname' ) ) {
     1156            printf( '<div class="error">%s</div>', $errors->get_error_message( 'blogname' ) );
     1157        }
     1158        ?>
     1159    </p>
     1160
     1161    <?php
     1162    if ( ! is_user_logged_in() ) {
     1163        $url = sprintf(
     1164            /* translators: %s is the site domain and path. */
     1165            __( 'domain.%s' , 'buddypress' ),
     1166            $current_site->domain . $current_site->path
     1167        );
     1168
     1169        if ( ! is_subdomain_install() ) {
     1170            $url = sprintf(
     1171                /* translators: %s is the site domain and path. */
     1172                __( '%sblogname' , 'buddypress'),
     1173                $current_site->domain . $current_site->path
     1174            );
     1175        }
     1176
     1177        printf(
     1178            '<p>(<strong>%1$s.</strong> %2$s)</p>',
     1179            sprintf( esc_html__( 'Your address will be %s' , 'buddypress' ), $url ),
     1180            esc_html__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!' , 'buddypress' )
     1181        );
    11391182    }
    11401183
    11411184    // Blog Title.
    11421185    ?>
    1143 
    1144     <label for="blog_title"><?php _e('Site Title:', 'buddypress') ?></label>
    1145 
    1146     <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?>
    1147 
    1148         <p class="error"><?php echo $errmsg ?></p>
    1149 
    1150     <?php }
    1151     echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>';
    1152     ?>
     1186    <p>
     1187        <label for="blog_title"><?php esc_html_e('Site Title:', 'buddypress') ?></label>
     1188        <input name="blog_title" type="text" id="blog_title" value="<?php echo esc_html( $blog_title ); ?>" />
     1189
     1190        <?php
     1191        if ( is_wp_error( $errors ) && $errors->get_error_message( 'blog_title' ) ) {
     1192            printf( '<div class="error">%s</div>', $errors->get_error_message( 'blog_title' ) );
     1193        }
     1194        ?>
     1195    </p>
    11531196
    11541197    <fieldset class="create-site">
    1155         <legend class="label"><?php _e('Privacy: I would like my site to appear in search engines, and in public listings around this network', 'buddypress') ?></legend>
    1156 
    1157         <label class="checkbox" for="blog_public_on">
    1158             <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
    1159             <strong><?php _e( 'Yes' , 'buddypress'); ?></strong>
    1160         </label>
    1161         <label class="checkbox" for="blog_public_off">
    1162             <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
    1163             <strong><?php _e( 'No' , 'buddypress'); ?></strong>
    1164         </label>
     1198
     1199        <legend class="label"><?php esc_html_e( 'Privacy: I would like my site to appear in search engines, and in public listings around this network', 'buddypress' ) ?></legend>
     1200
     1201        <p>
     1202            <label class="checkbox" for="blog_public_on">
     1203                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php checked( ! isset( $_POST['blog_public'] ) || 1 === (int) $_POST['blog_public'] ); ?> />
     1204                <strong><?php esc_html_e( 'Yes' , 'buddypress'); ?></strong>
     1205            </label>
     1206        </p>
     1207
     1208        <p>
     1209            <label class="checkbox" for="blog_public_off">
     1210                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php checked( isset( $_POST['blog_public'] ) && 0 === (int) $_POST['blog_public'] ); ?> />
     1211                <strong><?php esc_html_e( 'No' , 'buddypress'); ?></strong>
     1212            </label>
     1213        </p>
     1214
    11651215    </fieldset>
    11661216
     
    11741224     * @param WP_Error $errors WP_Error object if any present.
    11751225     */
    1176     do_action('signup_blogform', $errors);
     1226    do_action( 'signup_blogform', $errors );
    11771227}
    11781228
     
    11821232 * Passes submitted values to {@link wpmu_create_blog()}.
    11831233 *
    1184  * @return bool True on success, false on failure.
     1234 * @since 1.0.0
     1235 *
     1236 * @return bool|int|WP_Error False if not a form submission, the Blog ID on success, a WP_Error object on failure.
    11851237 */
    11861238function bp_blogs_validate_blog_signup() {
    1187     global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path, $current_site;
    1188 
    1189     if ( !check_admin_referer( 'bp_blog_signup_form' ) )
     1239    if ( ! isset( $_POST['submit'] ) ) {
    11901240        return false;
    1191 
     1241    }
     1242
     1243    $current_site = get_current_site();
    11921244    $current_user = wp_get_current_user();
    1193 
    1194     if( !is_user_logged_in() )
    1195         die();
    1196 
    1197     $result = bp_blogs_validate_blog_form();
    1198     extract($result);
    1199 
    1200     if ( $errors->get_error_code() ) {
    1201         unset($_POST['submit']);
    1202         bp_show_blog_signup_form( $blogname, $blog_title, $errors );
    1203         return false;
    1204     }
    1205 
    1206     $public = (int) $_POST['blog_public'];
    1207 
    1208     // Depreciated.
    1209     $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) );
     1245    $blog_name    = '';
     1246    $blog_title   = '';
     1247    $public       = 1;
     1248
     1249    if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['_wpnonce'] ), 'bp_blog_signup_form' ) || ! $current_user->ID ) {
     1250        return new WP_Error( 'bp_blogs_doing_it_wrong', __( 'Sorry, we cannot create the site. Please try again later.', 'buddypress' ) );
     1251    }
     1252
     1253    $submitted_vars = bp_blogs_get_signup_form_submitted_vars();
     1254
     1255    if ( array_filter( $submitted_vars ) ) {
     1256        $blog_name  = $submitted_vars['blogname'];
     1257        $blog_title = $submitted_vars['blog_title'];
     1258        $public     = (int) $submitted_vars['blog_public'];
     1259    }
     1260
     1261    $blog = bp_blogs_validate_blog_form( $blog_name, $blog_title );
     1262
     1263    if ( is_wp_error( $blog['errors'] ) && $blog['errors']->get_error_code() ) {
     1264        return $blog['errors'];
     1265    }
    12101266
    12111267    /**
     
    12191275     * }
    12201276     */
    1221     $meta = apply_filters( 'add_signup_meta', $meta );
    1222 
    1223     // If this is a subdomain install, set up the site inside the root domain.
    1224     if ( is_subdomain_install() )
    1225         $domain = $blogname . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
    1226 
    1227     $blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
    1228     bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta, $blog_id );
    1229     return true;
    1230 }
    1231 
    1232 /**
    1233  * Validate a blog creation submission.
    1234  *
    1235  * Essentially, a wrapper for {@link wpmu_validate_blog_signup()}.
    1236  *
    1237  * @return array Contains the new site data and error messages.
    1238  */
    1239 function bp_blogs_validate_blog_form() {
    1240     $user = '';
    1241     if ( is_user_logged_in() )
    1242         $user = wp_get_current_user();
    1243 
    1244     return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
     1277    $meta = apply_filters( 'add_signup_meta', array( 'lang_id' => 1, 'public' => $public ) );
     1278
     1279    return wpmu_create_blog(
     1280        $blog['domain'],
     1281        $blog['path'],
     1282        $blog['blog_title'],
     1283        $current_user->ID, $meta,
     1284        $current_site->id
     1285    );
    12451286}
    12461287
     
    12481289 * Display a message after successful blog registration.
    12491290 *
     1291 * @since 1.0.0
    12501292 * @since 2.6.0 Introduced `$blog_id` parameter.
    12511293 *
     
    12651307
    12661308    ?>
    1267     <p><?php _e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
     1309    <p class="success"><?php esc_html_e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
    12681310    <p>
    12691311        <?php printf(
     
    12901332     * @since 1.0.0
    12911333     */
    1292     do_action('signup_finished');
     1334    do_action( 'signup_finished' );
    12931335}
    12941336
  • trunk/src/bp-templates/bp-legacy/buddypress/blogs/create.php

    r12082 r12734  
    1515do_action( 'bp_before_create_blog_content_template' ); ?>
    1616
    17 <div id="template-notices" role="alert" aria-atomic="true">
     17<div id="buddypress">
     18
     19    <div id="template-notices" role="alert" aria-atomic="true">
     20        <?php
     21
     22        /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
     23        do_action( 'template_notices' ); ?>
     24
     25    </div>
     26
    1827    <?php
    1928
    20     /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
    21     do_action( 'template_notices' ); ?>
     29    /**
     30     * Fires before the display of the blog creation form.
     31     *
     32     * @since 1.1.0
     33     */
     34    do_action( 'bp_before_create_blog_content' ); ?>
     35
     36    <?php if ( bp_blog_signup_enabled() ) : ?>
     37
     38        <?php bp_show_blog_signup_form(); ?>
     39
     40    <?php else: ?>
     41
     42        <div id="message" class="info">
     43            <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
     44        </div>
     45
     46    <?php endif; ?>
     47
     48    <?php
     49
     50    /**
     51     * Fires after the display of the blog creation form.
     52     *
     53     * @since 1.1.0
     54     */
     55    do_action( 'bp_after_create_blog_content' ); ?>
    2256
    2357</div>
    24 
    25 <?php
    26 
    27 /**
    28  * Fires before the display of the blog creation form.
    29  *
    30  * @since 1.1.0
    31  */
    32 do_action( 'bp_before_create_blog_content' ); ?>
    33 
    34 <?php if ( bp_blog_signup_enabled() ) : ?>
    35 
    36     <?php bp_show_blog_signup_form(); ?>
    37 
    38 <?php else: ?>
    39 
    40     <div id="message" class="info">
    41         <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
    42     </div>
    43 
    44 <?php endif; ?>
    45 
    46 <?php
    47 
    48 /**
    49  * Fires after the display of the blog creation form.
    50  *
    51  * @since 1.1.0
    52  */
    53 do_action( 'bp_after_create_blog_content' ); ?>
    5458
    5559<?php
  • trunk/src/bp-templates/bp-legacy/css/buddypress-rtl.css

    r12415 r12734  
    732732    display: block;
    733733    margin-bottom: -1em;
     734}
     735
     736body.create-blog #buddypress .error {
     737    background-color: #fdc;
     738    border: 1px solid #a00;
     739    color: #800;
     740    padding: 10px 15px;
     741}
     742
     743body.create-blog #buddypress .success {
     744    background-color: #efc;
     745    border: 1px solid #591;
     746    color: #250;
     747    padding: 10px 15px;
    734748}
    735749
  • trunk/src/bp-templates/bp-legacy/css/buddypress.css

    r12415 r12734  
    732732    display: block;
    733733    margin-bottom: -1em;
     734}
     735
     736body.create-blog #buddypress .error {
     737    background-color: #fdc;
     738    border: 1px solid #a00;
     739    color: #800;
     740    padding: 10px 15px;
     741}
     742
     743body.create-blog #buddypress .success {
     744    background-color: #efc;
     745    border: 1px solid #591;
     746    color: #250;
     747    padding: 10px 15px;
    734748}
    735749
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss

    r12397 r12734  
    11// Sitewide template error & info messages constructs.
    2 // @version 3.0.0.
     2// @since 3.0.0.
     3// @version 7.0.0
    34.buddypress-wrap {
    45
     
    318319
    319320} // close .buddypress-wrap
     321
     322body.create-blog {
     323
     324    #buddypress {
     325
     326        .error,
     327        .success {
     328
     329            @include message-box($border: none);
     330            @include box-shadow( 0 1px 1px 1px rgba(0, 0, 0, 0.1) );
     331            color: $light-text-plus;
     332            padding: 10px 15px;
     333            background-color: $white;
     334        }
     335
     336        .error {
     337            border-left: 4px solid $warnings;
     338        }
     339
     340        .success {
     341            border-left: 4px solid $update-success;
     342
     343        }
     344    }
     345}
  • trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    r12571 r12734  
    45724572}
    45734573
     4574body.create-blog #buddypress .error,
     4575body.create-blog #buddypress .success {
     4576    background: #fff;
     4577    color: #807f7f;
     4578    box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
     4579    color: #737373;
     4580    padding: 10px 15px;
     4581    background-color: #fff;
     4582}
     4583
     4584body.create-blog #buddypress .error {
     4585    border-right: 4px solid #d33;
     4586}
     4587
     4588body.create-blog #buddypress .success {
     4589    border-right: 4px solid #8a2;
     4590}
     4591
    45744592.buddypress.widget .item-options {
    45754593    font-size: 12px;
  • trunk/src/bp-templates/bp-nouveau/css/buddypress.css

    r12571 r12734  
    45724572}
    45734573
     4574body.create-blog #buddypress .error,
     4575body.create-blog #buddypress .success {
     4576    background: #fff;
     4577    color: #807f7f;
     4578    box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
     4579    color: #737373;
     4580    padding: 10px 15px;
     4581    background-color: #fff;
     4582}
     4583
     4584body.create-blog #buddypress .error {
     4585    border-left: 4px solid #d33;
     4586}
     4587
     4588body.create-blog #buddypress .success {
     4589    border-left: 4px solid #8a2;
     4590}
     4591
    45744592.buddypress.widget .item-options {
    45754593    font-size: 12px;
Note: See TracChangeset for help on using the changeset viewer.