Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:01 am EST

Geeklog Forums

Timezone Hack

Page navigation


JollyMoon

Anonymous
I tried to install this timezone thing and it didn't work...seemed to be a path error.

I deleted the hack code references and reloaded my config.php and lib-common.php

OUCH

Now my website doesn't work

HELP

How do I fix this?

Warning: main(classes/timer.class.php): failed to open stream: No such file or directory in /www/j/jollymoon/htdocs/aande/lib-common.php on line 113

Fatal error: main(): Failed opening required 'classes/timer.class.php' (include_path='.:/usr/local/lib/php') in /www/j/jollymoon/htdocs/aande/lib-common.php on line 113
 Quote

JollyMoon

Anonymous

Oh Well...

Someone failed to mention that when you insert the TimeZone Hack references into the required config.php and lib-common.php that they didn't say where EXACTLY...

When I deleted those references to restore my working website, it wouldn't come back UNTIL I went line by line in these two files and put each line into its original position EXACTLY. And voila! Now my site works again. WHEW!

What a hassle and several hours down time.

So where Exactly do you put the two commands in these files in order for the time zone thing to work???

I won't try another HACK again without explicit instructions and verbose help...


 Quote

Status: offline

trenchteam

Forum User
Regular Poster
Registered: 06/08/04
Posts: 89
^^thats why I haven't touched this hack, until its packaged and ready to go!
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
Sorry, but I really don't see a problem with that ...

ok, config.php:
$_CONF['timezone'] = 'Yourtimezone';
I think it doesn't matter so much where you put that line, I have it behind $_CONF['path_html'] (in the next line)

the lib-common.php part is perfectly described in the initial post of this thread.
add line after
require_once('/path/to/config.php');


the last one is here: public_html/admin/story.php
look for a line that starts with:
DB_save($_TABLES['stories']'
and replace
,'$date',
with ...
,FROM_UNIXTIME($unixdate),
(no inverted comma!)

Good luck

geKow

btw. I would be interested to know what you have done wrong when you tried to remove the "hack"
 Quote

Status: offline

exdeath

Forum User
Junior
Registered: 02/13/04
Posts: 23
For those who use this hack and still get a wrong time, try using Etc/GMT+X on the timezone, where the X is any number of hours. Just play around with X until you get the correct time, for instance, I had to use Etc/GMT-29 (i was a day and a few hours off) on my site to get the right time.
 Quote

Status: offline

thedude

Forum User
Regular Poster
Registered: 12/28/02
Posts: 90
cheerful
Works great for me. Not sure whether this matter or not but I'm using Linux for the OS. Anyway, not trying to rub it in, but this is like the easiest hack I have ever done. If you read the instruction carefully though.


Excellent work Yew Loong.


Many thanks.

The Dude
 Quote

aaron

Anonymous
I had to use the timezone as EST - 25 hours but it worked for me in the end. It defaults to jan 1 1970 if you don't have the correct letters, e.g. I tried AEST as the letter code, but PHP doesn't recognise australian eastern standard time.
 Quote

Status: offline

tobymiller

Forum User
Newbie
Registered: 09/08/04
Posts: 1
All I had to do was edit two files:

1) config.php

Add this line (line 224):
Text Formatted Code
$_CONF['timezone']  = 'US/Eastern';
 


after this line (line 223):
Text Formatted Code
$_CONF['default_charset'] = 'iso-8859-1';
 


2) lib-custom.php

Add these lines (line 45):
Text Formatted Code
// Timezone hack
if (!empty($_CONF['timezone']) && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}
 


after the header comments so that it is the first chunk of code.

That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.
 Quote

Steven

Anonymous
sleepy
Yeah - this almost works in 1.3.9, however stories are posted with a time one hour behind the actual time. UG!

Perhaps we could encourage the author of GeekLog to put a system wide fix in the next release.

I'm sure many Gl site admins would be very thankful.

It's not a big deal until someone complains about it to us and we don't have a solution ready.

But hey, it's better than nothing at all. I'm happy with the hack or non at all for that matter. GeekLog is making my job easier than ever. Thanks man!
 Quote

Status: offline

thebiss

Forum User
Newbie
Registered: 09/18/04
Posts: 1
My server's in Arizona (godaddy.com,) but we're in Connecticut, and having the same timezone problems. I found that the initial timezone hack (first post) didn't work until I made the following changes:

(0) Add the timezone hack to lib-common.php

(1) Modify locale in config.php, changing to US English:

// $_CONF['locale'] = 'en-gb';
$_CONF['locale'] = 'en-us';

(2) Add the timezone setting to config.php, below the existing locale settings, and assigning it the value EST5EDT. The "America/New_York" settings had no effect!

// $_CONF['timezone'] = 'America/New_York'; // no luck
// $_CONF['timezone'] = ':America/New_York'; // no luck
$_CONF['timezone'] = 'EST5EDT'; // success!


Good luck.
-- Brian
 Quote

Jody

Anonymous
Hey anyone know the TZ for Austraila, Melbourne
 Quote

Status: offline

jonc

Forum User
Chatty
Registered: 09/12/04
Posts: 50
just did the hack, just like it was originally posted and it worked great - running 1.3.9sr1 BTW.

Also did the admin/story.php line change on #910 and again worked great.

My , this would be great for a system setting.

Thanks for the hack though.
 Quote

asdf

Anonymous
Quote by tobymiller: All I had to do was edit two files:

1) config.php

Add this line (line 224):
Text Formatted Code
$_CONF['timezone']  = 'US/Eastern';

 


