Replies
Hi Brajesh,
It’s getting close. Some of the form labels have disappeared, but happily the “x” to close the modal window has reappeared. I’m also getting a form box within a form box.
Thank you very much for your support.
I’d be happy to grant you temporary admin access. Just pm me and I’ll send a link.
Also, could you explain a little about loading on the wp-login.php page. As you can see I already was loading css for the registration form — but maybe in the wrong order? I try to learn as much as I can when things don’t go right.
The start of the functions.php file now reads:
<?php /* functions.php for IHC Theme - a child of customizr */ /* Enqueue parent & child theme stylesheets for proper cascading */ add_action( 'wp_enqueue_scripts', 'my_assets' ); function my_assets() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' ); wp_enqueue_style( 'calendar-style', get_stylesheet_directory_uri() . '/simcal.css' ); wp_enqueue_style( 'Spreadsheet-style', get_stylesheet_directory_uri() . '/mbr-roster.css' ); wp_enqueue_style( 'caldera-forms-style', get_stylesheet_directory_uri() . '/caldera.css' ); wp_enqueue_style( 'weather-widget-style', get_stylesheet_directory_uri() . '/wunderground.css' ); wp_enqueue_style( 'bp-register-style', get_stylesheet_directory_uri() . '/bp-ajax-register.css' ); // wp_enqueue_script( 'myscripts', get_stylesheet_directory_uri() . '/scripts.js', array('jquery'), '1.0.0', true ); /* Modify ServiceBox plugin so that links open in same window. */ /* https://wordpress.org/support/topic/link-opening-in-a-new-tab-2/ */ wp_enqueue_script( 'custom-functions', get_stylesheet_directory_uri() . '/js/custom.js', array('jquery') ); add_action( 'login_enqueue_scripts', 'custom_login_placeholders', 10 ); function custom_login_placeholders() { wp_enqueue_script( 'customlogin.js', get_template_directory_uri() . '/js/customlogin.js', array( 'jquery' ), 1.0 ); } } /* Done most of the enqueuing */ /** * Load on login page. */ function buddydev_login_load_ajaxr_styles() { wp_enqueue_style( 'bp-custom-ajaxr', get_stylesheet_directory_uri() . '/bp-ajax-register.css' ); } add_action( 'login_enqueue_scripts', 'buddydev_login_load_ajaxr_styles' ); /* Remove the login labels, we'll use placeholders */ function empty_login_labels() { add_filter( 'gettext', 'username_change', 20, 3 ); function username_change( $translated_text, $text, $domain ) { if (preg_match("/Username|Password/", $text)) { $translated_text = ''; } return $translated_text; } } add_action( 'login_head', 'empty_login_labels' ); /** * Filter the WP Users List Table views to override 'bp-signups' with 'new-user-approve-admin'. * * * @param array $views WP List Table views. * @return array The views with the signup view replaced with 'new-user-approve-admin' link. * @author lenasterg */ function ls_change_signup_filter_view_to_new_user_approve_admin($views = array()) { global $role; /** * Detect plugin. For use in Admin area only. */ if (is_plugin_active('new-user-approve/new-user-approve.php')) { remove_filter("views_users", array('BP_Members_Admin', 'signup_filter_view')); // Remove the 'current' class from All if we're on the signups view. if ('registered' === $role) { $views['all'] = str_replace('class="current"', '', $views['all']); $class = 'current'; } else { $class = ''; } $user_status = pw_new_user_approve()->get_user_statuses(); $users = $user_status['pending']; $signups = count($users); if (is_network_admin()) { $base_url = network_admin_url('users.php'); } else { $base_url = bp_get_admin_url('users.php'); } $url = add_query_arg('page', 'new-user-approve-admin', $base_url); $text = sprintf(_x('Pending %s', 'signup users', 'buddypress'), '<span class="count">(' . number_format_i18n($signups) . ')</span>'); $views['registered'] = sprintf('<a href="%1$s" class="%2$s">%3$s</a>', esc_url($url), $class, $text); } return $views; } add_filter('views_users', 'ls_change_signup_filter_view_to_new_user_approve_admin', 12);
Young man, this old woman can put in the child theme’s functions.php, all the php you’d like! 🙂
Thank you so much for your assistance.
Here you go. Thank you for working on this. I’ve been completely stumped and it didn’t help that I’ve been away from this project for several months.
/************** Styling for bp-ajax-registration form ********************/ /* The title area & text */ .bpajax-register-title { background-color: inherit; padding: 12px 8px 8px 8px; } .bpajax-register-title span { font-family: 'Source Sans Pro'; color: #005200; display: block; font-size: 32px; line-height: 40px; font-weight: bold; text-align: center; padding: 3px 0 5px 25px; } .bpajax-register-window .register_form_wrap { margin: 0 25px 0 25px ! important; } /* Hide the register button if terms not agreed to yet */ /* reference: https://stackoverflow.com/questions/18752134/reveal-and-hide-a-div-on-checkbox-condition-with-css */ #terms-privacy:not(:checked) ~ .hide-check { display: none ! important; } #register_form div.submit { padding: 10px 0 0; font-size: 16px; color: black; } #register_form div.submit input { margin-left: 10px; margin-right: 5px; } .bpajax-register-window #register_form #signup_submit { margin-top: 30px; margin-left: auto; margin-right: auto; display: block; padding: 4px 12px ! important; } /* The form background */ .bpajax-register-window { background: #fff9f1; border: solid 2px #005200; padding-top: 15px; } /* Use column properties to make responsive */ .bpajax-register-window #register_form .register-section { width: 100% ! important; margin: 0; -webkit-columns: 2 200px ! important; -moz-columns: 2 200px ! important; columns: 2 200px ! important; -webkit-column-gap: 4em; -moz-column-gap: 4em; column-gap: 4em; -webkit-column-rule: 1px dotted #ddd; -moz-column-rule: 1px dotted #ddd; column-rule: 1px dotted #ddd; column-fill: balance ! important; } .bpajax-register-window #register_form label, #register_form span.label, .bpajax-register-window #register_form legend { width: 200px ! important; font-weight: bold; } .bpajax-register-window #register_form label, #register_form span.label { /* margin-top: 11px ! important; */ margin-bottom: 0 ! important; } #signup_password_confirm { margin-bottom: 0 ! important; } /* Hide the description, we'll use placeholders instead */ .bpajax-register-window #register_form p.description { display: none; } /* Keep label & corresponding input field together */ .bpajax-register-window #register_form .editfield { display: inline-block; } .bpajax-register-window #register_form input[type=checkbox] { transform: scale(1.4) !important; } .bpajax-register-window #register_form .uneditable-input, .bpajax-register-window #register_form input[type=text], .bpajax-register-window #register_form input[type=password], .bpajax-register-window #register_form input[type=email], .bpajax-register-window #register_form select, .bpajax-register-window #register_form textarea { height: 32px ! important; width: 230px; font-size: 16px ! important; margin-bottom: 0 ! important; margin-top: 0 ! important; } .bpajax-register-window #register_form legend { border-bottom: none ! important; font-size: 14px ! important; width: 200px ! important; margin: 0 ! important; font-weight: bold; height: 30px; margin-top: 4px ! important; margin-bottom: 2px ! important; } /* Style the error messages */ #register_form div div.error { background: inherit ! important; font-size: 15px; font-weight: 600; color: #731100; margin: 0; padding: 0; width: 90%; }
Hi Brajesh,
Thank you for the prompt reply.
I turned off ssl. I think.
I still get the weird form when I click “login” then “register” from the login widget.
If I click the main “register” fixed button at the top of the page (not from the login widget), I still get the forever-spinning circle.
I can give you temporary admin access if that would help.
Thanks,
DianaHere you go: ajax-register-form.php, located in the child theme directory.
<!--title--> <div class="bpajax-register-window"> <div class="bpajax-register-title"> <span class="topmodaltext2"><?php _e( 'Register for full site access', 'bp-ajax-registration' ) ?></span> </div> <!--form wrap--> <div class='register_form_wrap'> <form action="" name="signup_form" id="register_form" class="" method="post" enctype="multipart/form-data"> <?php do_action( 'template_notices' ) ?> <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?> <?php do_action( 'bp_before_account_details_fields' ) ?> <p style="font-size: 18px; color: black;">You must be an IHC member in good standing for full site access. Not yet an IHC member? Download a membership form <a href="https://wp.interiorhorsecouncil.com/wp-content/uploads/2017-Membership-Form-full.pdf" target="_blank" rel="noopener noreferrer">here</a>. <br><br>All fields are required except alternate phone.</p> <div class="register-section"> <?php /***** Basic Account Details ******/ ?> <label for="signup_username"> <?php _e( 'Username', 'bp-ajax-registration' ) ?> <?php _e( '*', 'bp-ajax-registration' ) ?> </label> <?php do_action( 'bp_signup_username_errors' ) ?> <input type="text" name="signup_username" id="signup_username" placeholder="Username"value="<?php bp_signup_username_value() ?>"/> <label for="signup_email"><?php _e( 'Email Address', 'bp-ajax-registration' ) ?><?php _e( '*', 'bp-ajax-registration' ) ?></label> <?php do_action( 'bp_signup_email_errors' ) ?> <input type="text" name="signup_email" id="signup_email" placeholder="Your email address"value="<?php bp_signup_email_value() ?>"/> <label for="signup_password"><?php _e( 'Choose a Password', 'bp-ajax-registration' ) ?><?php _e( '*', 'bp-ajax-registration' ) ?></label> <?php do_action( 'bp_signup_password_errors' ) ?> <input type="password" name="signup_password" id="signup_password" placeholder="********" value=""/> <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'bp-ajax-registration' ) ?><?php _e( '*', 'bp-ajax-registration' ) ?></label> <?php do_action( 'bp_signup_password_confirm_errors' ) ?> <input type="password" name="signup_password_confirm" id="signup_password_confirm" placeholder="********" value=""/> <!-- #basic-details-section --> <?php do_action( 'bp_after_account_details_fields' ) ?> <?php /***** Extra Profile Details ******/ ?> <?php if ( bp_is_active( 'xprofile' ) ) : ?> <?php do_action( 'bp_before_signup_profile_fields' ) ?> <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?> <?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( apply_filters( 'bpajaxr_xprofile_args', 'profile_group_id=1&hide_empty_fields=0&hide_empty_groups=0' ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?> <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <div class="editfield"> <?php $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html(); ?> <?php do_action( 'bp_custom_profile_edit_fields' ) ?> <?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ) ?> <p class="description"><?php bp_the_profile_field_description() ?></p> </div> <?php endwhile; ?> <?php $fields_ids[] = bp_get_the_profile_group_field_ids();//COLLECT FIELD IDS?> <?php endwhile; endif; endif; ?> <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php echo implode( ",", $fields_ids ); ?>"/> </div><!-- #profile-details-section ends here --> <?php do_action( 'bp_after_signup_profile_fields' ) ?> <?php endif; ?> <?php if ( bp_get_blog_signup_allowed() ) : ?> <?php do_action( 'bp_before_blog_details_fields' ) ?> <?php /***** Blog Creation Details ******/ ?> <div class="register-section" id="blog-details-section"> <h4><?php _e( 'Do you need a blog?', 'bp-ajax-registration' ) ?></h4> <p> <input type="checkbox" name="signup_with_blog" class="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'bp-ajax-registration' ) ?> </p> <div id="blog-details" <?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>> <label for="signup_blog_url"><?php _e( 'Blog URL', 'bp-ajax-registration' ) ?><?php _e( '*', 'bp-ajax-registration' ) ?></label> <?php do_action( 'bp_signup_blog_url_errors' ) ?> <?php if ( is_subdomain_install() ) : ?> http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>"/> .<?php echo preg_replace( '|^https?://(?:www\.)|', '', network_site_url() ) ?> <?php else : ?> <?php echo network_site_url() ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>"/> <?php endif; ?> <label for="signup_blog_title"><?php _e( 'Site Title', 'bp-ajax-registration' ) ?><?php _e( '*', 'bp-ajax-registration' ) ?></label> <?php do_action( 'bp_signup_blog_title_errors' ) ?> <input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value() ?>"/> <span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'bp-ajax-registration' ) ?> :</span> <?php do_action( 'bp_signup_blog_privacy_errors' ) ?> <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || ! bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'bp-ajax-registration' ) ?> </label> <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'bp-ajax-registration' ) ?> </label> </div> </div><!-- #blog-details-section --> <?php do_action( 'bp_after_blog_details_fields' ) ?> <?php endif; ?> <?php do_action( 'bp_before_registration_submit_buttons' ) ?> <!-- checkbox & registration button have to be siblings in order for css hide & show to work on registration button --> <div class="submit"> <input type="checkbox" id="terms-privacy" class="terms-privacy" /> I have read and agree to the <a class="IHC_agree popup-terms" style="color: #425e8c; cursor: pointer;" href="#">IHC terms & conditions</a> and <a class="IHC_agree popup-privacy" style="color: #425e8c; cursor: pointer;" href="#">IHC privacy policy</a>. <!-- --> <input type="submit" name="signup_submit" id="signup_submit" class="hide-check btn btn-default"value="<?php _e( 'Register', 'bp-ajax-registration' ) ?>"/> <!-- </div> --> </div> <?php do_action( 'bp_after_registration_submit_buttons' ) ?> <?php wp_nonce_field( 'bp_new_signup' ) ?> <?php endif; // request-details signup step ?> </form> <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?> <h3><?php _e( 'Sign Up Complete!', 'bp-ajax-registration' ) ?></h3> <?php do_action( 'template_notices' ) ?> <?php do_action( 'bp_before_registration_confirmed' ) ?> <?php if ( bp_account_was_activated() ) : ?> <h3><?php _e( 'Account is now pending approval.', 'bp-ajax-registration' ) ?></h3> <!-- log the user out, my customization --> <!-- Will want a logout redirection --> <?php wp_logout(); ?> <p> <?php _e( 'Thank you for joining our Community!', 'bp-ajax-registration' ); ?></p> <?php else : // completed-confirmation signup step ?> <?php if ( bp_registration_needs_activation() ) : ?> <p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'bp-ajax-registration' ) ?></p> <?php else : ?> <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'bp-ajax-registration' ) ?></p> <?php endif; ?> <?php do_action( 'bp_after_registration_confirmed' ) ?> <?php endif; ?> <?php endif; // completed-confirmation signup step ?> <?php do_action( 'bp_custom_signup_steps' ) ?> <div class="clear"> </div> </div> </div>
Hi Brajesh, I need to play with them too.
I’m not sure what happened with the close button or the message that someone has successfully registered. I need to roll back to BuddyPress 2.8, possibly. When I updated to 2.9, the styling got all messed up on the form and I had to restyle a bunch of css for it. That’s what took me so long!
Let me know if you need access, or if you’d like a copy of the css file. I found some example css to set up balanced (well, fairly balanced) columns that are still responsive.
Later,
DianaI set up Eonet Manual User Approve w/ BuddyPress Ajax Registration on a remotely hosted site rather than on my local host.
Processing the registration form seems to take a very long time, although this could be BlueHost.
The registration form stays open after the form is processed. The form is not reset, so it’s not clear the user has been processed until I go into the back end and check.
Eonet is not showing a message or emailing either me as admin or the user, so far as I can tell.
Will work on this more tomorrow.
Site is: https://wp.interiorhorsecouncil.com/ and press the “Register” button at the page top to bring up the form.
Hi Brajesh,
I did some styling on the registration form. Here’s the site:
https://wp.interiorhorsecouncil.com/A reset or cancellation button option might be nice.
Feedback is always welcome!
DianaUpdate: The “Eonet Manual User Approve” plugin seems to work very nicely with Ajax-BuddyPress-Registration, except I was unable to check the email functions since I’m on a local environment. Next day or two I will migrate the site, then send you a link so you can check out the registration form styling etc.
Hope your week is going well.
Diana
Hi Brajesh,
After browsing some of the Caldera Forms code, it struck me that the form generation & data collection are modular, with processors that can be chained serially for validation & final writing to a database.
I’m assuming that Contact Form 7 and Gravity Forms are similar. There is no BuddyPress registration processor add-on for any of those form plugins, just WordPress registration as a paid add-on.
So it should be possible to send data collected from each of those to a custom processor which could link an input form field to any existing xprofile fields, then standardize the data received, then pass those massaged data to a common BuddyPress registration processor.
Then the forms plugins can do what they do best, that is, forms generation and data collection with a nice user interface(s).
I am most familiar with Caldera Forms, which has a number of tutorials and examples beyond my current skillset, as php is new to me — along with WordPress, BuddyPress & membership systems:
https://calderaforms.com/doc/getting-submission-data-in-a-form-processor/
https://calderaforms.com/doc/creating-custom-validation-processor-caldera-forms/
https://gist.github.com/Desertsnowman/c65b3eaa80db7256689f
https://wordpress.org/plugins/caldera-forms-run-action/
I’m not sure how you’d want to price such an add-on, but I’d be happy to pay $35 one-time fee, if I could get bug fixes / updates with that.
Until I found your buddypress ajax-registration, I was stymied. One can find many membership plugins, each with its own meta table & profile, and none which really integrates with BuddyPress. They duplicate some of BuddyPress’ functionality but bypass much of BuddyPress. At best, they seem to have separate profiles — maybe profiles are such a small part of BuddyPress that it doesn’t matter.
Thank you for looking into this.
Next few days are pretty busy so I might not get back to you for a bit. Have a great week.
Diana