Esempio n. 1
0
/**
 * Output the input fields for the blog creation form.
 *
 * @param string          $blogname   Optional. The default blog name (path or domain).
 * @param string          $blog_title Optional. The default blog title.
 * @param string|WP_Error $errors     Optional. The WP_Error object returned by a previous
 *                                    submission attempt.
 */
function bp_blogs_signup_blog($blogname = '', $blog_title = '', $errors = '')
{
    global $current_site;
    // Blog name
    if (!is_subdomain_install()) {
        echo '<label for="blogname">' . __('Site Name:', 'buddypress') . '</label>';
    } else {
        echo '<label for="blogname">' . __('Site Domain:', 'buddypress') . '</label>';
    }
    if ($errmsg = $errors->get_error_message('blogname')) {
        ?>

		<p class="error"><?php 
        echo $errmsg;
        ?>
</p>

	<?php 
    }
    if (!is_subdomain_install()) {
        echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="' . $blogname . '" maxlength="63" /><br />';
    } else {
        echo '<input name="blogname" type="text" id="blogname" value="' . $blogname . '" maxlength="63" ' . bp_get_form_field_attributes('blogname') . '/> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
    }
    if (!is_user_logged_in()) {
        print '(<strong>' . __('Your address will be ', 'buddypress');
        if (!is_subdomain_install()) {
            print $current_site->domain . $current_site->path . __('blogname', 'buddypress');
        } else {
            print __('domain.', 'buddypress') . $current_site->domain . $current_site->path;
        }
        echo '.</strong> ' . __('Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)', 'buddypress') . '</p>';
    }
    // Blog Title
    ?>

	<label for="blog_title"><?php 
    _e('Site Title:', 'buddypress');
    ?>
</label>

	<?php 
    if ($errmsg = $errors->get_error_message('blog_title')) {
        ?>

		<p class="error"><?php 
        echo $errmsg;
        ?>
</p>

	<?php 
    }
    echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_html($blog_title, 1) . '" /></p>';
    ?>

	<p>
		<label for="blog_public_on"><?php 
    _e('Privacy:', 'buddypress');
    ?>
</label>
		<?php 
    _e('I would like my site to appear in search engines, and in public listings around this network.', 'buddypress');
    ?>

		<label class="checkbox" for="blog_public_on">
			<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 
    }
    ?>
 />
			<strong><?php 
    _e('Yes', 'buddypress');
    ?>
</strong>
		</label>
		<label class="checkbox" for="blog_public_off">
			<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 
    }
    ?>
 />
			<strong><?php 
    _e('No', 'buddypress');
    ?>
</strong>
		</label>
	</p>

	<?php 
    /**
     * Fires at the end of all of the default input fields for blog creation form.
     *
     * @since BuddyPress (1.0.0)
     *
     * @param WP_Error $errors WP_Error object if any present.
     */
    do_action('signup_blogform', $errors);
}
Esempio n. 2
0
/**
 * Echo the value of bp_blogs_get_subdomain_base()
 *
 * @since 1.6
 */
function bp_blogs_subdomain_base()
{
    echo bp_blogs_get_subdomain_base();
}