Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Member's Age in Postbit & Getinfo Profile (automatically calculated from birthday) Details »»
Member's Age in Postbit & Getinfo Profile (automatically calculated from birthday)
Version: 1.00, by Erwin Erwin is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 08-07-2002 Last Update: Never Installs: 64
 
No support by the author.

Member's Age in Postbit & Getinfo Profile - by Dr. Erwin Loh
--------------------------------------------------------------------------

I requested this a while back. Since no one has released a hack like this, I worked out how to do it.

NOTE: This hack automatically shows the age of the person calculated from the birthday entered (it's not a separate input). If there is no birthdate or birthyear, the age doesn't show up automatically.

1) Postbit hack
-------------------

This hack basically places the member's age underneath his join date (or wherever you want) in the postbit, like this:


Registered: July 2000
Age: 18
Location: USA
Posts: 102


If the member has not entered his birth-year, then the age will NOT show up at all, like this:


Registered: July 2000
Location: USA
Posts: 102


This hack requires 1 file edit (functions.php), and 1 template edit (postbit).

2) Getinfo Profile hack
----------------------------

This adds the member's age in their profile.

I've added this to the installation text file. It's a matter of editing members.php and the getinfo template.

Installation text file here:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-20-2002, 05:17 AM
Mr. X's Avatar
Mr. X Mr. X is offline
 
Join Date: Oct 2001
Location: Iowa
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, just installed it.
Reply With Quote
  #23  
Old 08-23-2002, 03:37 PM
NSeXcellent NSeXcellent is offline
 
Join Date: Jan 2002
Location: Tampa Bay
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm.. i installed it, but nothing shows up. I've gone back over it 4 times to make sure its right. Still nothing.. any clue?
Reply With Quote
  #24  
Old 08-23-2002, 03:43 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Work Erwin, thanks
Reply With Quote
  #25  
Old 08-23-2002, 03:52 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by NSeXcellent
Hmm.. i installed it, but nothing shows up. I've gone back over it 4 times to make sure its right. Still nothing.. any clue?
Did you put $age in your postbit? It works if you follow the instructions closely...
Reply With Quote
  #26  
Old 08-23-2002, 11:49 PM
eXtremeTim eXtremeTim is offline
 
Join Date: Jun 2002
Location: eXtremewebtech.com
Posts: 1,201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not bad. Nice and simple. I will proble also install this one once i get my site back up and running.
Reply With Quote
  #27  
Old 08-24-2002, 12:39 PM
NSeXcellent NSeXcellent is offline
 
Join Date: Jan 2002
Location: Tampa Bay
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Erwin


Did you put $age in your postbit? It works if you follow the instructions closely...
Of course. Its only 2 steps. How could I forget that. I'll figure it out. I couldnt have screwed up TOO much
Reply With Quote
  #28  
Old 08-24-2002, 02:40 PM
PsYc PsYc is offline
 
Join Date: Mar 2002
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cann someone help me with this code?

i have this in my member.php

to show the userage in members profile but when i view several profiles they are older than their birthday is

---------------------------

// Set userage !
if ($bbuserinfo[birthday] == '0000-00-00') {
$userage = "N/A";
} else {
if (date("Y")<$bday[0] or $bday[0]<1901 or $bday[0]=='0000') {
$userage = "N/A";
}
}

if ( ($userage!="N/A") ){
if (date("m")>=$bday[1] and date("d")>=$bday[2]) {
$userage=(date("Y")-$bday[0]);
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
} else {
$userage=(date("Y")-$bday[0])+1;
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
}

}


if ( ($userage!="N/A") ){
if (date("m")>=$bday[1] and date("d")<=$bday[2]) {
$userage=(date("Y")-$bday[0]);
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
} else {
$userage=(date("Y")-$bday[0])+1;
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
}

}

if ( ($userage!="N/A") ){
if (date("m")<=$bday[1] and date("d")<$bday[2]) {
$userage=(date("Y")-$bday[0])-1;
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
} else {
$userage=(date("Y")-$bday[0]);
eval("\$getinfo_userage = \"".gettemplate("getinfo_userage")."\";");
}

}

--------------------------------------------

Birthday: 23.09.1982
Age: 20


^^ you see? he is older but its still August right?

anyone who knows how to fix this?
Reply With Quote
  #29  
Old 08-24-2002, 06:52 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found something wrong!

A user set his birthdate to be in 1969 and it says he's 84 in the postbit
Reply With Quote
  #30  
Old 08-24-2002, 06:55 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok Very strange I just checked his full profile in adminCP:

1918-06-12

That's what's set for his birthdate which means the 84 is RIGHT but in his PROFILE it says 1969, why does it say that
Reply With Quote
  #31  
Old 08-25-2002, 07:47 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code removed from this post, and added to the TEXT installation file.
Reply With Quote
Reply


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 04:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04526 seconds
  • Memory Usage 2,308KB
  • Queries Executed 27 (?)
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
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (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_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete