Post Dates

I like this thing except for one change. It doesn't mention the number of minutes ago the post was posted.

Yea, I agree. I think anything posted within the last 59 minutes should retain the "xx minutes ago" with the time of post. Also anything posted on the same date as the current one should still be labeled as "today" with the time. My main concern, and the reason I voted, was the posts that have the date listed as "2 weeks ago" etc are not accurate at all. Now I have to look at my clock every time I want to see exactly how long ago something that is recent was posted. I don't know how everyone else feels about this, am I alone with Jhong here?

Also something else was that in a specific forum, there are no dates at all for when a thread was started. Like in the speedcubing forum for example, the only information given is the person who started the topic and the date/time of the last posting, but nothing of when the thread was started.
 
I like this thing except for one change. It doesn't mention the number of minutes ago the post was posted.

Yea, I agree. I think anything posted within the last 59 minutes should retain the "xx minutes ago" with the time of post. Also anything posted on the same date as the current one should still be labeled as "today" with the time. My main concern, and the reason I voted, was the posts that have the date listed as "2 weeks ago" etc are not accurate at all. Now I have to look at my clock every time I want to see exactly how long ago something that is recent was posted. I don't know how everyone else feels about this, am I alone with Jhong here?

Also something else was that in a specific forum, there are no dates at all for when a thread was started. Like in the speedcubing forum for example, the only information given is the person who started the topic and the date/time of the last posting, but nothing of when the thread was started.

I'm with you. Anytime under an hour should show the original "17 minutes ago", and any time over an hour should show the time.
 
I'd sort of like to see anything within the last 24 hours as "XYZ ago", but retain this for older posts. Is this a possibility? Or even better would be BOTH at once, but that might be too cluttered.
 
I agree with Bob. I still like the "X minutes ago" or "Y hours ago" thing, because it was a good way to get a feel for when things were posted. The reason I like the date format is that for anything over a day ago the "X [unit] ago" style used to be extremely vague, but for dates less than 24 hours ago this isn't a problem since we have at least precision to the nearest hour.
 
I agree with Bob. I still like the "X minutes ago" or "Y hours ago" thing, because it was a good way to get a feel for when things were posted. The reason I like the date format is that for anything over a day ago the "X [unit] ago" style used to be extremely vague, but for dates less than 24 hours ago this isn't a problem since we have at least precision to the nearest hour.
This would require some modification for sure, and I'm not sure exactly how I'd go about doing it. I will look into it, but I can't guarantee anything soon.
 
After reading this, I decided to play around with it a bit since I had just installed a WAMP server and I've never experienced tinkering with vBulletin before.

So I went and installed vBulletin, and played with the AdminCP.
After setting the "Date and Time Options" to "Detailed", which seemed to be the previous setting here, I managed to get the text "x Minutes/Days/etc. Ago" whenever I would use $post[postdate] in a template.

Combined with the epoch value from $post[dateline], I managed to create a small modification (a messy hack, actually) with the following behavior... well, pictures speak louder than words:



Basically, it does the xxx ago thing when it's within the same day or week, and it also shows the time if it's more than a day ago. If it's a week or more ago (or in the future) it just shows the date and time of the post, although in GMT, since it's just Javascript generated (I haven't figured out how to insert PHP code in the templates, without manually doing it in notepad or whatever, nor can I figure out how to get the $post[postdate] value when the setting is not "Detailed" which would be the best option, as it would include the user's timezone).

If you or anyone else is interested... the way I did this hack was:
EDIT: DON'T DO THIS HACK, IT'S FUGLY. Read post below for a better one.

From AdminCP -> Styles & Templates -> Style Manager
-> Select "Edit Templates" from the dropdown of the current style
-> expand "Postbit templates"
-> edit "postbit"

And then I just found the text enclosed in the green box in the picture below, and replaced $post[postdate] with the entire javascript section enclosed in the red box in the linked picture below.



This hack is only for posts though. The thread list (forumdisplay) and the main index still do the xxx ago for any thread.
And this is in vBulletin 3.8.1 by the way, so I can't guarantee compatibility. From the original info that I read, they used $post[date] instead of $post[postdate], so that might help.
 
Last edited:
Okay, I managed to do that modification in a much cleaner way.

Forget the template hack with JavaScript earlier, this is a better way of achieving that, that blends well into the vBulletin code.
(Almost, I had to ignore the "format" parameter though)
It includes the user's timezone, and is visible everywhere, thread list, main page and whatnot.

If you're interested, here are the steps:
1) Go to your forum directory, then open the includes directory
2) Backup the functions.php file. We're gonna be modifying it, so the md5 will be changed and validator.php and md5_sums_vbulletin.php might be messed up, if they'll ever be used again.

3) Open up functions.php, and look for the function vbdate() and make the modifications in the picture,
- or you can just look for the line numbers and make the modifications in the picture.
- OR you can just download my modified version of functions.php and use that instead.
- OR you can send me the functions.php, and I can do it for you.

Linked picture containing modifications:

(Highlighted lines are the ones)

4) Set the date and time options in the AdminCP to "detailed".

Note: attached functions.php is for vBulletin 3.8.1, might be incompatible.
 

Attachments

I was a bit bored so I managed to clean up the mod even further...

If anyone is interested what I did, a simple way to apply it would be:
- Open up forum/includes/functions.php
- After backing it up, go to function vbdate at line 3705 (for vBulletin version 3.8.1)
Find the following code block:
Code:
				else if ($timediff < 172800)
				{
					$returndate = $vbphrase['1_day_ago'];
				}
				else if ($timediff < 604800)
				{
					$returndate = construct_phrase($vbphrase['x_days_ago'], intval($timediff / 86400));
				}
				else if ($timediff < 1209600)
				{
					$returndate = $vbphrase['1_week_ago'];
				}
				else if ($timediff < 3024000)
				{
					$returndate = construct_phrase($vbphrase['x_weeks_ago'], intval($timediff / 604900));
				}
				else
				{
					$returndate = $datefunc($format, $timestamp_adjusted);
				}
			}
			else
			{
				$returndate = $datefunc($format, $timestamp_adjusted);
			}

And replace it with this code block:
Code:
				else if ($timediff < 172800)
				{
					$returndate = $vbphrase['1_day_ago'];
					$returndate .= ", " . $datefunc($vbulletin->options['timeformat'], $timestamp_adjusted);
				}
				else if ($timediff < 604800)
				{
					$returndate = construct_phrase($vbphrase['x_days_ago'], intval($timediff / 86400));
					$returndate .= ", " . $datefunc($vbulletin->options['timeformat'], $timestamp_adjusted);
				}
				else
				{
					$format = $vbulletin->options['dateformat'] . " " . $vbulletin->options['timeformat'];
					$returndate = $datefunc($format, $timestamp_adjusted);
				}
			}
			else
			{
				$format = $vbulletin->options['dateformat'] . " " . $vbulletin->options['timeformat'];
				$returndate = $datefunc($format, $timestamp_adjusted);
			}

- Then set the date/time options to detailed, and you're done.
 
Would it be possible to implement bundat's idea? I've seen a lot of unnecessarily bumped threads since this new system took effect.
 
Back
Top