vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Auto-calculating by days (custom profile fields) (https://vborg.vbsupport.ru/showthread.php?t=282260)

kelly1357 04-30-2012 09:18 PM

Auto-calculating by days (custom profile fields)
 
Is there a mod or does anyone know of a way to auto-update numerical values based on the number of days passed?

I'm trying to create two custom profile fields that reflect the age of a user's character, in both months and years, but the in character calendar is not based on real time, so one month would need to auto-updated every, say, 17 days.

Any advice?

kh99 05-01-2012 05:39 PM

Well, you might be able to do it the same way that birthdays are done. That is, the birth date is stored then age is calculated using the current date and birth date. You don't have to use real dates for the "current" date. In fact if you're working with the same months as in real life you could probably fake the years if you wanted by adding/subtracting some constant before doing the calculations (otherwise the year will have to be between 1970 and 2034 for the date functions to work).

kelly1357 05-09-2012 10:29 PM

Hmm. Okay, thanks.

Where would I find the code to modify the birthdays?

I have absolutely no clue how to do any of that, but my friend does - we just need to know where to find it.


All times are GMT. The time now is 03:31 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.02135 seconds
  • Memory Usage 1,704KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete