vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Add option to UserCP for age display selection (https://vborg.vbsupport.ru/showthread.php?t=122832)

louis_chypher 08-02-2006 03:34 PM

Add option to UserCP for age display selection
 
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
Code:

showbirthday = 2
to
Code:

showbirthday > 1
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
Code:

showbirthday = 2
to
Code:

showbirthday > 1
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.

cavyspirit 08-18-2006 06:48 PM

I need to be able to suppress the year and age for my members under 21.

I really don't get why that isn't an option.

This feels like a major pain the butt to fix.

I'd settle for removing the age and year totally for everyone, but leaving the birthday. I can't turn off the year, because I need COPPA registration.


All times are GMT. The time now is 03:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01142 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (46)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete