当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_get_signup_allowed函数代码示例

本文整理汇总了PHP中bp_get_signup_allowed函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_signup_allowed函数的具体用法?PHP bp_get_signup_allowed怎么用?PHP bp_get_signup_allowed使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bp_get_signup_allowed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bp_members_admin_bar_my_account_menu

/**
 * Add the "My Account" menu and all submenus.
 *
 * @since BuddyPress (r4151)
 */
function bp_members_admin_bar_my_account_menu()
{
    global $bp, $wp_admin_bar;
    // Bail if this is an ajax request
    if (defined('DOING_AJAX')) {
        return;
    }
    // Logged in user
    if (is_user_logged_in()) {
        // User avatar
        $avatar = bp_core_fetch_avatar(array('item_id' => $bp->loggedin_user->id, 'email' => $bp->loggedin_user->userdata->user_email, 'width' => 16, 'height' => 16));
        // Unique ID for the 'My Account' menu
        $bp->my_account_menu_id = !empty($avatar) ? 'my-account-with-avatar' : 'my-account';
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'title' => $avatar . bp_get_loggedin_user_fullname(), 'href' => $bp->loggedin_user->domain));
        // Show login and sign-up links
    } elseif (!empty($wp_admin_bar)) {
        add_filter('show_admin_bar', '__return_true');
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url()));
        // Sign up
        if (bp_get_signup_allowed()) {
            $wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
        }
    }
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:31,代码来源:bp-members-adminbar.php

示例2: bp_members_admin_bar_my_account_menu

/**
 * Add the "My Account" menu and all submenus.
 *
 * @since 1.6.0
 *
 * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support
 */
function bp_members_admin_bar_my_account_menu()
{
    global $wp_admin_bar;
    // Bail if this is an ajax request
    if (defined('DOING_AJAX')) {
        return;
    }
    // Logged in user
    if (is_user_logged_in()) {
        $bp = buddypress();
        // Stored in the global so we can add menus easily later on
        $bp->my_account_menu_id = 'my-account-buddypress';
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'group' => true, 'title' => __('Edit My Profile', 'buddypress'), 'href' => bp_loggedin_user_domain(), 'meta' => array('class' => 'ab-sub-secondary')));
        // Show login and sign-up links
    } elseif (!empty($wp_admin_bar)) {
        add_filter('show_admin_bar', '__return_true');
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url(bp_get_requested_url())));
        // Sign up
        if (bp_get_signup_allowed()) {
            $wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
        }
    }
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:32,代码来源:bp-members-adminbar.php

示例3: bp_adminbar_login_menu

function bp_adminbar_login_menu() {
	global $bp;

	if ( is_user_logged_in() )
		return false;

	echo '<li class="bp-login no-arrow"><a href="' . $bp->root_domain . '/wp-login.php?redirect_to=' . urlencode( $bp->root_domain ) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';

	// Show "Sign Up" link if user registrations are allowed
	if ( bp_get_signup_allowed() )
		echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
}
开发者ID:n-sane,项目名称:zaroka,代码行数:12,代码来源:bp-core-adminbar.php

示例4: bp_members_admin_bar_my_account_menu

/**
 * Add the "My Account" menu and all submenus.
 *
 * @since BuddyPress (r4151)
 * @todo Deprecate WP 3.2 admin bar compatibility when we drop 3.2 support
 */
function bp_members_admin_bar_my_account_menu()
{
    global $bp, $wp_admin_bar, $wp_version;
    // Bail if this is an ajax request
    if (defined('DOING_AJAX')) {
        return;
    }
    // Logged in user
    if (is_user_logged_in()) {
        // User avatar
        $avatar = bp_core_fetch_avatar(array('item_id' => bp_loggedin_user_id(), 'email' => $bp->loggedin_user->userdata->user_email, 'width' => 16, 'height' => 16));
        // Some admin bar setup in WP 3.2 differs from WP 3.3+.
        // Backward-compatibility will be deprecated at some point.
        if (version_compare((double) $wp_version, '3.3', '>=')) {
            // Stored in the global so we can add menus easily later on
            $bp->my_account_menu_id = 'my-account-buddypress';
            $title = bp_get_loggedin_user_fullname() . $avatar;
            $class = 'opposite';
            if (!empty($avatar)) {
                $class .= ' with-avatar';
            }
            $meta = array('class' => $class);
        } else {
            $bp->my_account_menu_id = !empty($avatar) ? 'my-account-with-avatar' : 'my-account';
            $title = $avatar . bp_get_loggedin_user_fullname();
            $meta = array();
        }
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'title' => $title, 'href' => $bp->loggedin_user->domain, 'meta' => $meta));
        // Show login and sign-up links
    } elseif (!empty($wp_admin_bar)) {
        add_filter('show_admin_bar', '__return_true');
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url()));
        // Sign up
        if (bp_get_signup_allowed()) {
            $wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
        }
    }
}
开发者ID:newington,项目名称:buddypress,代码行数:46,代码来源:bp-members-adminbar.php

