PDA

View Full Version : On Showthread?thread start time?


darnoldy
05-06-2015, 05:22 PM
I am looking to call thread start time and last post time from the showthread page.
Actually, I want to put them into:
<meta property="article:published_time" content="2013-09-17T05:59:00+01:00" />
<meta property="article:modified_time" content="2013-09-16T19:08:47+01:00" />

Are those values already available as variables, or do i need a plugin to fetch them?

kh99
05-06-2015, 09:14 PM
They are available as $thread[dateline] and $thread[lastpost], but they are unix timestamp format, so you'd need a plugin to format them like you want them. I think you could use a plugin using hook showthread_complete and code like this:

$published_time = date(DATE_ATOM, $thread[dateline]);
$modified_time = date(DATE_ATOM, $thread[lastpost]);

then use $published_time and $modified_time in the SHOWTHREAD template.

darnoldy
05-07-2015, 02:51 AM
Thanks, kevin. That does the trick!