Hello,
thanks for a great module, it has been really helpful
I've noticed one little problem with match time though. It seems that match time use server time but my server is in States and I'm in Europe and there is 7 hours difference. So if my match is created to start at 14:00, then on the match node, start time is displayed as 21:00.
Wonder if there is a quick fix for this?
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | leaguesite_match.patch | 10.48 KB | Alun |
| #22 | leaguesite_match.patch | 10.33 KB | Alun |
| #4 | timeZoneCorrection.patch | 1.33 KB | Alun |
Comments
Comment #1
Alun commentedHmm, yeah I think I remember using UNIX_TIMESTAMP() in a SQL call.
There is probably a way to use Drupal settings instead of the server time. I'll look into it and get back to you when I can.
Thanks for pointing this out.
Alun
Comment #2
ericpfeifer commentedI have a simple request...
1. I know there is views integration now in alpha 3 but cant find any documentation on where the views are or how to import them or modify the existing one.
2. Is there a way to understand what the standings headings are? There isn't a key included anywhere in the documentation or on the standings page.
Keep up the great work on this module!
Comment #3
Alun commentederic,
1. As for Views integration, there are now fields available in Views, but I haven't created any pre-packaged views to export with the module as of yet, so you would have to create a view from scratch. I will create some for a future release, but due to the small amounts of time here and there I get to create the module, it isn't a priority. Maybe another user of Leaguesite would be kind enough to send you their exported view?
2. Sorry, again this is me being lazy and cracking on with the functionality of the module, not the user interface. The key is
P = Played
W = Won
L = Lost
D = Drawn
F = Points For
A = Points Against
Pts = Points.
Thats off the top of my head, so I hope its right! More options for this display will be added before a proper release (which is something I say a lot, I know!) but because of the Views integration, its not my priority.
Also, please open a new issue for a separate topic next time, it keeps things simple, as an issue queue is for one issue only!
Hope that helps.
Thanks
Alun
Comment #4
Alun commentedperke, can you apply this patch and let me know if this fixes your problem please?
Thanks
Alun
Comment #5
perkehey Alun,
thanks for quick response... first, i was getting errors on applying patch (i'm on win machine, using Tortoise) it was something about different chunk file size... then, I manually edited leaguesite_match.module and added a code from patch (changed lines 272 and 273)
created new match node with default time (14:00) but it came up as Thursday, January 1, 1970 - 00:00 (which is Epoch, i think :)
I see you're using some custom date format in here, could that be a issue?
Comment #6
Alun commentedCool, it might be my fault with the patch, depends which version of the module you are using I guess.
The custom format just turns the time into a timestamp, which is how I am storing the match. Can you show me the lines of code you changed? say the lines between 265 and 280 or something. I can see if the code is the same as how I have it - I tried it on my website and it seems to work OK!
Thanks
Alun
Comment #7
perkeHere is the complete leaguesite_match_insert function
Comment #8
Alun commentedThat explains it - you are missing this line
just before
If you add it, that should get it working.
Comment #9
perkehm, no luck... i'm still getting +7 hours difference between time on edit form and time on node... tried running update.php before creating new node, too
Just to make sure we're looking at the same version, I'm on 6.x-1.0-alpha3 ?
Comment #10
Alun commentedWell, this isn't a fun problem! I think I might have to overhaul the code and use Date API here, as timezones seem to be a weak point. For the time being, I think I will change the code to completely avoid timezone handling, and then see if I can apply a proper fix using Date API at a later date. I'll be back soon and let you know when I have committed this to the code.
Comment #11
Alun commentedActually, this is horrible to fix. It'll take longer than 'soon' lol!
Comment #12
perkeno probs, Alun.. keep up the good work. I'll just have to calculate time difference and enter it that way. No big deal but it would be awesome to move to Date API as it is the way to go. Wish I can contribute more as it look as a great module. I might post a use case though, once we're done with our site (it's a football team site).
Good luck and thanks again
Comment #13
Alun commentedI have attached a message from DeLaPena to this post, can someone look into it if they have the time and see if it does indeed fix the problem?
I would try myself, but I have no time whatsoever to sort it out at the moment, unfortunately, so it might be faster to post it here.
Thanks guys - I'll try and get a fix when time permits if no one can help with the PHP editing.
I think i may have found a solution for the date problem:
I used this function to convert a UNIX time stamp to a string in the format of YYYY-MM-DD:
This worked however if the user's timezone was different from the server's then it changed the actual date.
In my case the user's timezone was -05:00GMT and the server was -04:00GMT which resulted in the date 2010-03-31 changing to 2010-04-01.
The solution was to include the $timezone argument however since I did not want to change the timezone I passed an argument of 0 (zero).
I also used the following code in another case:
Note that I needed to pass an empty string ('') for the third argument (or I could have used null). The value of my second argument did not require the third argument ($format) to be set however without a third argument I could not pass the fourth ($format) and it is harmless to pass a value for $format as it will simply be ignored.
grtz Tim
Comment #14
timbraeckman commentedI managed to fix this problem. I've sent the solution to Alun and wait for him to check if the code is ok. Maybe he'll add it in a new version :-)
Comment #15
timbraeckman commentedMmm it seems like it's not fixed for dates at the end of this year. I guess it's because of summer time and winter time. Shit! This sucks :-(
Comment #16
emnzava commentedDear DeLaPena,
Just a thought. i think if we can take a look at event module may be we can come up with another idea of how to solve this issue.
Regards.
Comment #17
timbraeckman commentedBwax you mean check out how it works in that module and than try to do the same in leaguesite? It would be great to help out Alun with this problem.
Comment #18
emnzava commentedDear Tim,
I thought of this because i see it's the way open-source do things. For example, date module borrowed technique of calculating time zone from event module because they found it the best way to go rather than starting from scratch while somebody else has already done it.
I think dealing with date issue, we are not moving away from leaguesite module because date is universal to any module that wants to use it. But sports league and fixtures is specific to leaguesite.
regards.
Comment #19
timbraeckman commentedAre you a coder bwax? It would be great if you found out what's wrong in the code.
I tried yesterday and thought i found the solution and i really did but today i added the matches for november and than i saw the hour was 1 hour different again. I guess it's something with summer and winter time.
Comment #20
emnzava commentedAm not that much into coding but i am trying, step by step.
I do work on it, if i'll find any solution i will share with you.
Regards.
Comment #21
timbraeckman commentedGreat!
Comment #22
Alun commentedRight guys, I'm hoping to get this fixed this week, it would be nice.
Here is a patch to update leaguesite_match.module and leaguesite_match.admin
It will incorporate date API into the creation and editing of matches.
Can some people in different server locations please test it and get back to me with success/problems occurred please?
Bear in mind 2 things -
You need to install and enable Date Popup (from Date module)
This may change some times you have, so please backup your database and original files
Thanks for helping guys, looking forward to the feedback.
Alun
Comment #23
Alun commentedComment #24
timbraeckman commentedAlun just with phpmyadmin export all tables? and than also the whole leaguesite folder? I'll test it right away than!
Comment #25
Alun commentedYeah that will let you backup everything. Its good practice to do it once in a while anyway.
Comment #26
timbraeckman commentedHi Alun,
It seems it doesn't work. I ran update.php and i tried to edit a match and set the date/time and it writes 0 in the database!
And for adding new matches it shows 01/01/70 02:00 as date when i enter 18/08/2010 20:00
grtz Tim
Comment #27
Alun commentedJust updated the patch for the fix when inserting a new match.
Alun
Comment #28
Alun commentedIt all seems to be working OK for me, on multiple websites on different servers, so I have just committed the code. You can download it as soon as it updates on Drupal.
PLEASE ENABLE DATE API BEFORE RUNNING UPDATE.PHP
Cheers!
Alun
Comment #29
timbraeckman commentedI hope drupal will update soon!
Comment #30
Alun commentedIt usually does it overnight.
Comment #31
timbraeckman commentedGreat so tomorrow morning i can add all my matches for sure? :-)
Comment #32
Alun commentedLets hope so! I can't be sure if the timezone is working for everyone, but it works on two different servers I tested it in, in different timezones too.
Comment #33
timbraeckman commentedStill the same problem for me :-(
It works for matches in the near future but as soon as time goes to winter time, it does +1 again and sets in database +0100 instead of +0200
grtz Tim
Comment #34
perkeHi Alun, thanks for the hard work... last dev snapshot has fixed my issue with match time so marking this as RTBC. I had no chance to check against timezones so not sure about that.
Also, here is the site where I use LeagueSite extensively http://www.fkzeljeznicar.com (Bosnian Premier Football League Champions) if you want to see implementations of your great module :)
There are 3 blocks in the right sidebar where LeagueSite is used, first block is upcoming match for my team, second is last match and league table block (link in the block footer leads to detailed table) is on the bottom of the right sidebar. There is also news ticker in the footer showing all the matches from last matchday (still need to sort the matchday views filter somehow, but that's another issue)
Thanks to everyone who participated and helped in this issue!
Comment #35
timbraeckman commentedHi perke,
Great site! Mine will be launched soon too and i'll show it here too than.
I have some questions about your site though...
1. Did you create a match center? I mean a page which shows the result of a match with match report, yellow/red cards, goals, etc?
2. How did you manage to create the statistics page with goals, yellow and red cards using leaguesite?
Thanks in advance!
Tim
Comment #36
perkeHi Tim,
thanks :)
1. nope... don't really have a need for that page, but I guess you could mess with views and see what options you have... I bet it could be done easily as LeagueSite have good views integration
2. I did not use the Players part of the LeagueSite for the players statistics... its a cck content type, leaguesite_player.module wasn't live when I started using LeagueSite and converting later wasn't an option
good luck with the site!
Comment #37
Alun commentedGlad its working for you Perke - I need to add some handlers in Views to show the time correctly, as it is stored in the database as UTC, and converted to the designated timezone when it is needed. Theoretically, a user in a different timezone viewing the time should see it converted to their timezone, if you have that feature available. Otherwise it defaults to the sites timezone. Quite a funky solution using Date API :-)
I'll mark it as fixed once the Views handler is done. But I am glad its nearly done!
Comment #38
timbraeckman commentedYeah it really is fixed! :-) It works even for me and that was a big job wasn't it? :-) haha
Thanks for the great work on this!
However... i'm a bit confused now... is it working for me using the custom files or using the dev release?
grtz Tim
Comment #39
timbraeckman commentedI think i just need a view handler which takes care of the DST and this is fixed. Remember: i use those custom files.
Comment #40
timbraeckman commentedHi Alun,
When viewing the edit screen of a match i see the hour of the match that it should be +2h. (i guess for my timezone).
And when looking at my view i created with all matches... the hours of the matches in winter are still +1 hour.
grtz Tim
Comment #41
Alun commentedThought I'd update this thread, this issue is on my mind and I refuse to get alpha4 out until it is sorted. I have recently changed the way dates are stored on the database, scrapping timestamps, and the issue is resolved completely on my development version.
Unfortunately the issue still arises with Views as it requires dates to be supplied in timestamp format.
As a result, I am working on a custom views handler which will treat the date as a string, I'll set up all the custom formatting and will get all the date features available in Views sorted in a custom handler. I will commit the update as soon as I have met a few other issues, and written the handler, of course!
Comment #42
Alun commentedThis works perfectly for me, I have just committed the changes - I am storing the time in ISO format and dropping UNIX timestamp.
Views handler to deal with the change is also included.
Please back up files and database before updating. I cannot stress this enough.
Thanks
Alun