示例5: widget

 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     echo $before_widget;
     // set widget title when logged out
     if (!is_user_logged_in()) {
         $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
         if (!empty($title)) {
             echo $before_title . $title . $after_title;
         }
     }
     // start widget display code
     if (function_exists('bp_is_active')) {
         // check is user is logged in
         if (is_user_logged_in()) {
             echo "<div id='sidebarme'>";
             echo "<a href='" . bp_loggedin_user_domain() . "'>";
             echo bp_loggedin_user_avatar('type=thumb');
             echo "</a>";
             echo "<ul class='sidebarme-quicklinks'>";
             echo "<li class='sidebarme-username'>" . bp_core_get_userlink(bp_loggedin_user_id()) . "</li>";
             echo "<li class='sidebarme-profile'>";
             echo "<a href='" . bp_loggedin_user_domain() . "profile/edit'>" . __('Edit Profile', 'boss') . "</a>";
             echo " &middot; ";
             echo wp_loginout();
             echo "</li>";
             echo "</ul>";
             echo "</div>";
             // check if user is logged out
         } else {
             echo "<form name='login-form' id='sidebar-login-form' class='standard-form' action='" . site_url('wp-login.php', 'login_post') . "' method='post'>";
             echo "<label>" . __('Username', 'boss') . "</label>";
             $return = isset($_POST['value']) ? $_POST['value'] : '';
             $return .= "<input type='text' name='log' id='sidebar-user-login' class='input' value='";
             if (isset($user_login)) {
                 $return .= esc_attr(stripslashes($user_login));
             }
             $return .= "' tabindex='97' />";
             echo $return;
             echo "<label>" . __('Password', 'boss') . "</label>";
             echo "<input type='password' name='pwd' id='sidebar-user-pass' class='input' value='' tabindex='98' />";
             echo "<p class='forgetmenot'><input name='rememberme' type='checkbox' id='sidebar-rememberme' value='forever' tabindex='99' /> " . __('Remember Me', 'boss') . "</p>";
             echo do_action('bp_sidebar_login_form');
             echo "<input type='submit' name='wp-submit' id='sidebar-wp-submit' value='" . __('Log In', 'boss') . "' tabindex='100' />";
             if (bp_get_signup_allowed()) {
                 echo " <a class='sidebar-wp-register' href='" . bp_get_signup_page() . "'>" . __('Register', 'boss') . "</a>";
             }
             echo "</form>";
         }
     }
     // end widget display code
     echo $after_widget;
 }
开发者ID:tvolmari,项目名称:hammydowns,代码行数:53,代码来源:buddyboss-profile-widget-loader.php

