Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Birthdate in profile page

Aloittaja Indra, marraskuu 27, 2005, 07:28:28 AP

« edellinen - seuraava »

Indra

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 :)

Indra

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']

Advertisement: