vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Member's Age in Postbit & Getinfo Profile (automatically calculated from birthday) (https://vborg.vbsupport.ru/showthread.php?t=42050)

Erwin 09-12-2002 07:33 PM

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.

Buddha 09-12-2002 09:39 PM

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*

PHiXTiT 09-12-2002 11:28 PM

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 ###

NuclioN 09-15-2002 04:35 PM

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. :)

Erwin 09-15-2002 10:23 PM

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... ??? :D

NuclioN 09-16-2002 12:07 AM

Fun Erwin ;)

\ \ - Speedy - / / 10-15-2002 02:07 AM

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

Age: Age:16

How can I make it say

Age: 16

?

Thankx

Erwin 10-15-2002 02:10 AM

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. :)

sunrunner_pei 01-21-2003 06:07 PM

Installed and working on 2.2.9! Excellent!

Tungsten 06-05-2003 02:43 PM

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? :D

Buczilla 06-18-2003 12:21 AM

Thanks a lot, great hack!

insanctus 06-23-2003 05:20 AM

~ clicks install..... I have plans for this :)

FWF 07-10-2003 03:35 AM

installs

Oblivion Knight 07-18-2003 11:30 AM

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

But it added many many more queries on top of the usual (obviously, it requires that template everytime a birthday is shown).. I looked for a $templatesused variable, but there isn't one in admin/functions.php.. I'm still learning how to do these basic things, sorry!

Many thanks,
Oblivion Knight.

Erwin 07-18-2003 12:39 PM

Add

age

to the $templatesused="

section in showthread.php under the POSTBIT section. :)

Oblivion Knight 07-18-2003 05:10 PM

Quote:

Today at 02:39 PM Erwin said this in Post #55
Add

age

to the $templatesused="

section in showthread.php under the POSTBIT section. :)

Do I keep my code AND follow your step?
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:

Erwin 07-19-2003 03:40 AM

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.

Oblivion Knight 07-21-2003 09:49 AM

Well I'll be.. I could have sworn I tried that. :p
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.

Erwin 07-21-2003 11:42 AM

Glad to know it works, and it does not add any queries. :)

Red Blaze 10-03-2003 03:00 PM

Added this hack a while back. Works great and like someone said above, I too have plans for this. ^^;;

PAINTBALLM 10-07-2003 08:50 AM

installed, thanks!

patriciafrankie 10-11-2003 11:39 PM

Awesome hack! I'm having a problem installing it on one of my themes, though. I have everything entered in correctly, but I still get Age: Age: 21.

I have no idea why it's doing this. Any suggestions?

Patricia

Erwin 10-12-2003 04:02 AM

Quote:

Originally Posted by patriciafrankie
Awesome hack! I'm having a problem installing it on one of my themes, though. I have everything entered in correctly, but I still get Age: Age: 21.

I have no idea why it's doing this. Any suggestions?

Patricia

Just edit your posbit and remove "Age:".

patriciafrankie 10-12-2003 06:15 AM

Thank you so much! :D I have another question: when I remove Age: from the postbit, I have a space in between the edge of the table/box and the letter "A" I've been wracking my brain all night trying to fix it :(

Patricia

I took the "Age:" part out, and doing so messes up the way it should look on the forum as far as colors go.

Here's a picture of the second "Age:" and a pic of it removed. Removing it changes the colors :(

Erwin 10-13-2003 01:25 AM

Try removing Age: from the code then. It's one or the other, you can't have it in the code and the template. :)

007 05-22-2004 11:06 PM

What changed in this for VB3? I thought it would work just find but it didn't. What needs to be changed for it to work? Thanks.

Boofo 05-23-2004 01:24 AM

Quote:

Originally Posted by 006
What changed in this for VB3? I thought it would work just find but it didn't. What needs to be changed for it to work? Thanks.

vB3 has the age in postbit built-in and I released an Age in Profile hack for vB3. ;)

ZiRu$ 08-01-2004 06:09 AM

Installed and working on vb 2.3.5

TeenageWorld 08-06-2004 09:23 PM

I like this hack, so that's why I installed it, easy install.

- Teenage World

/me click's install


All times are GMT. The time now is 11:41 AM.

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.01462 seconds
  • Memory Usage 1,798KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete