BP Scholar Child Theme: sign-up & registration form mix up

Hi:

I am having trouble with BP-Scholar Child theme registration page and the S2 Member plugin: the Signup Button" on the site is pointing to the BuddyPress registration page.

What should happen:
a. person pays for registration via http://www.hoopinstructors.com/signup/: they choose their registration level and are sent to PayPal.

b. after a successful checkout has occurred through PayPal, they get access to:
http://www.hoopinstructors.com/register/
Where they finish the registration process. This page should never be seen at any other time in the process.

c. they get their confirmation email and sign into the site.

I went back to the S2Member plugin developer, who tested it with me until he came to this conclusion:

I. On a default installation of BuddyPress, it would work like this:
Open Registration = off
Your BuddyPress theme would detect this, and automatically disable all Signup Buttons/Links.
You would place a link to your Membership Options Page into the navigation bar somewhere instead.

II. In your case, your theme ( it would appear ) is not detecting that Open Registration is off. So it's creating a confusing situation, where there are links pointing to both /signup/ and to /register/.

III. I think the majority of the confusion here, is with the BuddyPress /register/ page. In most BuddyPress themes, the "Signup" links ( i.e. the /register/ links ) will be disabled automatically whenever Open Registration is disabled. However, there are many BuddyPress themes that just assume registration will be open ( because that's normally how BuddyPress is used ). In your theme, the Signup Button remains, even when Open Registration is off.

IV. So, here is what I suggest.
One of two things:

1. Modify your BuddyPress theme, by changing all references to /register/ over to /signup/. Thereby pointing the Signup Button to your Membership Options Page.

2. Alternatively, you could go into the BuddyPress plugin file:
/buddypress/bp-core/bp-core-signup.php

Find these lines:
/* 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 );

And change them to this instead:
/* If the user is logged in, redirect away from here */
if ( is_user_logged_in() )
bp_core_redirect( S2MEMBER_LOGIN_WELCOME_PAGE_URL );
/* If signups are disabled, just re-direct */
if ( !bp_get_signup_allowed() )
bp_core_redirect( S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL );

V. I tried suggestion 1, finding and replacing the word 'register' with 'signup' in themes/bp-scholar/registration/register.php but the 'signup' button still points to http://www.hoopinstructors.com/register/ rather than http://www.hoopinstructors.com/signup/

What should I do to fix the problem?

just in case it helps, I'm using
Firefox 3.6.8 (for development)
Chrome 5.0.375.127 (testing)
Safari 5.0.1 6533.17.8 (testing)

Thanks.
Terri

  • Tammie

    @Terrintokyo: Scholar uses exactly the same method as the default theme - if you can get it to work in that and not Scholar I will happily look at if there is an issue in Scholar. I think you will find perhaps though that the plugin developer is a little misleading in claiming it's normal when they suggest you edit core BuddyPress files - not exactly the theme :slight_smile:

    However, that doesn't help you much really. Therefore I suggest you test using the default BuddyPress theme and get back to me about the results on that and we take from there. I understand when someone blames a theme so lets work through this here as much as we can without having you bounced between us and them. Sound good?

  • Terrintokyo

    Hi Tammie:

    Okay, here we are:
    Your suggestion was to see if the same problem exists in BuddyPress default theme.

    1. BuddyPress Default activated
    2. clicking the Sign Up button leads again to http://www.hoopinstructors.com/register
    3. entering the url: hoopinstructors.com leads to http://www.hoopinstructors.com/register instead of to the home page
    4. entering http://www.hoopinstructors.com leads to http://www.hoopinstructors.com/
    5. clicking Join Hi leads to: http://www.hoopinstructors.com/signup/?s2member_level_req=1

    just to recap (as much for myself), what should happen is:
    a. person pays for registration via http://www.hoopinstructors.com/signup/: they choose their registration level and are sent to PayPal.

    b. after a successful checkout has occurred through PayPal, they get access to:
    http://www.hoopinstructors.com/register/ where they finish the registration process. This page should never be seen at any other time in the process.

    c. they get their confirmation email and sign into the site

    So, since this is a default BuddyPress problem too, it looks like it's not the theme, but I wonder if you have any ideas on what I might do to fix it?

    thank you very much.

  • Tammie

    @Terrintokyo: Unfortunately if the steps the plugin developer provided you were both done and still didn't work you may have to go back to them to at least inform them the default BuddyPress theme is also experiencing this one. My thoughts are perhaps it's the version of BuddyPress - is it updated to the latest one?

    Sadly I was sort of hoping that it wouldn't work in the default theme as the plugin developer was hinting at this - you'd assume they'd have tested in that :slight_frown: If it is then it is configuration or an issue with the setup / compatibility. Sorry to suggest you ask them but we do need clarification if you've tried their steps. I would perhaps suggest you try their steps with the default BuddyPress theme - have you?

    We have some membership plugins ourselves that may be useful for you though if you hit a brick wall with that plugin developer.

    https://premium.wpmudev.org/project/membership

    https://premium.wpmudev.org/project/supporter

  • Terrintokyo

    Hi Tammie:

    Thanks for your note: I spent almost 2 weeks trying the Membership plugin and finally had to give up as there were too many problem with the release candidate. That's why I switched to S2 Member, and, other than this issue, it has worked really well so far.

    I'll take your advice and pass the issue back to the plugin developer - I didn't try their steps with the default theme, but that seems like one way to figure out what is wrong.

    Thanks,

    Terri

  • Terrintokyo

    Hi Tammie:

    Yes, I know it's in final release. After going through that whole process of trying to understand what was going wrong, I think I just need too much hand-holding for WPMUDev: which is understandable, as this is a forum for 'Devs':wink: I'm more of a highly-motivated amateur: there are huge holes in my knowledge, and I'm learning as quickly as I can, but I also have a client to work with and limited time.

    Jason, the S2 Member developer is going into the dashboard to check things out and fix the problem - that's the kind of help I need on something so critical and it's not appropriate to expect it here.

    I love BP-Scholar, and have a few WPMUDev plugins, as well. I just need to learn a lot more.

    Thanks, though,

    best,
    Terri

  • Tammie

    @Terrinktokyo: Hmm sounds a weird fix you can edit includes/member-box.php:


    <?php if ( bp_get_signup_allowed() ) : ?>
    <?php printf( __( 'Sign up', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
    <?php endif; ?>

    However this won't solve links apart from the header one to the sign up form.

    You could edit BP_REGISTER_SLUG in the config file but to be honest I have never done that so can't really comment on the implications.

  • Terrintokyo

    Hi Tammie:

    Thanks very much.

    maybe, in my newbieness, I'm not expressing it well.
    please see the attached screenshot I took with Firebug.

    my question is: where can I find the link to the header sign-up button and sign-up text in the admin bar that now goes to http://www.hoopinstructors.com/register, as in the screen shot, and change just that url for those two places only to http://www.hoopinstructors.com/signup/ in the source code?

    appreciate your patience and help,

    best,
    Terri

  • Terrintokyo

    Hi Tammie:

    Oh! I may have done it wrong, sorry.

    I pasted the code in, but what happened was that:
    1. the sign-up graphic disappeared and was no longer a link
    2. the Admin bar sign up text still goes to the home page.

    just to make sure, here's the form code before I made the change:
    <?php else : ?>

    <?php do_action( 'bp_before_sidebar_login_form' ) ?>
    <form name="login-form" id="login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login' ) ?>" method="post">
    <label><?php _e( 'Username', 'buddypress' ) ?>
    <input type="text" name="log" id="userbar_user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="12" /></label>

    <label><?php _e( 'Password', 'buddypress' ) ?>
    <input type="password" name="pwd" id="userbar_user_pass" class="input" value="" size="12" /></label>

    <span class="forgetmenot"><label><input name="rememberme" type="checkbox" id="userbar_rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></span>

    <?php do_action( 'bp_sidebar_login_form' ) ?>

    <input type="submit" name="wp-submit" id="userbar_wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
    <input type="hidden" name="redirect_to" value="<?php bp_root_domain() ?>" />
    <input type="hidden" name="testcookie" value="1" />
    <?php if ( bp_get_signup_allowed() ) : ?>
    <?php printf( _ _( 'Sign up', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
    <?php endif; ?>
    </form>

    and here's the form code after I made the change:

    <?php do_action( 'bp_before_sidebar_login_form' ) ?>
    <form name="login-form" id="login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login' ) ?>" method="post">
    <label><?php _e( 'Username', 'buddypress' ) ?>
    <input type="text" name="log" id="userbar_user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" size="12" /></label>

    <label><?php _e( 'Password', 'buddypress' ) ?>
    <input type="password" name="pwd" id="userbar_user_pass" class="input" value="" size="12" /></label>

    <span class="forgetmenot"><label><input name="rememberme" type="checkbox" id="userbar_rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></span>

    <?php do_action( 'bp_sidebar_login_form' ) ?>

    <input type="submit" name="wp-submit" id="userbar_wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
    <input type="hidden" name="redirect_to" value="<?php bp_root_domain() ?>" />
    <input type="hidden" name="testcookie" value="1" />
    <?php if ( bp_get_signup_allowed() ) : ?>
    <?php printf( _ _( 'Sign up', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
    <?php endif; ?>
    </form>

    I've put the modified members-box.php back into bp-scholar includes.

    Are you seeing the same result? I'm looking at it in Chrome, and I always clear my cache before checking....I'm sure it's my fault, but not sure what to do next...

    Thank you!

    best,
    Terri

  • Terrintokyo

    Hi Tammie:

    No problem -sorry if I'm not being clear.

    I've put back the original members-box.php, so we're all clear.

    Here's the problem:
    http://www.hoopinstructors.com

    1. In the header, there are 2 Sign Up buttons, 1 at the very top in the Admin bar, and one under that.
    2. When someone who is not logged in clicks either button, I want them to be taken to the sign up page, which is this one: http://www.hoopinstructors.com/signup/
    3. Right now, clicking either of those buttons takes the person to either the home page (if the redirect plugin is on): http://www.hoopinstructors.com/
    4. Or, they are taken to the registration page (if the redirect plugin is off): http://www.hoopinstructors.com/register
    5. So, what I wanted to do is edit the url that the Sign up buttons link to and have them both link to:
    http://www.hoopinstructors.com/signup/ regardless of anything else.

    Does that make more sense? again, sorry I'm not making things clearer.

    hopefully,

    thanks,
    Terri

  • Tammie

    @Terrintokyo: Hmm not tried it but should be able to just do this:

    <?php if ( bp_get_signup_allowed() ) : ?>
    	<?php printf( __( '<a href="%s" title="Create an account">
    Sign up</a>', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
    <?php endif; ?>

    Becomes:

    <?php if ( bp_get_signup_allowed() ) : ?>
           <a href="http://www.hoopinstructors.com/signup/"
    title="Create an account">Sign up</a>
    <?php endif; ?>

    As for the admin bar that's a bit more complex you would have to probably edit buddypress/bp-core/bp-core-adminbar.php but I'd strongly recommend you do not as you will have to remember on upgrade and probably have issues with this.

    Perhaps you have the wrong settings on the redirect plugin if that is what is causing you issues but you were saying it was a different plugin causing issues.

    Whatever, I still think that doing this is probably the wrong way to go about it but you are the one working with that developer so I leave it up to you.

    Another route as said would be to change the define / set it in the config:

    https://premium.wpmudev.org/blog/daily-tip-customize-the-url-slugs-of-buddypress-components/

    You can add a url to the BP_REGISTER_SLUG define.

  • Terrintokyo

    Hi Tammie:

    You rock! the code part worked for the member-box sign-up button! Now, if you can just let me know how to get the button graphic back where it should be, that would be super awesome!

    Now that I know that it works for the button (once the I have the image back in), I'll see if the Admin bar change happens if I change the register slug in config.php.

    I'll let you know what happens.

    it's such a relief that the big Sign up button goes to the right place!

    thanks so much,

    best,
    Terri

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.