The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Showing thread/post age rather than date?
Hi,
In one of my forums I'd like to display the age of a thread rather than the date it was created on, is there any easy way to do that? Specifically the forum is filled with one-post threads (for sale adverts) and on the threadbit template I have the date of the last post (which is obviously the original post) showing just as 'dd/mm/yyyy' with no other info, but I'd like to change that to an advert age like 'xx days'. I'd also like to have that info in the showthread template too instead of a date. Thanks in advance |
#2
|
||||
|
||||
I think you need to create a plugin that changes the vboptions 'yestoday' to Detailed (value=2) for that forum. So, maybe try the fetch_foruminfo hook location? Something like:
PHP Code:
|
#3
|
|||
|
|||
I wouldn't even know where to begin doing that sorry
I can play about with template mods til the cows come home but with php stuff I'm totally lost |
#4
|
||||
|
||||
Well, the only way to do what you want it through a plugin/php code. If you don't want to try it, I can't really suggest anything else.
|
#5
|
|||
|
|||
No no I will try it, I need to learn, but I don't expect to succeed lol.
What I meant was I don't really know what to do with the code you gave me? |
#6
|
||||
|
||||
You create a new plugin - Plugins & Products > Add New Plugin
Pick a hook location - maybe try fetch_foruminfo like I suggested Title - whatever Execution Order - leave alone Plugin PHP Code - put what I wrote above but put your forumid in where it says xx Plugin is Active - Yes And see what happens in your forum (if it's correct in there, also make sure it is still fine in the other forums). |
#7
|
|||
|
|||
That worked a treat, thank you very much!
Is there a way to change it to be more accurate? So that when a thread is a week or more old it I still get the age in days? |
#8
|
||||
|
||||
I do not think so. I don't use that setting, but on other sites where I have seen it, it does hours up to 24, then days up to 7, then weeks up to ??, and then months. As far as I know, you can't change how it does that (except by probably modifying the php code in the page - not a plugin like we just did).
|
#9
|
|||
|
|||
OK, I'm only gonna use it on this one page so if anyone kew which bit to edit I'd give it a go?
I've noticed a wee problem with the plugin tho in that the 'you last visited...' message in the navbar shows a 'detailed' time on that forum now, it's normal on all the others. |
#10
|
||||
|
||||
Hmmm, you should probably change the hook location then. I'm not sure where to suggest since I'm not sure what pages it is you are wanting to have this detailed time. Is it only on the showthread page? If so, you can probably change the location to "showthread_getinfo". See if that works better for you.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|