MyBB Community Forums

Full Version: How to set all users to the same timezone and stop them from changing it
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
i followed this tutorial, but still new users are being registered with default timezone of GMT (although I have changed it to GMT +4 in my admin CP)

Even time which admin CP shows for various periodic tasks to run is in GMT only - any idea how to change that?
You must have missed something. Repeat all the steps to make sure you didn't miss anything.

It's also worth deleting the ./inc/settings.php file. It will regenerate itself using the latest values from the database. And make sure it's CHMOD to 666.
(2012-07-17, 09:33 AM)Fábio Maia Wrote: [ -> ]You must have missed something. Repeat all the steps to make sure you didn't miss anything.
well, it was quite a short tutorial and i cross checked to make sure everything was followed properly.

(2012-07-17, 09:33 AM)Fábio Maia Wrote: [ -> ]It's also worth deleting the ./inc/settings.php file. It will regenerate itself using the latest values from the database. And make sure it's CHMOD to 666.

This is a new thing. It was CHMOD to 644. Shud I delete the settings file now after following the tute??

Actually whenever I run the SQL command
UPDATE `mybb_users` SET `timezone` = '4'

it always updates a few rows.
Will check after a day or two, and see if this happens again or not.
Still when I run this command in phpmyadmin
UPDATE `mybb_users` SET `timezone` = '4'

it shows "21 rows updated".

So either users r able to change the timezone (which I don't think they will do anyways) or there is some error happening somewhere.
Is there anyway to hide the code (using the default values we want), rather than removing them from the templates??

B'coz I am getting this unique error that whenever some user updates his Options in User CP, this timezone setting is changed to GMT automatically.
Thanks for the tip. I am still having a few issues but I think this could be because of the CDN.
Thanks! I will do this to my forum!
Can someone explain what the purpose of this is? Why would you want your users viewing the threads time in an entirely different timezone than their own? Or am I missing something....
That's up to you. It's here just in case you happen to have a need for something like this.

I think I made this per someone's request in the support forums. I didn't have an exact reason in mind.
Heads up:  When a user goes into their user CP options and makes any type of change and saves, it removes the dstcorrection field from that user in the user table of the database or makes it 0.

Also, when a new user is created, the timezone and dst and dstcorrection fields are set to being blank (for timezone) or 0's (for dst and dstcorrection)

I was able to work around this by removing some lines of coding from the member.php, usercp, and inc/datahandlers/user.php files, but I don't feel I am qualified to actually list those code removals myself.  Just a heads up that such a step should be added to this tutorial.  I'm sure a more experienced coder/mybb staff member will know exactly what lines of code had to be removed from those files to make MyBB stop "overwriting" the database values with blanks and 0's.

Aside from that, great tutorial and this has been a big help as I was looking for a way to give my board a specific "board time" that is the same for everybody.  Smile

PS:  Once those changes are made, in my case I also had to follow these steps provided by .m. below:

(2014-09-22, 04:29 AM).m. Wrote: [ -> ]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

^and that will make it so when a new user is created, the database automatically assigns them the timzone values you want a new user to have.
Pages: 1 2 3