View Full Version : a postbit mod

07 Dec 2009, 09:47

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

07 Dec 2009, 15:30
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?).