Hi got2know,
I hate to help Mission Viejo Lacrosse but the site looks so good that ok. (Just kidding … about helping, not the site.)
Yes, there are a couple of places where you’ll find that line, check in includes/mstw-game-schedules-admin.php as well. I’m not sure why that went in there way back when, but it’s not good. In fact, it’s already been removed from the next release of the Game Schedules plugin. It’s been replaced with mstw_set_wp_default_timezone( ); so the plugin is now tied to the WP default timezone from the WP General Settings.
-Mark
lol – yes, I’ve got connections to a San Diego high school, too (at least for a few more months until my nephew graduates), but I won’t tell you about that one or I’m likely to get even less help! π
Removing that one instance of the code seemed to have done the trick, and since you are phasing that code out with 3.0, soon, I’ll leave well enough alone at this point.
Thanks so much for the quick feedback and excellent plugins. I’ll let you know when the site is all buttoned up and you can have another look. Hopefully, the team will give me player bios. I’d really like to implement the whole thing on the Roster side, too.
John (got2know)
Mark,
I guess I spoke too soon.
I didn’t notice, but when I commented out that line, it looks like the Game Schedule picked up a different time zone (14 hours earlier). Any thoughts on how I can keep that code out and still have my times show up correctly on the schedule.
I only had changed one instance of the code:
But, I see there are a few more instances of it further in the file, too. I couldn’t find the include file you referred to.
Any thoughts?
John
Mark,
I guess I spoke too soon.
I didn’t notice, but when I commented out that line, it looks like the Game Schedule picked up a different time zone (14 hours earlier). Any thoughts on how I can keep that code out and still have my times show up correctly on the schedule.
I only had changed one instance of the code:
But, I see there are a few more instances of it further in the file, too. I couldn’t find the include file you referred to.
Any thoughts?
John
Hey John,
Check the timezone setting in the WP General Settings. What’s it set to? WP default is Greenwich, but that doesn’t account for 14 hours to Pacific time.
Also, add the line I recommended above.
Sorry, the include file is new in the next release. You just want to search the mstw-game-schedules.php file and make sure you’ve got all the locations. There’s one for the admin pages and it will definitely mess up your dates if the admin and the front end are different settings.
-Mark
Mark,
I had the WP General Settings set to a city – Los Angeles. I changed it to Vancouver in case something was wacky with WP and Game Schedule both using Los Angeles.
Now with line 98 commented out, the schedule is now 8 hours ahead (which seems more logical than 14 hours), but still not what I’m after.
I’m having trouble with the line of code you suggested as a replacement. Not being a programmer, I may just have something small wrong, but it causes the site to crash.
Replaced: date_default_timezone_set(‘America/Los_Angeles’);
With: mstw_set_wp_default_timezone( );
Error when loading the page: Fatal error: Call to undefined function mstw_set_wp_default_timezone() in /home/mvhslacrosse/mvhslacrosse.org/wp-content/plugins/game-schedules/mstw-game-schedule.php on line 99
I guessed at some variations but they either still error’d out or did nothing.
John
Sorry, that’s my bad. I’ve been immersed in the next release and LOTS has changed. (You can read about it here if you’re interested.) The function mstw_set_wp_default_timezone() doesn’t exist in the current release. S***!
So here’s what I suggest you try. Make sure you’ve removed all the offending lines. Change the WP time zone back to Los Angeles. (Mission Viejo is LA if you live in San Diego. π ) Then add a new game that is like tomorrow, so it’s the next game for the countdown timer. Check to see that the game is being displayed correctly in the admin screens and on your user screens – schedule tables [shortcode] and countdown timer.
It could be that the dates you’ve entered are screwed up due to something the other plugin is doing with the timezone which then interacted badly with what I was doing and/or the removal of that line. Let me know how it goes. If you don’t have any luck with the above test, I’ll re-load the latest release (not the new stuff) into my test environment, remove the lines, and get it to work.
Sorry about the confusion, but let’s get this done. The high school LAX scrimmages start down here tomorrow, so my time is going to become constrained very shortly.
-Mark
Mark,
Okay, I think I made progress! But, I also noticed a widget issue.
– I commented out the 4 instances of the code in the file.
– I added a test game and the time was correct.
– I went into existing games and hit “Update” and that recalculated the bottom field: UNIX Date-Time (Don’t Enter):
All now looks good on the schedule.
One new problem I noticed. The Countdown widget is showing 8 hours behind. I tried pulling the widget off the side and then putting it back on (hoping it would reset), but no such luck. I also tried adding a new game that was sooner, hoping to force a reset – didn’t work. Any thoughts on adding 8 hours to the widget calculation. Even if I had to hard code a line to add 8 hours, I’d be fine with that.
John
John-
Great. 8 hours behind is good. Something is set to Greenwich (probably). When you say ‘the widget calculation is off’ is it finding the right game but displaying the time incorrectly (different than what’s on the schedule)? Or is it finding the wrong game.
I’ll do a test on the new version today (I hope … I have a LAX rules meeting tonite.) If things look good, would you be interested in a beta of the new version. Some new features are not complete but I believe all the old stuff works (pending tonight’s testing).
Thanks for you help on this. This plugin is used from Australia to Croatia, so the time has to be rock solid. I’m going to owe YOU coffee! π
-Mark
Mark,
The widget (just using countdown), is pulling the right game(s) (I have one for Varsity and one for JV). The timer is 8 hours too fast though. Next game is actual 1 day, 6 hours, countdown shows 22 hours. This worked fine prior to me commenting out the code to fix the other issue.
Yes, I’m good with beta testing! I’ll email you with my contact info so you can let me know what you need me to do.
John
John-
Thanks to your help, I’ve found that:
a. The plugin was pulling the current SERVER time, which can be different than the current WORDPRESS time.
b. There is a bug in the function that builds the countdown (even with the correct current time).
Both issues are being corrected and fixes will be in the next release.
Thanks.
-Mark