This is what I came up with to add an option to the UserCP to allow users to select if they want to show age or not in the calendar.
********
add global phrase
Product: vBulletin
VarName: display_dob_only
Text: Display Date of Birth Only
********
********
template:modifyprofile_birthday added option in two places
Find (in two places)
Code:
<option value="2" $sbselected[2]>$vbphrase[display_age_and_dob]</option>
add under
[code<option value="3" $sbselected[3]>$vbphrase[display_dob_only]</option>[/code]
end template:modifyprofile_birthday
********
********
this fixes the problem where Display Age same as 1 is displaying the birth date on the Members List
file edit memberlist.php
line 631 change from
Code:
if ($userinfo['showbirthday'])
to
Code:
if ($userinfo['showbirthday'] > 1
end file edit memberlist.php
********
********
edit PHP file class_dm_user.php
line 59 change from
Code:
'showbirthday' => array(TYPE_INT, REQ_NO, 'if (!in_array($data, array(0, 1, 2))) { $data = 2; } return true;'),
to
Code:
'showbirthday' => array(TYPE_INT, REQ_NO, 'if (!in_array($data, array(0, 1, 2, 3))) { $data = 2; } return true;'),
end edit PHP file class_dm_user.php
********
********
edit PHP file: functions_databuild.php
change line 1462 from
Code:
SELECT username, userid, birthday
to
Code:
SELECT username, userid, birthday, showbirthday
change line 1466 from
Code:
AND showbirthday = 2
to
Code:
AND showbirthday > 1
after line 1476 add
Code:
$usershowdb = $birthday['showbirthday'];
change line 1478 from
Code:
if ($year > $day[2] AND $day[2] != '0000')
to
Code:
if ($year > $day[2] AND $day[2] != '0000' AND $usershowdb != '3')
end edit PHP file: functions_databuild.php
********
********
File functions_calendar.php
after line 431 add
Code:
$usershowbd = $value['showbirthday'];
change line 433 from
Code:
if ($year > $userday[2] AND $userday[2] != '0000')
to
Code:
if ($year > $userday[2] AND $userday[2] != '0000' AND $usershowbd != '3')
change line 768 from
Code:
SELECT birthday,username,userid
to
Code:
SELECT birthday,username,userid,showbirthday
change line 772 from
to
after line 796 add
Code:
$showbd = $bday['showbirthday'];
end File functions_calendar.php
********
********
edit file calendar.php
add after line 638
Code:
$usershowbd = $value['showbirthday'];
end edit file calendar.php
change line 640 from
Code:
if ($weekyear > $userday[2] AND $userday[2] != '0000')
to
Code:
if ($weekyear > $userday[2] AND $userday[2] != '0000' AND $usershowbd != '3')
change line 1045 from
Code:
SELECT birthday, username, userid
to
Code:
to SELECT birthday, username, userid, showbirthday
change line 1049 from
to
add after line 1056
Code:
$usershowbd = $birthdays['showbirthday'];
change line 1058 from
Code:
if ($year > $userday[2] AND $userday[2] != '0000')
to
Code:
if ($year > $userday[2] AND $userday[2] != '0000' AND $usershowbd != '3')
end edit file calendar.php
********
********
edit file member.php
change line 476 from
Code:
if ($year > $bday[2] AND $bday[2] != '0000')
to
Code:
if ($year > $bday[2] AND $bday[2] != '0000' AND $userinfo['showbirthday'] !='3')
change 495 from
Code:
if ($userinfo['showbirthday'] = 2)
to
Code:
if ($userinfo['showbirthday'] > 1
change 495 from
Code:
if ($userinfo['showbirthday'] = 2)
to [/code]if ($userinfo['showbirthday'] > 1)[/code]
change line 497 from
Code:
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
to
Code:
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000' AND $userinfo['showbirthday'] != '3'
change line 520 from
Code:
if ($bday[2] == '0000')
to
Code:
if ($bday[2] == '0000' OR $userinfo['showbirthday'] == '3')
edit file member.php
********
********
edit file memberlist.php
change line 617 from
Code:
if (date('Y') > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000' AND $userinfo['showbirthday'] > 0)
to
Code:
if (date('Y') > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000' AND $userinfo['showbirthday'] > 0 AND $userinfo['showbirthday'] != '3')
change line 640 from
Code:
if ($today_year > $bday[2] AND $bday[2] != '0000')
to [/code]if ($today_year > $bday[2] AND $bday[2] != '0000' AND $userinfo['showbirthday'] != '3')[/code]
change line 657 from
Code:
else if ($userinfo['showbirthday'] == 2)
to
Code:
else if ($userinfo['showbirthday'] > 1)
change line 663 from
Code:
if ($userinfo['birthday'] == '' AND $userinfo['showbirthday'] == 2)
to [/code]if ($userinfo['birthday'] == '' AND $userinfo['showbirthday'] > 1)[/code]
add after line 673
Code:
else if ($userinfo['showbirthday'] == 3)
{$userinfo['birthday'] = "$bday[0]-$bday[1]";}
end edit file member.php
I'd like to know how'd I'd go about improving the process for installing it for others to use.