Okay so basically what I want to do is the following - change the member registration page and remove the section that has email preferences etc, and replace it with a section with site rules, which the user would have to accept by clicking a checkbox otherwise the registration would not be valid.
I know how to add checkboxes etc and I know it will require some PHP (I think), my question is how would I go about doing this properly?
I do this at the agreement page. In the
member_register_agreement template add:
<input type="checkbox" class="checkbox" name="do_agree" id="do_agree" value="1" /> <label for="do_agree"><strong>By regitering I do accept the mentioned conditions and any new condition determined by the administrator.</strong></label>
Then using
Patches add the following two hooks.
- Hook: member_register_start
- Code:
global $mybb;
if(empty($mybb->input['do_agree']))
{
error('You need to accept our registration agreement before proceeding.');
}
- Hook: member_do_register_start
- Code:
global $mybb;
if(empty($mybb->input['do_agree']))
{
error('You need to accept our registration agreement before proceeding.');
}
Luck.
Ahh I see, I get the idea from where you do it, but I will most likely be removing the registration agreement entirely and entering my own custom pre registration page, so I would like to do it on member_register, would it still be the same procedure?
Try adding the checkbox (first code) in the member_register template instead and just add the second Hook (member_do_register_start). I think it should work.
Okay, ill post back here once I try it out and let you know how it goes, thanks a lot man.