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
  #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
  #47  
Old 09-16-2002, 12:07 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fun Erwin
Reply With Quote
  #48  
Old 10-15-2002, 02:07 AM
\ \ - Speedy - / /'s Avatar
\ \ - Speedy - / / \ \ - Speedy - / / is offline
 
Join Date: Nov 2001
Location: Speedy's World
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I noticed something, with the Age in the profile thingy, it says

Age: Age:16

How can I make it say

Age: 16

?

Thankx
Reply With Quote
  #49  
Old 10-15-2002, 02:10 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops.

In members.php, find:

PHP Code:
           $age "Age: $userage<br>"
Replace with:

PHP Code:
           $age "$userage"
This fix only affects this hack if you put it in your Member Profile as in this post (which I've fixed):

https://vborg.vbsupport.ru/showthrea...103#post290103

The hack for the postbit remains unchanged, and works.
Reply With Quote
  #50  
Old 01-21-2003, 06:07 PM
sunrunner_pei sunrunner_pei is offline
 
Join Date: Jan 2003
Location: PEI, Canada
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working on 2.2.9! Excellent!
Reply With Quote
  #51  
Old 06-05-2003, 02:43 PM
Tungsten's Avatar
Tungsten Tungsten is offline
 
Join Date: Jan 2002
Location: Nashville, TN
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I go about adding this to the Admin CP so that when I edit a user's profile I can see their age calculated next to where it shows their birthdate?
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 12:07 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.10979 seconds
  • Memory Usage 2,322KB
  • Queries Executed 25 (?)
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
  • (6)bbcode_php
  • (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_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