How can I disable the display of user's age in their profile? I would suspect that a lot of people (mainly females, hehe :P) wouldn't like to see their age listed, but still would like other people to know when their birthday is (i.e. have the birthday in the calendar). Is it possible to do this, or do I need to tweak the code?
Thanks!
dobomode
quick hack in the code: edit Profil.template.php , you will find the age stuff at lines 214 - 217. easily comment out the whole TR thingy with <!-- age code //--> so it won't displayed in teh profile and if you need it back for some reasons, it's still there.
OK, but that would not prevent CMF from showing people's age in the calendar, right (whenever they have a birthday)? Isn't there some setting to disable age display globally across the whole forum.
dunno, haven't seen anything yet to disable it. maybe overseen, maybe nothing around there.
at least you could disable displaying the age in the Calender.template.php too as quick workaround.
Well - the easiest thing to do is to tell them to put in their birthday but leave the year as 0000, SMF will not display their age but will still give them their birthdays.
Example, I'd enter mine as 03/12/0000. Age will then show up as N/A, but I'll still show on the calendar when my birthday comes around :)
OK, that sounds like it could work, but don't you think it's going to be less confusing if there was an explicit setting like "Allow users to see age" in "Edit Features and Options"? Or perhaps a permission in "Edit Permissions"?
The only problem is we can't have a setting for everything. Everyone has their own "quirks" that they'd like to turn off. What you could do is edit Profile.template.php and find this line:
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" />
and simply change it to:
<input type="text" name="bday3" size="4" maxlength="4" value="0000" disabled="disabled"/>
To stop people from putting in their birthday.
If you really want to remove the age then also remove this:
<td><b>', $txt[420], ':</b></td>
<td>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' <img src="' . $settings['images_url'] . '/bdaycake.gif" width="40" alt="" />' : ''), '</td>
</tr><tr>
I'm sorry we don't have a setting to make this easier for you, but as I said there are only so many things we can give settings for I'm afraid - otherwise SMF becomes too slow and bulky if we add everything :(
I removed the age in the profile, thanks for this post. How about removing the age in the Birthdays in the Upcoming Calendar? I have birthdays listed, but I just want the member's name, not the age, displayed. Maybe the date instead of the age?
I think it's a bit rude to default ages to be on. :) I wish they were turned off in the whole board. Display birthdays instead, we can figure it from there.
Find in Sources/Calendar.php:
$bday[$row['dom']][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'age' => $row['birthYear'] > 0 && $row['birthYear'] <= $age_year ? $age_year - $row['birthYear'] : null,
'is_last' => false
);
Replace:
$bday[$row['dom']][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'age' => null,
'is_last' => false
);
How do I modify files? (http://www.simplemachines.org/community/index.php?topic=24110.0)
-[Unknown]