PDA

View Full Version : Displaying Thread Age


Narcootic
11-21-2006, 08:58 PM
Hey Guys,

Could anyone please help me on how to display age of a thread using $thread[dateline] in a format like this: 12 hours Ago or 12 Days Ago depending on how long it has been. I would really appreciate it, I been trying to do this for some time but with no luck.

Thank you.

Iain M
11-22-2006, 07:06 PM
Admin CP -> vBulletin Options -> Date and Time Options -> Datestamp Display Option -> Select 'Detailed' and save :)

Narcootic
11-23-2006, 05:51 PM
Wow thats great, never realised it. Just one more thing. I want to display that information on the forumdisplay where the threads are listed but only for the Thread start and not include the replies in the "Last Post" column. Any ideas?

Thank you for your previous reply!

Iain M
11-25-2006, 03:03 PM
Sorry, I don't really have time to play around with templates atm to see how to do the second part. I guess you could try
Styles & Templates > Style Manager > Edit Templates > Threadbit Templates > threadbit

FIND:
$thread[threadtitle]</a>

AFTER ADD:
- $thread[lastpostdate]

that wouldn't remove it from the Last Post column tho...

while in that template you could remove $thread[lastpostdate] and that should remove it from the last post column... this is untested, make sure you save a copy of your threadbit template incase it doesn't work out :)


Iain

Narcootic
11-25-2006, 03:42 PM
Hi Iain,

What you suggested didn't work originally, just didn't show so I placed it in a different location right after the thread starters name. The thing is, its still showing up the date of the last reply which I didn't want originally. I wanted it to only show the days ago of the original thread start date rather than it updating to the date of each reply in that particular thread.

Is there one something like : $thread[startdate] ?

Many thanks.

Iain M
11-25-2006, 09:02 PM
oops I missread your request :confused:,

I don't there is anything like $thread[startdate] unfortunately,


Iain

Smoothie
11-25-2006, 09:22 PM
Wow thats great, never realised it. Just one more thing. I want to display that information on the forumdisplay where the threads are listed but only for the Thread start and not include the replies in the "Last Post" column. Any ideas?

Thank you for your previous reply!

Here ya go, works fine w/ 3.6.4

https://vborg.vbsupport.ru/showthread.php?t=103430

You can see it in action on my site, link is in signature.

Narcootic
11-26-2006, 07:22 PM
Iain: Not to worry, I constructed my request a bit awkwardly I noticed. Appreciate your interest to help me.

Smoothie: THank you very much for that, its exactly what I wanted. Thank you for the redirect.

Smoothie
11-26-2006, 09:39 PM
Iain: Not to worry, I constructed my request a bit awkwardly I noticed. Appreciate your interest to help me.

Smoothie: THank you very much for that, its exactly what I wanted. Thank you for the redirect.
I added it as a plugin instead of editing functions_forumdisplay.php

Narcootic
11-26-2006, 10:33 PM
I didn't realise until I done it manually. It worked out just fine in the end. Thank you.