Content Management System - CMS : eXV2 
Home
News
Forum
Downloads
Download Module
Sitemap
Partnerseiten
RSS News
Kontakt/Info
Sprache
EnglishFrench
Suchen
Login
Nickname
Passwort

Registrieren?
Passwort?
Navigation
 Home News  Forum Neueste Beiträge  Downloads Download Module eXV² Themes  Weblinks Tutorial Changelog 2.3.1 Jobcenter Gebrauchtmarkt OSMap  Sponsor Kalendersystem Sitemap Partnerseiten RSS News Kontakt/Info Webseiten Wetter
Willkommen im Free Web CMS : eXV² Forum!
  Forenarchiv
     Module
  Time zone problem and eCal

Forum : Module

Titel : Time zone problem and eCal

© 2004-2012 www.exv2.de
http://www.exv2.de

URL dieser Diskussion
http://www.exv2.de/modules/newbb_plus/viewtopic.php?topic_id=767&forum=11


 dbmdude :

19.11.2003 15:03
 I do not speak german.... apologies.

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:

if($xoopsUser) {
$timezone = $xoopsUser->timezone();
if(isset($timezone)){
$useroffset = $xoopsUser->timezone();
}else{
$useroffset = $xoopsConfig['default_TZ'];
}
}
$usertimevent = ($useroffset*3600) +time();

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. Cool

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....
|

if($xoopsUser) {
$timezone = $xoopsUser->timezone();
if(isset($timezone)){
$useroffset = $xoopsUser->timezone();
$temp_dbm = "User Time Zone";

//DBMDude test code above
}else{
$useroffset = $xoopsConfig['default_TZ'];
$temp_dbm = "Default Time Zone";

//DBMDude test code above
}
}
$usertimevent = ($useroffset*3600) + time();

|
| a bit further down....
|

$blockm['content'] .= "$monthname $year

".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 Wink

 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;

Wink

you can test here http://cms.bln.net/e-xoops/modules/news/

username: admintester
password: teste

 dbmdude :

21.11.2003 14:37
 YES That was it!!! THANK YOU

Thanks for the module too.
Partnerseiten
http://www.fr.exv2.eu/

Vote für eXV2
php
Kontakt/Info
  Kontakt
  Impressum
  Link zu uns
  AGB
  Datenschutzhinweis
Downloads
  eXV² Core
  Core Sprachfiles
eXV² Filecenter
  Downloads
  Download Module
  eXV² Themes
  Multilanguage Module
  Sprachfiles eXV² Module
eXV² Support
  France