Please indicate the source when reprinting.
After an afternoon of research, I finally completed this feature and am sharing it with everyone.
The specific functions are as follows:
Whether or not an invitation code is required depends on the email address. For example, if a user has an .edu email address, they can register without an invitation code; otherwise, they will need to enter an invitation code.
Modification method:
1./template/default/member/register.htm
Around line 100, that is
Add code:
2./source/class/class_member.php
turn up:
if ($this->setting['regstatus'] == 2 && empty($invite) && !$invitestatus && $emailedu == 0) { showmessage('not_open_registration_invite'); } Add on top
$emailedu = $_GET['emailedu'];
3. /static/js/register.js
turn up:
if (email.match(/<|'/ig)) { errormessage(id, 'Email contains sensitive characters'); return; } Add below
else if (email . match(/\@(([a - zA - Z0 - 9\ - ]) + \ . edu) / g)) { $('tip_invitecode') . parentNode . className = $('tip_invitecode') . parentNode . className . replace(/p_right / , ''); errormessage('invitecode', 'succeed'); document . getElementById('emailedu') . value = '1'; } All done! You can make the minor tweaks yourself!
This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:
Original author:Jake Tao,source:"[Original] DiscuzX3 Adds Email Address Detection to Determine Whether an Invitation Code is Required—Invitation Code + Email Dual Authentication"