Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 08-02-2006, 03:34 PM
louis_chypher's Avatar
louis_chypher louis_chypher is offline
 
Join Date: Mar 2006
Location: Boise, Idaho
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:15 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.03056 seconds
  • Memory Usage 2,238KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (46)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete