Require Real Name

Started by LordHogFred, September 04, 2007, 01:18:42 PM

Previous topic - Next topic

LordHogFred

Hello,

I really want to convert over from phpBB to SMF as it looks pretty awesome.
However, one feature that I have on my phpBB board atm is that users are required to enter their real name in a field as part of the registration process.
They can then choose whether it is displayed publically or only viewable by admins and mods. I've seen there is a real name mod for SMF but it doesn't have it set so that the real anme field is required for registration.
So if anyone could show me how I could change this or direct me to some mods it'd be great.

Thanks :),

codenaught

Have you tried asking in the mod's support topic, to see if the mod author or anyone else using the mod may be able to adapt the mod to meet your needs? http://www.simplemachines.org/community/index.php?topic=38920.0

It probably wouldn't be too hard to do this, adding a basic html input for the real name in Register.template.php, and then in Register.php, make sure that something was filled in.
Dev Consultant
Former SMF Doc Coordinator

DoCBReeD

I modified my Register.template.php file to require a Real Name upon registration...
Running Current SMF version: SMF 2.0 Beta 4

Find:
function checkAgree()
{
document.forms.creator.regSubmit.disabled =  (currentAuthMethod == "passwd" && (isEmptyText(document.forms.creator.smf_autov_pwmain) || isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.email))) || (currentAuthMethod == "openid" && isEmptyText(document.forms.creator.openid_url)) || !document.forms.creator.regagree.checked;
setTimeout("checkAgree();", 1000);
}


Replace with:
function checkAgree()
{
document.forms.creator.regSubmit.disabled =  (currentAuthMethod == "passwd" && (isEmptyText(document.forms.creator.smf_autov_pwmain) || isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.real_name) || isEmptyText(document.forms.creator.email))) || (currentAuthMethod == "openid" && isEmptyText(document.forms.creator.openid_url)) || !document.forms.creator.regagree.checked;
setTimeout("checkAgree();", 1000);
}


Find:
<tr>
<td width="40%">
<b>', $txt['choose_username'], ':</b>
<div class="smalltext">', $txt['identification_by_smf'], '</div>
</td>
<td>
<input type="text" name="user" id="smf_autov_username" size="30" tabindex="', $context['tabindex']++, '" maxlength="25" value="', isset($context['username']) ? $context['username'] : '', '" />
<span id="smf_autov_username_div" style="display: none;">
<a id="smf_autov_username_link" href="#">
<img id="smf_autov_username_img" src="', $settings['images_url'], '/icons/field_check.gif" alt="*" />
</a>
</span>
</td>
</tr>


Insert After:
<tr>
<td width="40%">
<b>Real Name:</b>
<div class="smalltext"></div>
</td>
<td>
<input type="text" name="real_name" id="smf_autov_real_name" size="30" tabindex="', $context['tabindex']++, '" maxlength="25" value="', isset($context['name']) ? $context['name'] : '', '" />

</td>
</tr>

Advertisement: