Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: ccbtimewiz on October 23, 2008, 10:06:59 PM

Title: Birthday on Profile Summary
Post by: ccbtimewiz on October 23, 2008, 10:06:59 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1470)

Package Information
Latest Version: 1.0
Created by: ccbtimewiz (http://www.simplemachines.org/community/index.php?action=profile;u=111571;sa=summary)
Built for: SMF 2.0 BETA and SMF 1.1.6
Package: Birthday on Profile Summary


What is this?

The following hack will put a birthday field on your profile summary. SMF by default does not do this, so this is how you do it.

Example:
(http://i33.tinypic.com/6hjkhc.png)


Alteration Log

[!] Released on October 10, 2008.


Need Help?

If you need help with this modification, please don't hesitate to post in the support thread.
Title: Re: Birthday on Profile Summary
Post by: Costa on October 24, 2008, 12:58:59 PM
Simple transation to brazilian :P

$txt['my_birthday'] = 'Aniversário';

Italian
$txt['my_birthday'] = 'Compleanno';

Spannish
$txt['my_birthday'] = 'Cumpleaños';

French
$txt['my_birthday'] = 'Anniversaire';

Congrats
Farewell
~[Costa]
Title: Re: Birthday on Profile Summary
Post by: Marcus Forsberg on October 24, 2008, 01:00:58 PM
Nice mod.

Swedish translation:
$txt['my_birthday'] = 'Födelsedag';
Title: Re: Birthday on Profile Summary
Post by: GJSchaller on October 24, 2008, 04:37:00 PM
Works like a charm for me - thank you VERY much!
Title: Re: Birthday on Profile Summary
Post by: Manu.G on October 29, 2008, 11:04:29 AM
Great Mod!! :D

One little question is there a way to show the date 1 January 2009 instead of January 1, 2009?
Title: Re: Birthday on Profile Summary
Post by: Basie on October 29, 2008, 11:12:12 AM
Nice mod. Thanks for sharing. :)
Title: Re: Birthday on Profile Summary
Post by: Özgür on January 04, 2009, 07:11:05 PM
Thanks for the mod.

Turkish translation:
$txt['my_birthday'] = 'Doğum Günü';
Title: Re: Birthday on Profile Summary
Post by: LinK187 on January 25, 2009, 10:07:09 AM
It sort of works, but on people's profiles it just shows a ':' and then their birthdate but the word "Birthdate" doesn't appear.

I also have this error in the forum error log:

Quote
****   Today at 11:04:10 AM 
*.*.*.*     4a8b468c25a74ee90cf8f94dcc45b991 
http://****/forum/index.php?action=profile;u=1 
8: Undefined index: my_birthday
File: /home/****/public_html/****/forum/Themes/default/languages/Who.english-utf8.php (eval?)
Line: 272
Title: Re: Birthday on Profile Summary
Post by: magarto on January 25, 2009, 01:25:48 PM
Is it anyway to force to users to put their birtday on registration with this mod????
I wrote this post but i do not know how to implement on 2.0 beta 4 and with this mod: http://www.simplemachines.org/community/index.php?topic=286961.0
Thanks in advance
Title: Re: Birthday on Profile Summary
Post by: Apllicmz on July 19, 2009, 12:35:48 PM
when Update dont forget portuguese_pt

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['my_birthday'] = 'Aniversário';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
$txt['my_birthday'] = 'Anivers&aacute;rio';
]]></add>
        </operation>
    </file>



She work fine in 1.1.10 but 2.0rc1-2
i see that error
Title: Re: Birthday on Profile Summary
Post by: Bugo on January 15, 2010, 01:47:11 AM
Changes for SMF 2 RC2-RC3:
// Birthday's date
list ($year, $month, $day) = explode('-', $context['member']['birth_date']);
$bday = $day == '00' ? '' : $day . ' ' . ($txt['months'][(int) $month] . ' ' . ($year != '0000' ? ' ' . $year : ''));

// Let's show it!
if (!empty($bday))
{
echo '
<dt>', $txt['my_birthday'] ,': </dt>
<dd>', $bday, '</dd>';
}


Russian translation:
$txt['my_birthday'] = 'День рождения';

And how not to bring your date of birth and date when the user will be celebrated next birthday — on the main page of forum?
Title: Re: Birthday on Profile Summary
Post by: Raffoz on May 06, 2010, 08:55:25 AM
nothing for SMF 2.0 RC3? :)

thanks...
Title: Re: Birthday on Profile Summary
Post by: Arantor on May 06, 2010, 09:13:33 AM
The same should work for 2.0 RC3.
Title: Re: Birthday on Profile Summary
Post by: Raffoz on May 06, 2010, 09:34:44 AM
it doesn't... :(

the code in rc3 is different from the one in the package
Title: Re: Birthday on Profile Summary
Post by: Arantor on May 06, 2010, 09:36:38 AM
I meant in reference to the changes for RC2 as a few posts above.
Title: Re: Birthday on Profile Summary
Post by: shrmn on June 15, 2011, 02:25:43 AM
There were significant changes in Profile.template.php from 2.0 RC2 to RC3 and subsequently, which broke this mod.

I'm uploading a new package, "Birthday on Profile Summary v2" which supports 2.0 RC3 and up (:
Title: Re: Birthday on Profile Summary
Post by: ILUXA on February 14, 2017, 07:20:25 AM
This mod is outdated and doesn't work fine with new SMF versions 2.0.1*

To show "Birthday on Profile Summary" with 2.0.1*,
you need to edit  ./Themes/default/Profile.template.php.

Find
echo '
<dt>', $txt['age'], ':</dt>
<dd>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/cake.png" alt="" />' : ''), '</dd>';


And add below

// Show birthday date
list ($year, $month, $day) = explode('-', $context['member']['birth_date']);
$bday = $day == '00' ? '' : ($txt['months_titles'][(int) $month] . ' ' . $day . ($year != '0000' ? ', ' . $year : ''));

if (!empty($bday))
echo '
<dt>', $txt['my_birthday'], ': </dt>
<dd>', $bday, '</dd>';






If you want to disable age, you need to comment

/* echo '
<dt>', $txt['age'], ':</dt>
<dd>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/cake.png" alt="" />' : ''), '</dd>';*/


So it should look like this
(https://i.imgur.com/nyj4LzN.png)

(https://i.imgur.com/TDlCHfA.png)

Also you need to add
$txt['my_birthday'] = 'Birthday';
to ./Themes/default/languages/Modifications.english.php