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)

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. ^^;;


All times are GMT. The time now is 10:08 PM.

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.01045 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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