PDA

View Full Version : a postbit mod


JarkkoL
12-07-2009, 08:47 AM
Hi,

I would like to implement a postbit mod, which reads posters custom field which has a date and calculates the number of years that has elapsed since the date. Then uses this year number to add a specific image to postbit_legacy template (e.g. if number of years is 3, the image is image_3.png). I found out how to add an image which uses custom field to the template, but don't know how to do the "number of years" calculations and what would be proper way to implement this. Can anyone point me to right direction?

Thanks, Jarkko

Lynne
12-07-2009, 02:30 PM
Most dates are stored in unixdate format. vbulletin has a variable NOW() which is the current date/time. So, just subtract the two and then convert (look up vbdate in the API maybe?).