示例6: do_action

    ?>

	<?php 
} else {
    ?>

		<?php 
    do_action('bp_before_sidebar_login_form');
    ?>

		<p id="login-text">
			<?php 
    _e('To start connecting please log in first.', 'buddypress');
    ?>
			<?php 
    if (bp_get_signup_allowed()) {
        ?>
				<?php 
        printf(__(' You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress'), site_url(BP_REGISTER_SLUG . '/'));
        ?>
			<?php 
    }
    ?>
		</p>

		<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php 
    echo site_url('wp-login.php', 'login_post');
    ?>
" method="post">
			<label><?php 
    _e('Username', 'buddypress');
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:31,代码来源:header.php

示例7: bp_core_add_page_mappings

/**
 * Creates necessary directory pages.
 *
 * Directory pages are those WordPress pages used by BP components to display
 * content (eg, the 'groups' page created by BP).
 *
 * @since BuddyPress (1.7.0)
 *
 * @param array $components Components to create pages for.
 * @param string $existing 'delete' if you want to delete existing page
 *        mappings and replace with new ones. Otherwise existing page mappings
 *        are kept, and the gaps filled in with new pages. Default: 'keep'.
 */
function bp_core_add_page_mappings($components, $existing = 'keep')
{
    // If no value is passed, there's nothing to do.
    if (empty($components)) {
        return;
    }
    // Make sure that the pages are created on the root blog no matter which
    // dashboard the setup is being run on.
    if (!bp_is_root_blog()) {
        switch_to_blog(bp_get_root_blog_id());
    }
    $pages = bp_core_get_directory_page_ids('all');
    // Delete any existing pages
    if ('delete' === $existing) {
        foreach ((array) $pages as $page_id) {
            wp_delete_post($page_id, true);
        }
        $pages = array();
    }
    $page_titles = array('activity' => _x('Activity', 'Page title for the Activity directory.', 'buddypress'), 'groups' => _x('Groups', 'Page title for the Groups directory.', 'buddypress'), 'sites' => _x('Sites', 'Page title for the Sites directory.', 'buddypress'), 'members' => _x('Members', 'Page title for the Members directory.', 'buddypress'), 'activate' => _x('Activate', 'Page title for the user activation screen.', 'buddypress'), 'register' => _x('Register', 'Page title for the user registration screen.', 'buddypress'));
    $pages_to_create = array();
    foreach (array_keys($components) as $component_name) {
        if (!isset($pages[$component_name]) && isset($page_titles[$component_name])) {
            $pages_to_create[$component_name] = $page_titles[$component_name];
        }
    }
    // Register and Activate are not components, but need pages when
    // registration is enabled
    if (bp_get_signup_allowed()) {
        foreach (array('register', 'activate') as $slug) {
            if (!isset($pages[$slug])) {
                $pages_to_create[$slug] = $page_titles[$slug];
            }
        }
    }
    // No need for a Sites directory unless we're on multisite
    if (!is_multisite() && isset($pages_to_create['sites'])) {
        unset($pages_to_create['sites']);
    }
    // Members must always have a page, no matter what
    if (!isset($pages['members']) && !isset($pages_to_create['members'])) {
        $pages_to_create['members'] = $page_titles['members'];
    }
    // Create the pages
    foreach ($pages_to_create as $component_name => $page_name) {
        $exists = get_page_by_path($component_name);
        // If page already exists, use it
        if (!empty($exists)) {
            $pages[$component_name] = $exists->ID;
        } else {
            $pages[$component_name] = wp_insert_post(array('comment_status' => 'closed', 'ping_status' => 'closed', 'post_status' => 'publish', 'post_title' => $page_name, 'post_type' => 'page'));
        }
    }
    // Save the page mapping
    bp_update_option('bp-pages', $pages);
    // If we had to switch_to_blog, go back to the original site.
    if (!bp_is_root_blog()) {
        restore_current_blog();
    }
}
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:73,代码来源:bp-core-functions.php

示例8: no_items

	/**
	 * The text shown when no items are found.
	 *
	 * Nice job, clean sheet!
	 *
	 * @since BuddyPress (2.0.0)
	 */
	public function no_items() {
		if ( bp_get_signup_allowed() ) {
			esc_html_e( 'No pending accounts found.', 'buddypress' );
		} else {
			$link = false;

			if ( current_user_can( 'manage_network_users' ) ) {
				$link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( network_admin_url( 'settings.php' ) ), esc_html__( 'Edit settings', 'buddypress' ) );
			}

			printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
		}
	}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:20,代码来源:bp-members-classes.php

示例9: _e

                          <?php 
    _e('<strong>Reset password!</strong> A message will be sent to your email address.', 'cactusthemes');
    ?>
                        </div>
                      <?php 
}
?>
                    <?php 
