MyBB Community Forums

Full Version: Last Post: X Minute(s)/Hour(s) Ago
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
(2009-01-01, 10:22 PM)okitai Wrote: [ -> ]
(2009-01-01, 06:25 PM)I Wrote: [ -> ]Is there a way to "pretty up" the time stamp? If the time is longer then 24 hours, I get something like "Yesterday 12:01". Is there a way to turn it to (for ex.) "Yesterday, at 12:01"?

Please reply. This is, somewhat, important.


Ori...

Yeah. This could be done. Open inc/functions.php
Find following:
if($todaysdate == $date)
		{
			$date = $lang->today;
		}
		else if($yesterdaysdate == $date)
		{
			$date = $lang->yesterday;
		}

Replace with following:
if($todaysdate == $date)
		{
			$date = $lang->today.", at ";
		}
		else if($yesterdaysdate == $date)
		{
			$date = $lang->yesterday.", at ";
		}

That's all.

Modification updated!
Glad you updated it, bro - but don't forget; you need to tell them to also add:
$l['minutes'] = "Minutes";
$l['minute'] = "Minute";
... etc
Otherwise, from the looks of it - it'll look for $lang['minutes'] which doesn't exist.
Don't worry, I checked it. These variables already exist in global.lang.php file Smile
AlrightSmile My bad:p
Lol. No problem Big Grin
Glad someone finally did this:p I have a function a friend made that did this. One question though, does this only do it in minutes?
Yes, this currently only shows minutes, but I can change it to show hours, days etc..
I'd suggest doing so. And I'd also suggest adding:
<abbr title="ACTUAL DATE">x ago here</abbr>
Just a suggestion, though.
Nice ideas. Wrote them down to my to-do listSmile
Good to hearSmile
Pages: 1 2 3 4 5 6