after this line (line 223):
Text Formatted Code
$_CONF['default_charset'] = 'iso-8859-1';

 


2) lib-custom.php

Add these lines (line 45):
Text Formatted Code
// Timezone hack
if (!empty($_CONF['timezone']) && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}

 


after the header comments so that it is the first chunk of code.

That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.


lib-custom.php --- is this a new file w/ GL 1.3.9sr1 -- I think I'm running 1.3.9, but I don't see the file anywhere..

Did you mean lib-common.php ??

thanks again!
 Quote

Status: offline

zipstart

Forum User
Chatty
Registered: 09/13/04
Posts: 60
lib_custom is in your geeklog/system dir.
 Quote

asdf

Anonymous
Quote by tobymiller: All I had to do was edit two files:

1) config.php

Add this line (line 224):
Text Formatted Code
$_CONF['timezone']  = 'US/Eastern';

 


after this line (line 223):
Text Formatted Code
$_CONF['default_charset'] = 'iso-8859-1';

 


2) lib-custom.php

Add these lines (line 45):
Text Formatted Code
// Timezone hack
if (!empty($_CONF['timezone']) && !ini_get("safe_mode")) {
    putenv("TZ=".$_CONF['timezone']);
}

 


after the header comments so that it is the first chunk of code.

That's it, change the timezone property to the one you want and you're done. I'm running v1.3.9sr1.


I made the changes suggested above -- (except I made changes to lib-common.php instead of lib-custom.php (didn't see a lib-custom.php w/ 1.3.9))

The timezone changes to the correct one I specified, but when I try to log in as an admin via /admin

I get these errors:

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/xxxx/lib-common.php:531 in /home/jserra/public_html/lions/system/lib-sessions.php on line 314

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/xxxx/lib-common.php:531 in /home/jserra/public_html/lions/admin/auth.inc.php on line 73

To be more explicit, I am able to load the admin login page with no errors, but when I type in the login information and click Submit, I get a two second error flash at the top of the page (the real page does load below the errors - and I see that for a second I'm logged in (cause I see the Logout button for a split second)) but after the two seconds it redirects me again to the moderation.php admin login page..

Anybody having the similar issue?

Thanks!

BTW - normally these errors mean extra empty lines at the bottom of the pages??

There are no empty lines at the bottom of the two pages noted in the error message - also I checked moderation.php, etc., but still I receive the error...
 Quote

asdf

Anonymous
Quote by zipstart: lib_custom is in your geeklog/system dir.


My bad - yes, thanks to tobymiller for the hack - and to zipstart for
correcting my error (I was adding the line to the lib-common.php instead
of the lib-custom.php (which is in the /system folder)

Thanks again to all for creating a good discussion and hacks for this
important issue.

 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512

fyi this "hack" has made it to the core in the 1.3.10rc's.
 Quote

Status: offline

MrHyde

Forum User
Junior
Registered: 11/09/03
Posts: 15
Quote by Jody: Hey anyone know the TZ for Austraila, Melbourne


Try Australia/Melbourne.

Other options could be UTC + 10 (not sure if that takes Daylight Savings into account) or AEST (Australian Eastern Standard Time).
 Quote

Status: offline

Sticks

Forum User
Newbie
Registered: 11/11/04
Posts: 4
Location:Melbourne, Australia
worried


I've recently installed geeklog onto my site. I made the timezone hack to the config files for GL to show Aust. Eastern Daylight Time for my posted stories, etc.. and that all worked well.

I'm NOW informed that since I installed geeklog, that the apache server has been logging lines with altered timezones!?!

The server resides in the US (-0600), my site is for Melbourne (+1100 currently) and the time the apache log troubles started co-incide with me 'hacking' GL for the timezone fix.

An example was sent to me:

xx.xxx.xxx.x - - [11/Nov/2004:09:59:13 -0600] "GET /newmenu_shop.gif
HTTP/1.1" 200 2301
xx.xxx.xxx.x - - [11/Nov/2004:09:59:13 -0600] "GET
/spotlight_bottom.jpg HTTP/1.1" 200 2754
xx.xxx.xxx.x - - [11/Nov/2004:09:59:14 -0600] "GET
/d3_contenttile.gif HTTP/1.1" 200 850
xx.xxx.xxx.x - - [11/Nov/2004:09:59:14 -0600] "GET /d3_content.gif
HTTP/1.1" 200 2028
xx.xxx.xxx.x - - [12/Nov/2004:02:59:13 +1100] "GET
/spotlight_codfhpreview.jpg HTTP/1.1" 200 24222
xx.xxx.xxx.x - - [11/Nov/2004:09:59:15 -0600] "GET
/scorecard_title.gif HTTP/1.1" 200 2398
xx.xxx.xxx.x - - [12/Nov/2004:02:59:15 +1100] "GET /boxart/413.jpg
HTTP/1.1" 200 9767
xx.xxx.xxx.x - - [11/Nov/2004:09:59:15 -0600] "GET
/scorecard_Computer.gif HTTP/1.1" 200 8853


Now - I can't for the life of me understand how one site can have a server wide impact. This logging issue is effecting every site being run on this server (20+ websites!)

I'm currently running Geeklog 1.3.10rc2.


---

Sticks
 Quote

Status: offline

Sticks

Forum User
Newbie
Registered: 11/11/04
Posts: 4
Location:Melbourne, Australia
freakingout
Just as an update to this - I've removed the timezone hack [ie; commented it out] and the logs are logging normally again.

It would seem this is definately the cause of the trouble,
---

Sticks
 Quote

Page navigation

All times are EST. The time is now 11:01 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content