Module: Automatic Time Zones
Posted by Joe Curia
April 02, 2009 03:25AM |
Admin Registered: 18 years ago Posts: 8,532 |
Re: Module: Automatic Time Zones April 02, 2009 05:23AM |
Registered: 15 years ago Posts: 35 |
December 02, 2009 08:25PM |
Registered: 13 years ago Posts: 115 |
Hello,
In function phorum_mod_automatic_timezones_start_output() I inserted an isset() check on your 'offset_by_ip' index. No big deal but when I am debugging and I have php report notices and warnings, might as well eliminate these.
You'll see the spot in the code where I bracketed the inserted condition with
// Begin BosonHack
...
// End BosonHack
regards,
-phil.
EDIT: Your bugfix has been included in the latest release and your patch attachment deleted. Thanks for the fix. ~ Joe Curia
Edited 3 time(s). Last edit at 06/21/2010 12:45PM by Joe Curia.
In function phorum_mod_automatic_timezones_start_output() I inserted an isset() check on your 'offset_by_ip' index. No big deal but when I am debugging and I have php report notices and warnings, might as well eliminate these.
You'll see the spot in the code where I bracketed the inserted condition with
// Begin BosonHack
...
// End BosonHack
regards,
-phil.
EDIT: Your bugfix has been included in the latest release and your patch attachment deleted. Thanks for the fix. ~ Joe Curia
Edited 3 time(s). Last edit at 06/21/2010 12:45PM by Joe Curia.
February 12, 2010 04:49PM |
Registered: 13 years ago Posts: 115 |
PHP notice: Undefined index: user June 21, 2010 10:23AM |
Registered: 13 years ago Posts: 68 |
User info:
Anonymous user
User IP address = 24.128.76.5
Additional details:
Message:
PHP notice: Undefined index: user
PHP notice generated at /home/ppbb/public_html/phorum/mods/automatic_timezones/automatic_timezones.php:122
Back trace:
Function phorum_mod_automatic_timezones_user_get called
----
Function call_user_func_array called at
{path to Phorum}/common.php:1687
----
Function phorum_hook called at
{path to Phorum}/include/api/user.php:1038
----
seeing a lot of these in the event logger, is there a fix or a way to not log them if they are harmless?
Thanks
rob
Function phorum_api_user_get called at
{path to Phorum}/include/api/user.php:2442
----
Function phorum_api_user_session_restore called at
{path to Phorum}/common.php:590
----
Function require_once called at
{path to Phorum}/ajax.php:27
----
Request info:
HTTP_HOST = www.ppbb.com
HTTP_REFERER = [www.ppbb.com]
REQUEST_URI = /phorum/ajax.php
Anonymous user
User IP address = 24.128.76.5
Additional details:
Message:
PHP notice: Undefined index: user
PHP notice generated at /home/ppbb/public_html/phorum/mods/automatic_timezones/automatic_timezones.php:122
Back trace:
Function phorum_mod_automatic_timezones_user_get called
----
Function call_user_func_array called at
{path to Phorum}/common.php:1687
----
Function phorum_hook called at
{path to Phorum}/include/api/user.php:1038
----
seeing a lot of these in the event logger, is there a fix or a way to not log them if they are harmless?
Thanks
rob
Function phorum_api_user_get called at
{path to Phorum}/include/api/user.php:2442
----
Function phorum_api_user_session_restore called at
{path to Phorum}/common.php:590
----
Function require_once called at
{path to Phorum}/ajax.php:27
----
Request info:
HTTP_HOST = www.ppbb.com
HTTP_REFERER = [www.ppbb.com]
REQUEST_URI = /phorum/ajax.php
June 21, 2010 12:47PM |
Moderator Registered: 16 years ago Posts: 1,301 |
Rob and Phil,
Thanks for pointing out the various bugs which were causing those PHP notices. I have patched them and included the fixes in v5.2.1.05 of this module. Please redownload/install the module (the automatic_timezones.php file specifically) and the notices should go away.
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
Thanks for pointing out the various bugs which were causing those PHP notices. I have patched them and included the fixes in v5.2.1.05 of this module. Please redownload/install the module (the automatic_timezones.php file specifically) and the notices should go away.
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 June 21, 2010 12:51PM |
Registered: 13 years ago Posts: 68 |
Joe, I am running 5.2.1.05. Did you patch the .php and keep the same version number?
Thanks
Rob
Automatic Time Zones (version 5.2.1.05)
This module automatically detects each visitor's time zone and adjusts the times shown in
your forum accordingly, whether they are logged in or unregistered.
Created by Joe Curia
More info: web site • README • Changelog
Thanks
Rob
Automatic Time Zones (version 5.2.1.05)
This module automatically detects each visitor's time zone and adjusts the times shown in
your forum accordingly, whether they are logged in or unregistered.
Created by Joe Curia
More info: web site • README • Changelog
Re: Module: Automatic Time Zones June 21, 2010 12:57PM |
Registered: 13 years ago Posts: 68 |
Re: Module: Automatic Time Zones March 23, 2011 06:36AM |
Registered: 12 years ago Posts: 13 |
Hi Joe,
Just a note. When execute ./script.php (Forum Subscriptions module from you I believe) which suppose to be execute via command/crontab, I will get the following:
Since $_SERVER["REMOTE_ADDR"] is only available via serving via web server to web browsers, it isn't set in command line. In fact the $_SERVER global variable won't be set if I remember correctly. Is it possible for you to include a fix? Something from:
If this is intended, please forgive my ignorant.
Thanks for your great modules.
Kindest regards,
Giam Teck Choon
Edited 2 time(s). Last edit at 03/23/2011 06:52AM by choon.
Just a note. When execute ./script.php (Forum Subscriptions module from you I believe) which suppose to be execute via command/crontab, I will get the following:
PHP Notice: Undefined index: REMOTE_ADDR in /path/to/phorum/mods/automatic_timezones/automatic_timezones.php on line 79
Since $_SERVER["REMOTE_ADDR"] is only available via serving via web server to web browsers, it isn't set in command line. In fact the $_SERVER global variable won't be set if I remember correctly. Is it possible for you to include a fix? Something from:
To:Language: PHP
//check if the time zone offset has been set by ip (only when cookies cannot be created) $PHORUM["phorum_mod_automatic_timezones"]["offset_by_ip"][$_SERVER["REMOTE_ADDR"]]["timestamp"] + 7200 > time()) $offset_by_ip = $PHORUM["phorum_mod_automatic_timezones"]["offset_by_ip"][$_SERVER["REMOTE_ADDR"]]["offset"];
I hope you get what I mean ;)Language: PHP
//check if the time zone offset has been set by ip (only when cookies cannot be created) $PHORUM["phorum_mod_automatic_timezones"]["offset_by_ip"][$_SERVER["REMOTE_ADDR"]]["timestamp"] + 7200 > time()) $offset_by_ip = $PHORUM["phorum_mod_automatic_timezones"]["offset_by_ip"][$_SERVER["REMOTE_ADDR"]]["offset"]; }
If this is intended, please forgive my ignorant.
Thanks for your great modules.
Kindest regards,
Giam Teck Choon
Edited 2 time(s). Last edit at 03/23/2011 06:52AM by choon.
April 01, 2011 08:49AM |
Admin Registered: 18 years ago Posts: 8,532 |
I have published a full rewrite of this module (version 6.0.0).
This release improves the module by making use of new Phorum features and by keeping the local storage for caching offsets at a minimum level (put differently: when a cookie can be used, it will be used as the sole storage mechanism).
This release also fixes a few remaining bugs (also the bug reported by "choon" about the REMOTE_ADDR PHP warning when running script.php).
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
This release improves the module by making use of new Phorum features and by keeping the local storage for caching offsets at a minimum level (put differently: when a cookie can be used, it will be used as the sole storage mechanism).
This release also fixes a few remaining bugs (also the bug reported by "choon" about the REMOTE_ADDR PHP warning when running script.php).
Maurice Makaay
Phorum Development Team



Sorry, only registered users may post in this forum.