Firefox PHP

Module: Automatic Time Zones

Posted by Joe Curia 
Module: Automatic Time Zones v5.2.1.04 - Bugfix for non-javascript browsers
March 27, 2009 10:30PM
I have released v5.2.1.04 of this module with the following changes:

- Bugfix: Previous coding required the user's browser to support javascript. To work around this, the module now checks if the user's browser is capable of supporting javacript before running. If the user has disabled javascript, a meta refresh will kick in after 2 seconds the first time they visit the forum. After that their IP Address will be cached. Thanks go to Phorum user didi2 for reporting this bug.

- Bugfix: Eliminated some PHP notices.

Didi2, this release should address the issues you reported. Thanks for the report and please let me know if you are still seeing problems.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Automatic Time Zones
March 31, 2009 09:06AM
Hi.

Now I get the error code. See attachement.

What could be the problem here?

Thank you!

regards

Edit: Error fixed and attachment removed. Thanks for the report. ~ Joe Curia



Edited 1 time(s). Last edit at 06/21/2010 12:44PM by Joe Curia.
Re: Module: Automatic Time Zones
March 31, 2009 09:31AM
Here is a note from www.php.net on the get_browser() function:
Quote
www.php.net/get_browser
Note: In order for this to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system. browscap.ini is not bundled with PHP, but you may find an up-to-date » php_browscap.ini file here. While browscap.ini contains information on many browsers, it relies on user updates to keep the database current. The format of the file is fairly self-explanatory.

Unfortunately, this is required if you want to be able to use this module and not worry about visitors with non-javascript browsers. If you are not able to edit your php.ini file and add the browscap.ini file, then you will not be able to use this module until I can find another workaround.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Automatic Time Zones
March 31, 2009 11:13AM
Standalone custom php version
bottom three items on right hand side:
[browsers.garykeith.com]
Re: Module: Automatic Time Zones
March 31, 2009 11:19AM
Thank you for hunting that down DavidVB! I will work to implement the standalone version for better compatibility.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Automatic Time Zones
March 31, 2009 02:16PM
Ok, please redownload v5.2.1.04 and give it another try. It should now check if you have the browscap.ini setup on your server and use the standalone version if you do not. Thanks again DavidVB for pointing me to that site!


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Automatic Time Zones
March 31, 2009 02:32PM
It is really needed to replace the start page with the javascript and to detect browser javascript support? I think that I would go for some javascript that is added through the before_footer hook to have some javascript run at the end of the page. Why is it a problem to do it like that? I didn't read the code in detail, but I was wondering why the implementation was done like this.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Automatic Time Zones
March 31, 2009 03:21PM
In order to detect the visitor's time zone, I need to run javascript on their computer. The javascript then either sets a cookie (if possible) or adds the time zone offset to the url. Finally, the user is redirected to their initial entry page. I see two problems in adding/running the javascript from the footer:
  • The page will load and then redirect, thus taking the time to load a Phorum page (not much but still a delay) and that Phorum page will flicker away at the redirect.
  • Before the redirect, the page will be displayed with the incorrect time zone. The visitor may be confused to see post times suddenly changing.

I am always open to suggestions. If you have any ideas how I can do this better, please let me know.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Automatic Time Zones
March 31, 2009 04:24PM
Well, then instead put the javascript bit that is responsible for the redirect in {HEAD_TAGS}. If you put a redirect in that code, then the page won't be loaded. I've done things like that on other sites too and I don't remember seeing flashing pages when handling an early redirect from javascript code at the start of the page. Did you try that route?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Thanks for pointing me in the right direction Maurice. I'm glad there was a simpler way which also avoided an additional 300+ kb worth of standalone browscap code.

I have released v5.2.1.05 of this module with the following change:
- Enhancement: Module rewritten to place the necessary javascript inside the Phorum header. This allows for browsers without javascript to view the page without any negative consequences without the need for the excessive browscap support. Thanks go to Phorum developer Maurice Makaay for pointing me in the right direction on this.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald




Edited 1 time(s). Last edit at 04/01/2009 10:21PM by Joe Curia.
Sorry, only registered users may post in this forum.

Click here to login