Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Indra - marraskuu 27, 2005, 07:28:28 AP

Otsikko: Birthdate in profile page
Kirjoitti: Indra - marraskuu 27, 2005, 07:28:28 AP
I've put this in /Themes/default/Profile.template.php

After this:
</tr><tr>
<td><b>', $txt[420], ':</b></td>
<td>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/bdaycake.gif" width="40" alt="" />' : ''), '</td>
</tr><tr>


I put this:
<td><b>Birthdate : </b></td>
<td> dag : ', $context['member']['birth_date']['day'] ,' maand : ', $context['member']['birth_date']['month'] ,' jaar : ', $context['member']['birth_date']['year'] ,' ', $context['member']['name'], '</td>
</tr><tr>


and altho it show the name of the member, it shows "1" for day, month and year
can someone tell how to get it to show the members birthdates :)
Otsikko: Re: Birthdate in profile page
Kirjoitti: Indra - marraskuu 28, 2005, 03:36:58 AP
I found a way to get the birthdate to show

in /sources/profile.php i find this
list ($birth_year, $birth_month, $birth_day) = sscanf($context['member']['birth_date'], '%d-%d-%d');


and put this after it
$context['member'] += array(
'bday' => $birth_day,
'bmonth' => $birth_month,
'byear' => $birth_year
);


So then in /themes/default/profile.template.php i find
</tr><tr>
<td><b>', $txt[420], ':</b></td>
<td>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/bdaycake.gif" width="40" alt="" />' : ''), '</td>
</tr><tr>


and put this behind it
<td><b>Birthdate : </b></td>
<td> dag : ', $context['member']['bday'] ,' maand : ', $context['member']['bmonth'] ,' jaar : ', $context['member']['byear'] ,' ', $context['member']['name'], '</td>
</tr><tr>


i'm happy i got it working this way and
i'm wondering if it can be done using $context['members']['birth_date']['day/month/year']