Relative Time 1.1

← News & Stuff — Started 25 Nov, 2010

Relative Time 1.1 is now available for Premium Gecko ID holders only. This is a beta test that is available exclusively for them, but will be released as a free feature at a later date once testing is complete.

Version 1.1 is a big upgrade from the previous version. Not only are there 112 less lines of code in the plugin for the newer version, the way it works has fundamentally changed. Timings are not converted on the server any more, but instead are converted by the browser with javascript - meaning less load and overhead for your forum as all the work happens on the user's local computer. 1.1 also converts more timings to their relative time equivalents - forum subscriptions, thread subscriptions and other areas if the User CP are all converted too.

If these new areas weren't converted, 1.1 would also contain 9 less plugin hooks. However, it still has 4 less plugin hooks than 1.0 does - further decreasing the load effects of the feature. The new version also automatically updates the relative time as the time goes by. For example, if a post was made 3 minutes ago, it will update to 4 minutes ago, 5 minutes ago, 6 minutes ago etc. automatically inline without reloading the page.

So really, Relative Time 1.1 not only does more and updates inline, it reduces load from the server in less code and less hooks. Awesome.

Although I've wanted to do inline relative time for a while, a thread by Kier (from Xenforo) highlighted caching issues with search engines that I didn't think of. With this in mind, only users with javascript enabled sees relative time - users that don't have javascript enabled, and search engines, will see MyBB's default timings.

Upgrading
First, remove Relative Time by going to the MyNetwork Overview, selecting Core, then select Remove/Disable from the feature's Options menu. You can remove the files too, however they'll be overwritten in the next step.

Once removed, download the new version and upload to the root folder of your forum (or keeping the folder's structure intact). Then head back to the MyNetwork Overview and install the feature.

There is no 'upgrade path' to this feature. The changes occur automatically.

Using Relative Time outside MyNetwork
Relative Time can be used anywhere outside of MyNetwork - but a post on this will be made at a later time once testing has been completed. If you're using other plugins which alter pages with the javascript already pre-loaded, for example, showthread.php and xThread's firstpost feature, just through a span tag around the time and date with the raw thread dateline as a class and it should be converted. For example:

Code:
{$post['postdate']}, {$post['posttime']}

... in the postbit template can be changed to the following for relative time:

Code:
<span class="rt_inline {$post['dateline']}">{$post['postdate']}, {$post['posttime']}</span>

{$post['dateline']} is the raw Unix timestamp that is used to start the clock for the relative time, and is required in the class field. It's not particularly perfect, but as Kier put it perfectly, you never grow tired watching the times update.

Changes
Version 1.1 introduces a new "Cap Relative Time" setting that allows you to control how far the relative time goes. You can check this out by heading to the Relative Time Support area, but essentially it helps control whether hours, days, weeks or months appear. You can alter this setting in the Date & Time settings.

Although this release has passed internal testing, and is active here on Xekko, please treat this as a beta version. If you come across any issues, please post them here to let us know, and we'll get to them as fast as we can. If you're don't already have a Premium Gecko ID - remember to upgrade (it buys me a beer! Tongue).
3  
Reply
Thanks for the update Smile

And love the way i got an email about the upgrade. Installed and working on my forum.
WOOOO love xekko Heart
0  
Reply
leesester
25 Nov, 2010, 7:20 pm (This post was last modified: 25 Nov, 2010 8:03 pm by leesester.)
Hi Tomm, I don't know if its connected, but I got a message on the home page that there were new posts and threads....and there are not. Also, the relative time thread shows as no replies - but Ryanstuff has replied.

..... Sad

I check in EVERY day, so its not new posts from a while ago.

forumdisplay threadlist updated AS I TYPED - truly relative Tongue

and 42 minutes later - all is good again. How odd.

Attached File(s) Thumbnail(s)
   

[Image: leelink.gif]
0  
Reply
I noticed that too, but couldn't put my finger on it. A quick recount rebuild has reset the counters, but have no idea why it happened. I blame Ryan. Tongue

Glad you like the feature - I love it! There's a few more stocking fillers coming soon too I hope...
0  
Reply
Sad what why i get the blame? hmm werid error that happened.

I am always looking forward to new feature's you bring out Tongue
WOOOO love xekko Heart
0  
Reply
Because it only happens when you post... Tongue

It's happened again too, there's 4 replies in this thread and it only says 3. Are you using a strange browser, and posting in quick reply?
0  
Reply
Ah i know why, will stop using quick reply Tongue


I have IE9 beta Tongue so when we use quick reply it makes two posts so i have to delete one, so when i delete it its not updating the reply count to put it down one..

So you were right to blame me :L will use normal reply now Smile
WOOOO love xekko Heart
0  
Reply
Looks very very fine, I'm not premium I will wait to the final. Smile
THANKS a LOT Big Grin
1  
Reply
Another great job, Tomm! Will this remain hours only, or will you add in days, weeks, months, etc?
0  
Reply
You decide that devinb - if you edit the Date & Time settings in your ACP, you'll see a 'Cap Relative Time?' setting. This is currently set for the current hour here - meaning that it will only show minutes ago. If you set it to 'Today', then it will show minutes and hours ago. If you don't cap relative time, it will show minutes, days, weeks, months and years ago.

Smile
0  
Reply

User(s) browsing this thread: 2 Guest(s)