vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Calling these two functions within template? (https://vborg.vbsupport.ru/showthread.php?t=211883)

robertpro2a 04-22-2009 02:48 AM

Calling these two functions within template?
 
Hi,
I have a variable in my "results_bit" like this:

$row[column_2];

It's a unix timestamp, so I'd like to format it into a time/date. I know I can do it in Smarty so I imagine I can do it with VBulletin.

The other function I request is to get the username string from this variable:

$row[user_id];


Is this possible? Thanks!

Lynne 04-22-2009 02:54 AM

You may want to bookmark the API - http://members.vbulletin.com/api/

Look up vbdate for your date/time (also, look for examples of it's use in the code). For the username, you may want to fetch it directly in your query (just JOIN to the user table if you need to).

Dismounted 04-22-2009 07:02 AM

Remember that the admin has specified a timestamp style they want to use - so use the vBulletin option variable for the date output style.


All times are GMT. The time now is 08:02 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.00936 seconds
  • Memory Usage 1,710KB
  • 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