$largs = array('echo' => true, 'redirect' => ot_get_option('login_redirect') ? get_permalink(ot_get_option('login_redirect')) : site_url(), 'form_id' => 'loginform', 'label_username' => __('Username', 'cactusthemes'), 'label_password' => __('Password', 'cactusthemes'), 'label_remember' => __('Remember Me', 'cactusthemes'), 'label_log_in' => __('Log In', 'cactusthemes'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'remember' => true, 'value_username' => NULL, 'value_remember' => false);
?>
                    <div class="row"><div class="col-md-8">
                    <?php 
wp_login_form($largs);
?>
						<?php 
if (function_exists('bp_get_signup_allowed') && bp_get_signup_allowed()) {
    ?>
                            <?php 
    printf(__('<a href="%s" title="Register for a new account">Register</a>', 'buddypress'), bp_get_signup_page());
    ?>
                        <?php 
}
?>
                    </div></div>
                    <div class="clear"></div>
					<?php 
//content
if (have_posts()) {
    while (have_posts()) {
        the_post();
        get_template_part('content', 'single');
开发者ID:aljeicks,项目名称:streamtube,代码行数:31,代码来源:tpl-login.php

示例10: widget

    /**
     * Display the login widget.
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    public function widget($args, $instance)
    {
        $title = isset($instance['title']) ? $instance['title'] : '';
        $title = apply_filters('widget_title', $title);
        echo $args['before_widget'];
        echo $args['before_title'] . esc_html($title) . $args['after_title'];
        ?>

		<?php 
        if (is_user_logged_in()) {
            ?>

			<?php 
            do_action('bp_before_login_widget_loggedin');
            ?>

			<div class="bp-login-widget-user-avatar">
				<a href="<?php 
            echo bp_loggedin_user_domain();
            ?>
">
					<?php 
            bp_loggedin_user_avatar('type=thumb&width=50&height=50');
            ?>
				</a>
			</div>

			<div class="bp-login-widget-user-links">
				<div class="bp-login-widget-user-link"><?php 
            echo bp_core_get_userlink(bp_loggedin_user_id());
            ?>
</div>
				<div class="bp-login-widget-user-logout"><a class="logout" href="<?php 
            echo wp_logout_url(bp_get_requested_url());
            ?>
"><?php 
            _e('Log Out', 'buddypress');
            ?>
</a></div>
			</div>

			<?php 
            do_action('bp_after_login_widget_loggedin');
            ?>

		<?php 
        } else {
            ?>

			<?php 
            do_action('bp_before_login_widget_loggedout');
            ?>

			<form name="bp-login-form" id="bp-login-widget-form" class="standard-form" action="<?php 
            echo esc_url(site_url('wp-login.php', 'login_post'));
            ?>
" method="post">
				<label for="bp-login-widget-user-login"><?php 
            _e('Username', 'buddypress');
            ?>
</label>
				<input type="text" name="log" id="bp-login-widget-user-login" class="input" value="" />

				<label for="bp-login-widget-user-pass"><?php 
            _e('Password', 'buddypress');
            ?>
</label>
				<input type="password" name="pwd" id="bp-login-widget-user-pass" class="input" value=""  />

				<div class="forgetmenot"><label><input name="rememberme" type="checkbox" id="bp-login-widget-rememberme" value="forever" /> <?php 
            _e('Remember Me', 'buddypress');
            ?>
</label></div>

				<input type="submit" name="wp-submit" id="bp-login-widget-submit" value="<?php 
            esc_attr_e('Log In', 'buddypress');
            ?>
" />

				<?php 
            if (bp_get_signup_allowed()) {
                ?>

					<span class="bp-login-widget-register-link"><?php 
                printf(__('<a href="%s" title="Register for a new account">Register</a>', 'buddypress'), bp_get_signup_page());
                ?>
</span>

				<?php 
            }
            ?>

//.........这里部分代码省略.........
开发者ID:eresyyl,项目名称:mk,代码行数:101,代码来源:bp-core-widgets.php

示例11: bp_core_admin_slugs_options


//.........这里部分代码省略.........


				<?php 
        }
        ?>

				<?php 
        /**
         * Fires after the display of default directories.
         *
         * Allows plugins to add their own directory associations.
         *
         * @since 1.5.0
         */
        do_action('bp_active_external_directories');
        ?>

			</tbody>
		</table>

	<?php 
    }
    /** Static Display ********************************************************/
    $static_pages = bp_core_admin_get_static_pages();
    if (!empty($static_pages)) {
        ?>

		<h3><?php 
        _e('Registration', 'buddypress');
        ?>
</h3>

		<?php 
        if (bp_get_signup_allowed()) {
            ?>
			<p><?php 
            _e('Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress');
            ?>
</p>
		<?php 
        } else {
            ?>
			<?php 
            if (is_multisite()) {
                ?>
				<p><?php 
                printf(__('Registration is currently disabled.  Before associating a page is allowed, please enable registration by selecting either the "User accounts may be registered" or "Both sites and user accounts can be registered" option on <a href="%s">this page</a>.', 'buddypress'), network_admin_url('settings.php'));
                ?>
</p>
			<?php 
            } else {
                ?>
				<p><?php 
                printf(__('Registration is currently disabled.  Before associating a page is allowed, please enable registration by clicking on the "Anyone can register" checkbox on <a href="%s">this page</a>.', 'buddypress'), admin_url('options-general.php'));
                ?>
</p>
			<?php 
            }
            ?>
		<?php 
        }
        ?>

		<table class="form-table">
			<tbody>
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:66,代码来源:bp-core-admin-slugs.php

示例12: metabox_registration

    function metabox_registration()
    {
        if (!bp_get_signup_allowed()) {
            echo '<p>' . __('Registration is currently disabled', 'genesis-connect') . '</p>';
            foreach (array('custom_register', 'register_slug', 'register_title', 'register_time') as $field) {
                echo '<input type="hidden" name="' . $this->theme->settings_key . '[' . $field . ']" value="' . $this->get_option($field) . '" />';
            }
            return;
        }
        $custom_register = $this->get_option('custom_register');
        ?>
			<p><?php 
        _e('Custom Registration Permalink:', 'genesis-connect');
        ?>
			<select name="<?php 
        echo $this->theme->settings_key;
        ?>
[custom_register]">
				<option style="padding-right:10px;" value="none" <?php 
        selected('none', $custom_register);
        ?>
><?php 
        _e('None', 'genesis-connect');
        ?>
</option>
				<option style="padding-right:10px;" value="before_pages" <?php 
        selected('before_pages', $custom_register);
        ?>
><?php 
        _e('Before Pages', 'genesis-connect');
        ?>
</option>
				<option style="padding-right:10px;" value="after_pages" <?php 
        selected('after_pages', $custom_register);
        ?>
><?php 
        _e('After Pages', 'genesis-connect');
        ?>
</option>
				<option style="padding-right:10px;" value="adminbar" <?php 
        selected('adminbar', $custom_register);
        ?>
><?php 
        _e('On the Adminbar', 'genesis-connect');
        ?>
</option>
			</select></p>
			<small><strong><?php 
        _e('Using the custom registration disables the default BuddyPress registration page', 'genesis-connect');
        ?>
</strong></small></p>
			<p><?php 
        _e('Custom Permalink:', 'genesis-connect');
        ?>
<br />
			<input type="text" name="<?php 
        echo $this->theme->settings_key;
        ?>
[register_slug]" value="<?php 
        echo esc_attr($this->get_option('register_slug'));
        ?>
" size="40" /><br />
			<small><strong><?php 
        printf(__("Don't include the %s", 'genesis-connect'), get_option('siteurl'));
        ?>
</strong></small></p>

			<p><?php 
        _e("Custom Title:", 'genesis-connect');
        ?>
<br />
			<input type="text" name="<?php 
        echo $this->theme->settings_key;
        ?>
[register_title]" value="<?php 
        echo esc_attr($this->get_option('register_title'));
        ?>
" size="40" /><br />
			<small><strong><?php 
        _e("The title for the link", 'genesis-connect');
        ?>
</strong></small></p>

			<p><?php 
        _e("Registration Time:", 'genesis-connect');
        ?>
<br />
			<input type="text" name="<?php 
        echo $this->theme->settings_key;
        ?>
[register_time]" value="<?php 
        echo esc_attr($this->get_option('register_time'));
        ?>
" size="5" /><br />
			<small><strong><?php 
        _e("Minimum number of seconds for a human signup", 'genesis-connect');
        ?>
</strong></small></p>
<?php 
    }
开发者ID:hscale,项目名称:webento,代码行数:100,代码来源:class.options.php

示例13: wp_list_pages

 function wp_list_pages($menu)
 {
     if ($this->theme->is_home() && bp_get_signup_allowed() && !empty($this->visitor)) {
         if ('before_pages' == $this->visitor->get_register()) {
             $menu = rabp_genesis_get_bp_signup() . $menu;
         } elseif ('after_pages' == $this->visitor->get_register()) {
             $menu .= rabp_genesis_get_bp_signup();
         }
     }
     return $menu;
 }
开发者ID:hscale,项目名称:webento,代码行数:11,代码来源:class.front.php

示例14: bp_core_screen_signup

function bp_core_screen_signup() {
	global $bp, $wpdb;

	if ( $bp->current_component != BP_REGISTER_SLUG )
		return false;

	/* If the user is logged in, redirect away from here */
	if ( is_user_logged_in() )
		bp_core_redirect( $bp->root_domain );

	/* If signups are disabled, just re-direct */
	if ( !bp_get_signup_allowed() )
		bp_core_redirect( $bp->root_domain );

	$bp->signup->step = 'request-details';

	/* If the signup page is submitted, validate and save */
	if ( isset( $_POST['signup_submit'] ) ) {

		/* Check the nonce */
		check_admin_referer( 'bp_new_signup' );

		require_once( ABSPATH . WPINC . '/registration.php' );

		/* Check the base account details for problems */
		$account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] );

		/* If there are errors with account details, set them for display */
		if ( !empty( $account_details['errors']->errors['user_name'] ) )
			$bp->signup->errors['signup_username'] = $account_details['errors']->errors['user_name'][0];

		if ( !empty( $account_details['errors']->errors['user_email'] ) )
			$bp->signup->errors['signup_email'] = $account_details['errors']->errors['user_email'][0];

		/* Check that both password fields are filled in */
		if ( empty( $_POST['signup_password'] ) || empty( $_POST['signup_password_confirm'] ) )
			$bp->signup->errors['signup_password'] = __( 'Please make sure you enter your password twice', 'buddypress' );

		/* Check that the passwords match */
		if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] )
			$bp->signup->errors['signup_password'] = __( 'The passwords you entered do not match.', 'buddypress' );

		$bp->signup->username = $_POST['signup_username'];
		$bp->signup->email = $_POST['signup_email'];

		/* Now we've checked account details, we can check profile information */
		if ( function_exists( 'xprofile_check_is_required_field' ) ) {

			/* Make sure hidden field is passed and populated */
			if ( isset( $_POST['signup_profile_field_ids'] ) && !empty( $_POST['signup_profile_field_ids'] ) ) {

				/* Let's compact any profile field info into an array */
				$profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );

				/* Loop through the posted fields formatting any datebox values then validate the field */
				foreach ( (array) $profile_field_ids as $field_id ) {
					if ( !isset( $_POST['field_' . $field_id] ) ) {
						if ( isset( $_POST['field_' . $field_id . '_day'] ) )
							$_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] );
					}

					/* Create errors for required fields without values */
					if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) )
						$bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );
				}

			/* This situation doesn't naturally occur so bounce to website root */
			} else {
				bp_core_redirect( $bp->root_domain );
			}
		}

		/* Finally, let's check the blog details, if the user wants a blog and blog creation is enabled */
		if ( isset( $_POST['signup_with_blog'] ) ) {
			$active_signup = $bp->site_options['registration'];

			if ( 'blog' == $active_signup || 'all' == $active_signup ) {
				$blog_details = bp_core_validate_blog_signup( $_POST['signup_blog_url'], $_POST['signup_blog_title'] );

				/* If there are errors with blog details, set them for display */
				if ( !empty( $blog_details['errors']->errors['blogname'] ) )
					$bp->signup->errors['signup_blog_url'] = $blog_details['errors']->errors['blogname'][0];

				if ( !empty( $blog_details['errors']->errors['blog_title'] ) )
					$bp->signup->errors['signup_blog_title'] = $blog_details['errors']->errors['blog_title'][0];
			}
		}

		do_action( 'bp_signup_validate' );

		/* Add any errors to the action for the field in the template for display. */
		if ( !empty( $bp->signup->errors ) ) {
			foreach ( (array)$bp->signup->errors as $fieldname => $error_message )
				add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo "<div class=\"error\">' . $error_message . '</div>";' ) );
		} else {
			$bp->signup->step = 'save-details';

			/* No errors! Let's register those deets. */
			$active_signup = $bp->site_options['registration'];

//.........这里部分代码省略.........
开发者ID:n-sane,项目名称:zaroka,代码行数:101,代码来源:bp-core-signup.php

示例15: do_action

			<?php do_action( 'bp_sidebar_me' ) ?>
		</div>

		<?php do_action( 'bp_after_sidebar_me' ) ?>

		<?php if ( function_exists( 'bp_message_get_notices' ) ) : ?>
			<?php bp_message_get_notices(); /* Site wide notices to all users */ ?>
		<?php endif; ?>

	<?php else : ?>

		<?php do_action( 'bp_before_sidebar_login_form' ) ?>

		<p id="login-text">
			<?php _e( 'To start connecting please log in first.', 'buddypress' ) ?>
			<?php if ( bp_get_signup_allowed() ) : ?>
				<?php printf( __( ' You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
			<?php endif; ?>
		</p>

		<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
			<label><?php _e( 'Username', 'buddypress' ) ?><br />
			<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label>

			<label><?php _e( 'Password', 'buddypress' ) ?><br />
			<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label>

			<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p>

			<?php do_action( 'bp_sidebar_login_form' ) ?>
			<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
开发者ID:r-chopra17,项目名称:bp-twentyten,代码行数:31,代码来源:sidebar.php


注:本文中的bp_get_signup_allowed函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。