Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Hj Ahmad Rasyid Hj Ismail on December 23, 2014, 08:10:37 PM

Title: Semasa - Surfer's Live Local Time (Fully Hook!)
Post by: Hj Ahmad Rasyid Hj Ismail on December 23, 2014, 08:10:37 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4004)

Semasa - Surfer's Live Local Time mod

- For 2.0.x
- Fully hook, no file modification.

1. Please do your own backup though every installation is backed up automatically.
2. On default, the time shown in the header (next to the date in user info) is static.
3. This mod will change the time to live, so user can keep to their time while in the forum.
4. All you need to do is turn it on or off in Mod Settings page, save it and you are good to go.
5. You have the option to change the date format. Click here for reference. (http://php.net/manual/en/datetime.createfromformat.php)
6. And the live time can also be shown to guest as well.
7. You can test it in all SMF 2.0.x lower version as IMO it should work just fine. ;)


Thank you for using/testing it.


Yours friendly,
Abu Fahim Ismail.

BSD License. Feel free to modify accordingly but keep author's link if it is in there somewhere. ;)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fvalidator.w3.org%2Fimages%2Fvalid_icons%2Fvalid-xhtml10&hash=f3694497572838dc55641db875ff57107ebabaed)  (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fjigsaw.w3.org%2Fcss-validator%2Fimages%2Fvcss&hash=710d7530f8727db53c62cb8f44abbef39967e693)


#Change Logs

@Version 1.0.1
- Trying to fix undefined index error reported in here (http://www.simplemachines.org/community/index.php?topic=531592.msg3786606#msg3786606).

@Version 1.0.0
- Initial Release.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: NekoJonez on December 24, 2014, 06:33:10 AM
How bad is this on the load time?

Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on December 24, 2014, 08:28:58 AM
Why don't you make a test yourself? That way you will know it better. ;)
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Arantor on December 24, 2014, 10:58:52 AM
I can understand the reason for having a timestamp of when the page loaded so you can see if a tab is old or not... but I don't understand what the appeal of a live clock is... when everyone has one in the corner of their screen :(
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on December 24, 2014, 12:31:07 PM
Me too. Sometimes, I also do not know why people in this age of technology, having a smart phone on their hand (with clock), but still wearing a wrist watch. Both can tell the exact time. Really a strange world, isn't it. ;)
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Arantor on December 24, 2014, 12:36:39 PM
Wearing a wrist watch is largely a status symbol these days - if you can afford a wristwatch of style and expense, you are *rich*. Or classy.

Or you're just old school.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on December 24, 2014, 12:44:24 PM
May be older than that. Orthodox they say.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: WillyP on January 13, 2015, 05:09:16 PM
I just uninstalled it because it was filling the error log with undefined index for guests, even though I had unchecked the box about guests.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on January 14, 2015, 02:34:19 AM
You are not helping your ownself. Please provide details of your errors and which theme are you using since this mod is made mainly for the default theme.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: WillyP on January 24, 2015, 02:00:32 PM
My apologies for being unclear, but I wasn't asking for help.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on January 25, 2015, 04:15:21 AM
Fine with me but your report was also ambigous. If you provided the details and they can be reproduced, may be that could be checked out and fixed. And in consequence, others may benefit from it. But I leave to you. So far that I am concerned, up to date, we are facing no errors.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: WillyP on January 25, 2015, 11:21:41 AM
Sorry if that came off a bit terse.

Anyway here is one of the errors, they were all similar, and guest was turned off in the options.

QuoteGuest

8: Undefined index: time_am
Apply Filter: Only show the errors from this file
File: /nfs/c09/h03/mnt/133072/domains/forum.cog-online.org/html/Sources/Semasa.subs.php
Line: 26
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on January 26, 2015, 11:26:59 PM
Strange indeed. time_am is coming from $txt['time_am'], which is available in default language (i.e. not provided by this mod). $txt is also already globalized. This behaviour also cannot be reproduced in my test forum freshly installed.

One thing that I can do is adding this to the language file. But I am not really sure whether this is necessary. I will test further for this.
Title: Re: Semasa - Surfer's Live Time (Hook Version!)
Post by: Hj Ahmad Rasyid Hj Ismail on February 03, 2015, 01:32:59 AM
Updated to try fixing the reported error(s).


#Change Logs

@Version 1.0.1
- Trying to fix undefined index error reported in here (http://www.simplemachines.org/community/index.php?topic=531592.msg3786606#msg3786606).
Title: Re: Semasa - Surfer's Live Local Time (Fully Hook!)
Post by: Mooby The Golden Sock on November 12, 2016, 08:34:42 PM
Date display is in forum timezone while time display is according to profile settings.  This leads to the wrong date displaying for those members offset from the forum timezone.

For example, my forum's time is set to UTC and my offset is -6. 
With mod disabled:
November 12, 2016, 07:27:43 pm (correct date)

With mod enabled and date code set to F d, Y,:
November 13, 2016, 7:33:55 pm (incorrect date because it is reading off UTC, not UTC -6)