I installed eCal mainly because I could not get newscal to work right at all. Anyway in the function /blocks/eCal.php there is a function that is not translating the time correctly. I thought that the system (e-xoops) took the default time zone and computed using the users timezone an offset.
Well.... look at this fragment of code and see if you can help me out:
This fragment SHOULD compute this offset... well it is not and I do not know why. I was hoping some one here would have seen this before.
It appears as if this function is NOT even working. The problem is that it is supposed to enter this sub routine if $xoopsUser is set, but when I logon it is not. I add test lines in there and it still does not go. The test line I have is adding $useroffset to the eCal module to display the calendat but it displays a 0 everytime so no offset is ever applied and the calendar displays Easter Std Time (US) no matter what.
I have this same problem in the WebChat block (different module).
CAN ANYONE HELP?????? PLEASE???
Signed Confused
Nobse :
19.11.2003 20:07
Oh Sorry is a Bug.
edit the blocks/ecal.php
line 381
if ($day == Date("d")) in if ($day == $d)
thanks for the report.
dbmdude :
20.11.2003 04:03
You are very Welcome.
But now I changed the code as you said below and the time my eCal block uses is STILL server time (Zone -5 for me) and not the users timezone... can you help further?
You see the problem is that the calendar is using the wrong timezone. The date display code you gave me is NOT the problem. The function mentioned above may have been a different bug, the bug I am experiencing deals with the time being used to generate the calendar alltogether. People in Zone -5 get the correct display of the calendar... people in Zone -8 see the Zone -5 time no matter what there timezone is set to. My default time zone is set to Zone -5 because the server is physically Zone -5, but most of the users are Zone -8. In essence, at 9pm Zone -8 the calendar changes to the next day because the server timezone is Zone -5 (midnight there when it is 9pm here).
Does this make sense now??
Again I am having the same problem with the WebChat module but cannot find the author to write him.
ONE OTHER THING TO NOTE... I tried some test lines using the variables you have set up for this function and it "looks" like the $xoopsUser is not even being used here because I used the following eCal.php code below and it did not display the things I asked for.
Zitat:
quoted from function eCal_showm(){
| | a bit further down from the function head.... |
".date("l dS of F Y h:i:s A",$usertimevent)." $temp_dbm
</TH>\n //DBMDude test code above
The above code prints the time stamp (usertimevent) just below the calendar month/year with my variable temp_dbm (which is empty here and I cannot figure out why). If someone is logged on it should be either "User Time Zone" or "Default Time Zone".
THANK YOU FOR YOUR QUICK RESPONSE!!!
DBMDude
[ Geändert von dbmdude an 19.11.2003 19:46 ]
Nobse :
20.11.2003 14:52
that would have to fold however *********************************** if($useroffset == "") { if($xoopsUser){ $useroffset = $xoopsUser->timezone(); }else{ $useroffset = $xoopsConfig['default_TZ']; } } $usertimevent = (time() + (($useroffset - ($xoopsConfig['server_TZ'] - date('I'))) * 3600));
********************************
Sorry for my bad english
dbmdude :
20.11.2003 21:04
Q. Is that code you just provided suppose to replace ALL the code of its kind in eCal.php??? Because there a lot of places where similar timezone code exists in eCal.php (maybe elsewhere too).
Q. Why didn't you use the default timezone conversion used in functions.php for e-xoops??? Why did you build your own???
Zitat:
that would have to fold however *********************************** if($useroffset == "") { if($xoopsUser){ $useroffset = $xoopsUser->timezone(); }else{ $useroffset = $xoopsConfig['default_TZ']; } } $usertimevent = (time() + (($useroffset - ($xoopsConfig['server_TZ'] - date('I'))) * 3600));
********************************
This did not fix it.... it still stays in the same timezone no matter what the user enters. If you change the line of code that displays the calendar block as below AND then change your timezone a few times to different ones you will see what I am referring to:
Zitat:
$blockm['content'] .= "$monthname $year
".date("l dS of F Y h:i:s A",$usertimevent)."
</TH>
PLEASE HELP I Cannot get it to work????
DBMDude
Nobse :
20.11.2003 21:48
HAHAHA
you add $xoopsUser to global
function eCal_showm(){ global $db, $xoopsConfig, $timeoffset, $xoopsUser;