The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Member's Age in Postbit & Getinfo Profile (automatically calculated from birthday) Details »» | |||||||||||||||||||||||||||
Member's Age in Postbit & Getinfo Profile (automatically calculated from birthday)
Developer Last Online: May 2013
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
|
Comments |
#47
|
||||
|
||||
Fun Erwin
|
#48
|
||||
|
||||
I noticed something, with the Age in the profile thingy, it says
Age: Age:16 How can I make it say Age: 16 ? Thankx |
#49
|
||||
|
||||
Oops.
In members.php, find: PHP Code:
PHP Code:
https://vborg.vbsupport.ru/showthrea...103#post290103 The hack for the postbit remains unchanged, and works. |
#50
|
|||
|
|||
Installed and working on 2.2.9! Excellent!
|
#51
|
||||
|
||||
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?
|
#52
|
|||
|
|||
Thanks a lot, great hack!
|
#53
|
||||
|
||||
~ clicks install..... I have plans for this
|
#54
|
|||
|
|||
installs
|
#55
|
||||
|
||||
Erwin, is there any way to make $age = "Age: $userage<br>"; template controlled without the queries shooting up?
I did it like this: Code:
// Age in postbit - Erwin $bday = explode("-",$post[birthday]); if (date("Y")>$bday[0] and $bday[0]>1901 && $bday[0]!='0000') { $userage= date("Y") - ($bday[0]+1); if (date("m")>$bday[1] OR (date("m")==$bday[1] AND $bday[2]<=date("d"))) { $userage=$userage+1; } eval("\$age = \"".gettemplate("age")."\";"); } // Age in postbit Many thanks, Oblivion Knight. |
#56
|
||||
|
||||
Add
age to the $templatesused=" section in showthread.php under the POSTBIT section. |
#57
|
||||
|
||||
Quote:
I tried this and the queries still stay much higher than they were before. It doesn't help that I'm not feeling well at the moment I guess.. :sleep: |
#58
|
||||
|
||||
There are 2 templatesused="
in showthread.php Put that template "age" in both of them and see if it helps. Yes, you need to use your code for templates to be used. By caching the template, you should not incur any queries at all. It can be done. |
#59
|
||||
|
||||
Well I'll be.. I could have sworn I tried that.
Until the new template is added, the queries stay higher than they should be (probably something I forgot last time). Then once it's added, the queries return to normal. |
#60
|
||||
|
||||
Glad to know it works, and it does not add any queries.
|
#61
|
||||
|
||||
Added this hack a while back. Works great and like someone said above, I too have plans for this. ^^;;
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|