PDA

View Full Version : Calling these two functions within template?


robertpro2a
04-22-2009, 02:48 AM
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.