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
  #32  
Old 08-25-2002, 07:50 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Tha Rock
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
That's weird, and has nothing to do with my hack. Looks like somewhere along the line something went wrong. My hack just displays the member's age - it doesn't touch the database or make a query.
Reply With Quote
  #33  
Old 08-25-2002, 08:41 AM
PsYc PsYc is offline
 
Join Date: Mar 2002
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks erwin, for the fix works now
Reply With Quote
  #34  
Old 08-25-2002, 09:19 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're welcome.
Reply With Quote
  #35  
Old 08-27-2002, 01:40 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack, was looking for something like that. Do you know how I can show this on a members page that's outside of vB?
Reply With Quote
  #36  
Old 08-27-2002, 07:35 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Intex
Great hack, was looking for something like that. Do you know how I can show this on a members page that's outside of vB?
Outside of vB? That's going to take a major rework of the code (remember, this code uses no queries). I don't know... anyone has any idea?
Reply With Quote
  #37  
Old 09-07-2002, 11:11 AM
PHiXTiT PHiXTiT is offline
 
Join Date: Sep 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great work! (INSTALLED)

Thanks
Reply With Quote
  #38  
Old 09-07-2002, 03:38 PM
PHiXTiT PHiXTiT is offline
 
Join Date: Sep 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just noticed that after installing this I had to move the admin/functions.php to a different area within as i lost the profile option in my postbit. No bigee, works great! Thanks
Reply With Quote
  #39  
Old 09-07-2002, 09:16 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by PHiXTiT
Just noticed that after installing this I had to move the admin/functions.php to a different area within as i lost the profile option in my postbit. No bigee, works great! Thanks
I have no idea what you just said there, but whatever it is, it's not because of this hack - this hack is placed in the place in functions.php that decides what to put in the postbit - the code of the hack itself is just a simple mathematical calculation that uses up no database query and does not interfere with any other lines of code in functions.php - unless you have another hack in functions.php that uses the same variables.

Bottom line - this hack works fine with no problems - the problem you had (whatever it is) is not because of this hack.
Reply With Quote
  #40  
Old 09-08-2002, 01:19 AM
PHiXTiT PHiXTiT is offline
 
Join Date: Sep 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well this was the first hack I installed on a clean 2.2.7 board and when modifying the admin/functions.php I lost the profile button on my postbit. I retried it a couple times and same thing.
So I bumped the area to be pasted a couple lines up and all is working great now.
Just so you know my postbit template is highly modified just for looks.
I was just pointing this out so that if others are having any problems in 2.2.7 to try what i did.
Great hack though, comes in handy.
Reply With Quote
  #41  
Old 09-12-2002, 03:20 PM
Buddha Buddha is offline
 
Join Date: Jan 2002
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

um... i know this is a simple hack, but i'm getting this error...

Quote:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/fulldvdr/public_html/admin/functions.php on line 929

Fatal error: Call to undefined function: vbdate() in /home/fulldvdr/public_html/admin/sessions.php on line 403
line 929 is

Quote:
$buffer = str_replace(""", "\"", $buffer);
and line 203 in sessions is the last line in this quote

Quote:
// get formatted date/time
if ($bbuserinfo['lastvisit']) {
$bbuserinfo['lastvisitdate'] = vbdate($dateformat." ".$timeformat,$bbuserinfo['lastvisit']);
???
Reply With Quote
  #42  
Old 09-12-2002, 07:33 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I can guarantee that this error is not from my hack, but from your mistake, either in applying this hack, or in upgrading to 2.2.7 or some other thing you did. Like you said, this hack is as simple as it gets. You can basically uninstall this hack, and do it again, or try this.

Find this bit of code (basically what you posted in your post at the end):

PHP Code:
// get formatted date/time
if ($bbuserinfo['lastvisit']) {
$bbuserinfo['lastvisitdate'] = vbdate($dateformat." ".$timeformat,$bbuserinfo['lastvisit']); 
Add this right underneath:

PHP Code:

See if that works. You may have forgotten to close a function somewhere.
Reply With Quote
  #43  
Old 09-12-2002, 09:39 PM
Buddha Buddha is offline
 
Join Date: Jan 2002
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks erwin... naw, it's closed up... i just posted those three lines to show which line had the error.

i know it's not your hack (it's unbelievably easy), but thought that maybe you (or someone else) might know.

thanks anyway.

edit... did the file modifications at home and it worked. must have had something to do with the browser based cp that i was using to do the hack at work, cause i did it three times (being very careful) and each time got the same result... ah well, works now... that's all that mattters. thanks.

*clicks installed*
Reply With Quote
  #44  
Old 09-12-2002, 11:28 PM
PHiXTiT PHiXTiT is offline
 
Join Date: Sep 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It worked just fine for me (the users age and all) Except I lost the profile button in my postbit.
For those of you that may run into the same problem here is what I did instead of what was stated to do with the admin/functions.php to solve this issue, I did the following and all is working great on my 2.2.7 Board!

### Open admin/functions.php ###

### Find ###
PHP Code:
if ($post[yahoo]!="") {
            eval(
"\$post[yahooicon] = \"".gettemplate("yahoo")."\";");
        } else {
            
$post[yahoo]="";
        } 
### After add ###
PHP Code:
// Age in postbit - Erwin
        
$bday explode("-",$post[birthday]);
        if (
date("Y")>$bday[0] and $bday[0]>1901 && $bday[0]!='0000') {
            
$useragedate("Y") - ($bday[0]+1); 
            if (
date("m")>$bday[1] OR (date("m")==$bday[1] AND $bday[2]<=date("d"))) {
                
$userage=$userage+1
                } 
           
$age "$userage<br>";
        }
// Age in postbit 
### Save and Close admin/functions.php ###
Reply With Quote
  #45  
Old 09-15-2002, 04:35 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've found a simple script to echo Roman numbers, i'll attach it.

maybe you can let this work with this mod, would be great.
Reply With Quote
  #46  
Old 09-15-2002, 10:23 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mmm... I'll have a look... but wouldn't it be a hassle for members to have to work out what the Roman numerals stand for? My age is VIIVMXCII... ???
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 06:17 PM.


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.23265 seconds
  • Memory Usage 2,375KB
  • Queries Executed 30 (?)
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
  • (4)bbcode_php
  • (6)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
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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_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