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)
For SMF 2.0 BETA 4
Open ./Themes/default/Profile.template.php
Find:
if (!isset($context['disabled_fields']['gender']))
echo '
<tr>
<td><b>', $txt['gender'], ': </b></td>
<td>', $context['member']['gender']['name'], '</td>
</tr>';
Add after:
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 '
<tr>
<td><b>Birthday: </b></td>
<td>', $bday, '</td>
</tr>'; }
For SMF 1.1.x
Open ./Themes/default/Profile.template.php
Find:
// Some more information.
echo '
<tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr>';
Add after:
list ($year, $month, $day) = explode('-', $context['member']['birth_date']);
$bday = $day == '00' ? '' : ($txt['months_titles'][(int) $month] . ' ' . $day . ($year != '0000' ? ', ' . $year : ''));
// Let's show it!
if( !empty( $bday ) )
{
echo '
<tr>
<td><b>Birthday: </b></td>
<td>', $bday, '</td>
</tr>';
}
Nice Tip/Trick ccbtimewiz, Its great when useful tweaks require few edits. ;D
Indeed it is, L. :D
Is it possible to make this into a package? I have several SMF installs I would like to add this to quickly & easily. ;)
Thank you!
Alright, I finished it as a package and uploaded it to the mod site. Awaiting validation from the customization team. :)
Wonderful - thank you!
Amazing!
Works fine to me in Dilber MC
Thank you!
One question, can I translate your post and post them in the portuguese area?
Go right ahead. Though I can speak fluent Portuguese. But if you're willing to do it for me, then be my guest.
I've already made a mod for this, so linking to the mod might be easier. It should be approved quite soon. :)
Until there the portuguese community who don't understand english can do itself
Thank you very much, you can see the topic in portuguese here (http://www.simplemachines.org/community/index.php?topic=269585.new#new)
If you want to update the language it's simple
Where you put Birthday, replace that to Data de nascimento to portuguese and brazilian
Thank you one more time
Farewell
This works great in SMF 1.1.10 with just one small niggle; the date order is the wrong way round for British and European forums.
Currently it prints, month: day: year: when it should be day: month: year:
This is my attempt to rectify this and it works fine, but there may be a much better way to do it. I'm still learning!
list ($year, $month, $day) = explode('-', $context['member']['birth_date']);
$bday = $day == '00' ? '' :' ' . $day . " ". ($txt['months_titles'][(int) $month] . ($year != '0000' ? ', ' . $year : ''));
// Let's show it!
if( !empty( $bday ) )
{
echo '
<tr>
<td><b>Birthday: </b></td>
<td>', $bday, '</td>
</tr>';
}
Can this be updated to the latest version of SMF?
uh well when i use it on mine it just has : it doesnt say birthday before the name?
http://biogreengaming.com/forums.html/index.php?action=profile
Can you please attach Profile.template.php?
Here it is i didnt know how to put it in the forums
http://www.2shared.com/file/kguT1Nj9/Profiletemplate.html