• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_get_signup_allowed函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: bp_adminbar_menus

 function bp_adminbar_menus()
 {
     global $bp;
     if ($this->get_option('login_adminbar')) {
         echo '<li class="bp-login no-arrow"><a href="' . site_url('wp-login.php', 'login') . '?redirect_to=' . urlencode($bp->root_domain) . '">' . __('Log In', 'buddypress') . '</a></li>';
     }
     if (bp_get_signup_allowed() && 'adminbar' == $this->register) {
         $signup = $this->signup_url();
         if (strlen($signup) > 3) {
             echo substr($signup, 0, 3) . ' class="bp-signup no-arrow"' . substr($signup, 3);
         }
     }
     remove_action('bp_adminbar_menus', 'bp_adminbar_login_menu', 2);
 }
开发者ID:hscale,项目名称:webento,代码行数:14,代码来源:class.visitor.php


示例17: widget


//.........这里部分代码省略.........
                }
                ?>
						</li>
					</ul>
					<ul>
						<?php 
                $loggedin_menu = array('courses' => array('icon' => 'icon-book-open-1', 'label' => __('Courses', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_COURSE_SLUG), 'stats' => array('icon' => 'icon-analytics-chart-graph', 'label' => __('Stats', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_COURSE_SLUG . '/' . BP_COURSE_STATS_SLUG));
                if (bp_is_active('messages')) {
                    $loggedin_menu['messages'] = array('icon' => 'icon-letter-mail-1', 'label' => __('Inbox', 'vibe') . (messages_get_unread_count() ? ' <span>' . messages_get_unread_count() . '</span>' : ''), 'link' => bp_loggedin_user_domain() . BP_MESSAGES_SLUG);
                    $n = vbp_current_user_notification_count();
                    $loggedin_menu['notifications'] = array('icon' => 'icon-exclamation', 'label' => __('Notifications', 'vibe') . ($n ? ' <span>' . $n . '</span>' : ''), 'link' => bp_loggedin_user_domain() . BP_NOTIFICATIONS_SLUG);
                }
                if (bp_is_active('groups')) {
                    $loggedin_menu['groups'] = array('icon' => 'icon-myspace-alt', 'label' => __('Groups', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_GROUPS_SLUG);
                }
                $loggedin_menu['settings'] = array('icon' => 'icon-settings', 'label' => __('Settings', 'vibe'), 'link' => bp_loggedin_user_domain() . BP_SETTINGS_SLUG);
                $loggedin_menu = apply_filters('wplms_logged_in_top_menu', $loggedin_menu);
                foreach ($loggedin_menu as $item) {
                    echo '<li><a href="' . $item['link'] . '"><i class="' . $item['icon'] . '"></i>' . $item['label'] . '</a></li>';
                }
                ?>
					</ul>

					<?php 
                do_action('bp_sidebar_me');
                ?>
				</div>
				<?php 
                do_action('bp_after_sidebar_me');
                /***** If the user is not logged in, show the log form and account creation link *****/
            } else {
                if (!isset($user_login)) {
                    $user_login = '';
                }
                do_action('bp_before_sidebar_login_form');
                ?>


				<form name="login-form" id="vbp-login-form" class="standard-form"
				      action="<?php 
                echo apply_filters('wplms_login_widget_action', vibe_site_url('wp-login.php', 'login-post'));
                ?>
" method="post">
					<label><?php 
                _e('Username', 'vibe');
                ?>
<br/>
						<input type="text" name="log" id="side-user-login" class="input" tabindex="1"
						       value="<?php 
                echo esc_attr(stripslashes($user_login));
                ?>
"/></label>

					<label><?php 
                _e('Password', 'vibe');
                ?>
 <a
							href="<?php 
                echo wp_lostpassword_url(get_permalink());
                ?>
" tabindex="5" class="tip"
							title="<?php 
                _e('Forgot Password', 'vibe');
                ?>
"><i class="icon-question"></i></a><br/>
						<input type="password" tabindex="2" name="pwd" id="sidebar-user-pass" class="input"
						       value=""/></label>

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

					<?php 
                do_action('bp_sidebar_login_form');
                ?>
					<input type="submit" name="user-submit" id="sidebar-wp-submit"
					       value="<?php 
                _e('Log In', 'vibe');
                ?>
" tabindex="100"/>
					<input type="hidden" name="user-cookie" value="1"/>
					<?php 
                if (bp_get_signup_allowed()) {
                    printf(__('<a href="%s" class="vbpregister" title="' . __('Create an account', 'vibe') . '" tabindex="5" >' . __('Sign Up', 'vibe') . '</a> ', 'vibe'), site_url(BP_REGISTER_SLUG . '/'));
                }
                ?>
					<?php 
                do_action('login_form');
                //BruteProtect FIX
                ?>
				</form>


				<?php 
                do_action('bp_after_sidebar_login_form');
            }
            echo $after_widget;
        }
开发者ID:inetbiz,项目名称:wordpress-lms,代码行数:101,代码来源:custom_bp_widgets.php


示例18: bp_core_activation_notice

/**
 * Verify that some BP prerequisites are set up properly, and notify the admin if not
 *
 * On every Dashboard page, this function checks the following:
 *   - that pretty permalinks are enabled
 *   - that a BP-compatible theme is activated
 *   - that every BP component that needs a WP page for a directory has one
 *   - that no WP page has multiple BP components associated with it
 * The administrator will be shown a notice for each check that fails.
 *
 * @package BuddyPress Core
 */
function bp_core_activation_notice()
{
    global $wp_rewrite, $wpdb, $bp;
    // Only the super admin gets warnings
    if (!bp_current_user_can('bp_moderate')) {
        return;
    }
    // On multisite installs, don't load on a non-root blog, unless do_network_admin is
    // overridden
    if (is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog()) {
        return;
    }
    // Don't show these messages during setup or upgrade
    if (!empty($bp->maintenance_mode)) {
        return;
    }
    /**
     * Check to make sure that the blog setup routine has run. This can't happen during the
     * wizard because of the order which the components are loaded. We check for multisite here
     * on the off chance that someone has activated the blogs component and then disabled MS
     */
    if (bp_is_active('blogs')) {
        $count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$bp->blogs->table_name}"));
        if (empty($count)) {
            bp_blogs_record_existing_blogs();
        }
    }
    /**
     * Are pretty permal 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_get_signup_blog_privacy_value函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_get_settings_slug函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap