News:

Wondering if this will always be free?  See why free is better.

Main Menu

[Free] Date of birth in registration

Started by Panoulis64, May 08, 2023, 04:48:07 AM

Previous topic - Next topic

Panoulis64

It was in old versions too.
I think that since there is a birthday indication in the calendar, the system sends birthday wishes, if there was also a standard option in the smf, to be set by the administrator, mandatory or not. At least let's hope for a modification or a new mod! for sfm 2.1.3

There was this: https://custom.simplemachines.org/index.php?mod=3680

Steve

You're looking to make birthdate a required field when registering?
My pet rock is not feeling well. I think it's stoned.

Panoulis64

It's something I'd love to have and as for the required field, it should be an administrator's choice decision.

Shades.

Quote from: Panoulis64 on May 08, 2023, 04:48:07 AMIt was in old versions too.
I think that since there is a birthday indication in the calendar, the system sends birthday wishes, if there was also a standard option in the smf, to be set by the administrator, mandatory or not. At least let's hope for a modification or a new mod! for sfm 2.1.3

There was this: https://custom.simplemachines.org/index.php?mod=3680
I was able to get that mod to work on 2.1x but don't know how to make it required.

https://www.simplemachines.org/community/index.php?msg=4118916
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Panoulis64

Thanks for your answer.
Yes I have seen it and followed your steps.
It works, but I made the post, just so that it would be up to date, without the process we did and to have the mandatory option. I believe this is how you will appear in the management fields as well.

When I saw that, I took it a step further by putting your code inside the BirthdayOnRegister and tried to change the version as well, with the little I know.

package-info.xml
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>pedi:BirthdayOnRegister</id>
<name>Birthday On Register</name>
<version>1.0</version>
<type>modification</type>
<install for="2.1.1 - 2.1.99">
        <readme type="file" parsebbc="true">readme.txt</readme>
<modification format="xml" type="file">install.xml</modification>
<redirect url="?action=admin;area=featuresettings"></redirect>
</install>
<uninstall for="2.1.1 - 2.1.99">
<modification reverse="true">install.xml</modification>
<redirect url="?action=admin;area=packages;sa=browse" timeout="1000" /></redirect>
</uninstall>
</package-info>

install.xml
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>pedi:BirthdayOnRegister</id>
<version>1.0</version>

        <file name="$themedir/Register.template.php">
<operation>
<search position="replace"><![CDATA[// If OpenID is enabled, give the user a choice between password and OpenID.]]></search>
<add><![CDATA[//Show Birthday
global $txt;
echo '
<dl class="register_form">
            <dt>
            <strong>', $txt['dob'], '</strong><br />
                    <span class="smalltext">', $txt['dob_year'], ' - ', $txt['dob_month'], ' - ', $txt['dob_day'], '</span>
            </dt>
            <dd>
                    <input type="text" name="bday3" size="4" maxlength="4" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['year'] : ''), '" /> -
                    <input type="text" name="bday1" size="2" maxlength="2" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['month'] : ''), '" /> -
                    <input type="text" name="bday2" size="2" maxlength="2" value="', (!empty($context['member']['birth_date']) ? $context['member']['birth_date']['day'] : ''), '" />
           </dd>
               </dl>
<dl class="register_form" id="notify_announcements">
<dt>
<strong><label for="notify_announcements">', $txt['notify_announcements'], ':</label></strong>
</dt>
<dd>
<input type="checkbox" name="notify_announcements" id="notify_announcements" tabindex="', $context['tabindex']++, '"', $context['notify_announcements'] ? ' checked="checked"' : '', '>
</dd>
</dl>';

// If there is any field marked as required, show it here!]]></add>
</operation>
</file>
<file name="$languagedir/Login.english.php">
<operation>
<search position="end" />
<add><![CDATA[
$txt['dob'] = 'Birthdate:';
$txt['dob_month'] = 'Month (MM)';
$txt['dob_day'] = 'Day (DD)';
$txt['dob_year'] = 'Year (YYYY)';]]></add>
</operation>
</file>
<file name="$languagedir/Login.greek.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
$txt['dob'] = 'Ημ. Γένησης:';
$txt['dob_month'] = 'Μήνας (MM)';
$txt['dob_day'] = 'Ημέρα (DD)';
$txt['dob_year'] = 'Έτος(YYYY)';]]></add>
</operation>
</file> </modification>

I zipped them again but still got the warnings on install
1. Replace ./Themes/default/Register.template.php Test failed
Of course, I didn't need to go into files for the changes you suggested. I'm also uploading the compressed file for you, in case you know something else to do.
(Languages are English and Greek)You cannot view this attachment.

Advertisement: