PDA

View Full Version : Calendar Date as a Prefix?


MaverickAce
04-22-2009, 01:58 PM
Is there a way to set an automatic calendar date as a prefix for a thread?

Regular prefix:

Sticky: Learn how to code

What I'm looking to do:

April 22, 2009: Learning how to code

So whenever a new thread is created, I want it to have the current date on it.

Thanks

oldengine
05-20-2009, 02:33 PM
Has anyone set up ANY prefix for a calendar title?

Cryo
05-20-2009, 02:59 PM
You can add $thread[dateline] in the threadbit template in the same area prefixes are located. I'm sure there's an easy way to convert that to a readable format, but I don't see date() listed as a safe function for templates.

Lynne
05-20-2009, 05:06 PM
You can add $thread[dateline] in the threadbit template in the same area prefixes are located. I'm sure there's an easy way to convert that to a readable format, but I don't see date() listed as a safe function for templates.
You'd just need a plugin to change the unix timestamp to the format you want.

$thread['dateline'] = vbdate($vbulletin->options['dateformat'], $thread['dateline']);
Something like that. Look up vbdate in the API (link is under Quick Links) and that should help you format it. You may need a couple of plugins - one at threadbit_display and the other at search_results_threadbit.