MyBB Community Forums

Full Version: Remove user option for time zone / Force ALL users to have 1 time zone?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I make it so my board is Pacific time always, for every user, and unable to be changed?

We are a roleplaying board with an RP deadline that goes by Pacific time, and sometimes people get confused by it or are an hour off even when they select Pacific.

I want to simply be able to tell my users "the deadline is midnight board time" and have that be the one size fits all answer.

What do I edit to do this?  I am comfortable doing PHP file edits if needed; I just need to know which line of code to find and what to replace it with.  Thank you.
The tutorial above works perfectly for assigning all current users and guests the same time zone.

But when I create a new test account, the time zone is wrong. Do you know how I can make sure new registrations are getting Pacific time zone? I noticed somebody else asked the same question in that thread, and they were told they must have missed something. I am 100% sure I did not miss anything from the tutorial and I'm having the same problem.

When I check the database the fields for the new user's dst options are all left blank instead of being assigned the correct numbers.
if you are using database manager like phpMyAdmin
browse to Structure of the users table, find timezone, click on change link of it and change Default to required offset (eg. +10 or -10)
if required, similar change can be done to dst & dstcorrection
I followed your exact steps.  Using phpMyAdmin.  Went into structure and went into the timezone, dst and dstcorrection and clicked change.  Under "default" it had a dropdown with "defined as:" already selected and in the blank field I entered the required numbers:  -8 for timezone, 1 for dst and 2 for dstcorrection.

When I make a new user, the fields are still blank.  Sad  Well to be more specific, timezone is blank but the dst and dstcorrection both say 0. 

Even in the list of all the fields in the structure for users, it DOES show the change I made for their defaults.  It's like MyBB is overwriting those defaults with blanks and zeros when it makes the user?

What went wrong?  I did exactly what you said.  Anything else I can check?

Is there perhaps a line of code I need to delete from a file that is trying to pull the variables for Timezone and dst when it creates the user, but since they are blank it's actually entering them and forcing them to be blank? What file can I find that write query and what would I remove so it's not assigning blanks and 0's?

UPDATE:  I went in and removed some lines of coding from member.php and inc/datahandlers/user.php that looked to be assigning timezone, dst and dstcorrection variables.  Once I removed those and created a new user, the defaults you told me for MyPHPAdmin did work.  The new user had the defaulted entries for all 3 fields!  Smile

BUT there was still a problem when I tested going into the UserCP with the new user.  Even though the coding for timezones had been removed from the UserCP template as per the instructions of the tutorial you shared, it was overwriting the dstcorrection column with a '0' when I checked the database again, after I had saved some other changes in the usercp.

So, I went in to usercp.php and deleted the coding related to dstcorrection and tried again, and it seems to have worked.  I am able to successfully edit my user options and the 3 columns remain their defaults.  Smile

Is there anything else you can think of that I should check on?  Anything I am forgetting?  Are there other areas that a user might go that might re-assign the wrong timezone, dst or dstcorrection variables?  Or does this sound like I found everything I needed to remove?
instead of removing the code segments from the user control panel, may be it would be better to provide the
default time zone and the DST values in hidden form (not easily changeable). yet to devote time for it ..