Support » Plugin: BuddyPress Registration Groups » Checkbox style to Dropdown style

Viewing 10 replies - 1 through 10 (of 10 total)
  • In the plugin’s folder edit the includes/bp-registration-groups.php file.
    I tested this method today and it’s working.

    Change this:

    <?php $i = 0; $l = 0; ?>
    				<?php if ( bp_has_groups('type='.$bp_registration_groups_display_order.'&per_page='.groups_get_total_group_count() ) ) : while ( bp_groups() && $l < $bp_registration_groups_number_displayed ) : bp_the_group(); ?>
    <?php if ( in_array( bp_get_group_status(), $bp_registration_groups_show_private_groups, true ) ) { ?>
    <li class="reg_groups_item">
    <input class="reg_groups_group_checkbox" type="checkbox" id="field_reg_groups_<?php echo $i; ?>" name="field_reg_groups[]" value="<?php bp_group_id(); ?>" /><label class="reg_groups_group_label" for="field_reg_groups[]"><?php printf( __( '%s', 'buddypress-registration-groups-1' ), bp_get_group_name() ); ?></label>
    
    <?php $l++; ?>
    <?php } ?>
    <?php $i++; ?>
    <?php endwhile; /* endif; */ ?>
    <?php else: ?>
    <p class="reg_groups_none"><?php _e( 'No groups are available at this time.', 'buddypress-registration-groups-1' ); ?></p>
    <?php endif; ?>

    To this:

    <select>
    <?php $i = 0; $l = 0; ?>
    <?php if ( bp_has_groups('type='.$bp_registration_groups_display_order.'&per_page='.groups_get_total_group_count() ) ) : while ( bp_groups() && $l < $bp_registration_groups_number_displayed ) : bp_the_group(); ?>
    <?php if ( in_array( bp_get_group_status(), $bp_registration_groups_show_private_groups, true ) ) { ?>
    <li class="reg_groups_item">
    <option class="reg_groups_group_checkbox" id="field_reg_groups_<?php echo $i; ?>" name="field_reg_groups[]" value="<?php bp_group_id(); ?>"><?php printf( __( '%s', 'buddypress-registration-groups-1' ), bp_get_group_name() ); ?></option>
    </li>
    <?php $l++; ?>
    <?php } ?>
    <?php $i++; ?>
    <?php endwhile; /* endif; */ ?>
    <?php else: ?>
    <p class="reg_groups_none"><?php _e( 'No groups are available at this time.', 'buddypress-registration-groups-1' ); ?></p>
    <?php endif; ?>
    </select>

    Plugin Author hardlyneutral

    (@hardlyneutral)

    Thanks infectedmann! I’ll also add this as a feature in the backlog for the next release.

    eh, great, but I need radio buttons, will try to hack into core, or maybe you can insert radio option too? 🙂

    thanks for this crucial plugin!

    Plugin Author hardlyneutral

    (@hardlyneutral)

    Just to clarify, radio buttons would prevent the user from selecting multiple groups to join. Is that the behavior you are looking for?

    Plugin Author hardlyneutral

    (@hardlyneutral)

    I’ll be adding this in a release shortly.

    Plugin Author hardlyneutral

    (@hardlyneutral)

    Release 1.1.1 is out and has radio buttons 🙂

    yes, great! :))

    eavinu

    (@eavinu)

    Hello,
    This plugin came like sun-ray in a cloudy day 🙂

    I revised the code according to infectedman since we have 85 groups and I must have the students assigned to their group once they register and it can’t look good with 85 radio buttons…
    85 check boxes are also not a good option especially since each student can only belong to one group in this website.

    So dropdown is the ideal solution for me but for some reason the students are not being assigned to the groups.

    Info:
    Buddypress latest version 2.7.2.
    Wordpress 4.4.2.

    Also have the BP Disable Activation Reloaded plugin installed since I don’t want the users to have to activate the account and need it activated automatically.
    Could this cause the problem or is it the fact that I changed to the dropdown?

    Please help, the website owner gives me hard time over this..
    Thanks!

    eavinu

    (@eavinu)

    Okay I disabled the auto account activation plugin and still nothing, so I reactivated it.
    I returned the plugin to the original code without the dropdown and now it works perfectly.

    Would still appreciate a new version or a bit of code to be able to have it as drop down…

    Thanks for a great plugin!

    @hardlyneutral Pls instead of the radio buttons you added on your last update, why not add a drop down list as this is more practical and would make the registration form look neater for people with lots of group.

    also @infectedmann you dropped the original Drop down code can you pls help out as this is also an issue affecting me seriously.

    Thanks in advance.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.