Current time: 07-28-2014, 02:22 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set all users to the same timezone and stop them from changing it
06-27-2011, 11:07 PM (This post was last modified: 05-04-2013 03:32 PM by Fábio Maia.)
Post: #1
How to set all users to the same timezone and stop them from changing it
INTRODUCTION

When you edit the timezone settings in the Admin CP, it only affects guests and newly registered users. While registering, you can change your timezone settings. And after registering, you can also change your timezone settings in the User CP. In this tutorial, I will be teaching you how to set all users to the same timezone and disable them from editing it in the future.

TUTORIAL

1. Go to Admin CP > Configuration > Settings > Date and Time Formats.

2. Select your timezone from Default Timezone Offset and choose whether to enable DST or not from Day Light Savings Time.

3. Go to Admin CP > Templates & Style > Templates > Your Template Set > Member Templates > member_register.

4. Find and remove:

Code:
<fieldset class="trow2">
<legend><strong><label for="timezone">{$lang->time_offset}</label></strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
<tr>
<td><span class="smalltext">{$lang->time_offset_desc}</span></td>
</tr>
<tr>
<td>{$tzselect}</td>
</tr>
<tr>
<td><span class="smalltext">{$lang->dst_correction}</span></td>
</tr>
<tr>
<td>
    <select name="dstcorrection">
        <option value="2" {$dst_auto_selected}>{$lang->dst_correction_auto}</option>
        <option value="1" {$dst_enabled_selected}>{$lang->dst_correction_enabled}</option>
        <option value="0" {$dst_disabled_selected}>{$lang->dst_correction_disabled}</option>
    </select>
</td>
</tr>
</table>
</fieldset>
<br />

5. Go to Admin CP > Templates & Style > Templates > Your Template Set > User Control Panel Templates > usercp_options.

6. Find and remove:

Code:
<tr>
<td><span class="smalltext">{$lang->time_offset_desc}</span></td>
</tr>
<tr>
<td>{$tzselect}</td>
</tr>
<tr>
<td><span class="smalltext">{$lang->dst_correction}</span></td>
</tr>
<tr>
<td>
    <select name="dstcorrection">
        <option value="2" {$dst_auto_selected}>{$lang->dst_correction_auto}</option>
        <option value="1" {$dst_enabled_selected}>{$lang->dst_correction_enabled}</option>
        <option value="0" {$dst_disabled_selected}>{$lang->dst_correction_disabled}</option>
    </select>
</td>
</tr>

7. If in step 2 you set Default Timezone Offset to a positive timezone (e.g. GMT +10:00), execute this SQL query (change the 10 to the actual timezone you want):

PHP Code:
UPDATE `mybb_usersSET `timezone` = '10' 

If in step 2 you set Default Timezone Offset to a negative timezone (e.g. GMT -10:00 Hours), execute this SQL query (change the -10 to the actual timezone you want):

PHP Code:
UPDATE `mybb_usersSET `timezone` = '-10' 

If in step 2 you set Default Timezone Offset to GMT, execute this SQL query:

PHP Code:
UPDATE `mybb_usersSET `timezone` = '0' 

8. In order to update all users to use the same setting that you set in Day Light Savings Time, execute this SQL query:

PHP Code:
UPDATE `mybb_usersSET `dstcorrection` = '2' 

CONCLUSION

If you followed these steps precisely, all users should have the same timezone and will not be able to change them in their User CP or during registration. See the examples below:

       
Find all posts by this user
Quote this message in a reply
07-02-2011, 09:33 AM
Post: #2
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
Great work, Faviouz. Very nice, detailed and easy to follow tutorial. Smile

[Image: Ij9Y7.png]
Photoshop Bliss V3 FREE - ACR Theme FREE
Visit this user's website Find all posts by this user
Quote this message in a reply
07-07-2011, 08:50 PM
Post: #3
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
Thanks Jordan. Smile
Find all posts by this user
Quote this message in a reply
07-11-2011, 10:31 AM
Post: #4
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
This user has been denied support. This user has been denied support.
Can this be implemented with the mybb chat system?
Cause i was using a mybb chat plugin where the timezone varies on the ADMIN timezone.
Hope this one will solve ,y problem. I'll test it later. Thanks.
Find all posts by this user
Quote this message in a reply
07-11-2011, 10:40 AM
Post: #5
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
If the chat plugin uses the timezone settings from the MyBB settings, then yes. Which chat plugin are you using?
Find all posts by this user
Quote this message in a reply
07-20-2011, 05:16 PM
Post: #6
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
thanks for the tut
Visit this user's website Find all posts by this user
Quote this message in a reply
07-25-2011, 04:02 PM
Post: #7
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
This user has been denied support. This user has been denied support.
the SQL query will be executed in the phpmyadmin?
Find all posts by this user
Quote this message in a reply
07-27-2011, 11:25 AM
Post: #8
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
Yes, that is correct.
Find all posts by this user
Quote this message in a reply
07-27-2011, 01:16 PM (This post was last modified: 07-30-2011 01:00 PM by anora.)
Post: #9
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
hello..

Great work..
Its really very good to how the step by step tutorial with all of us...
Visit this user's website Find all posts by this user
Quote this message in a reply
07-27-2011, 05:47 PM
Post: #10
RE: [Tutorial] How to set all users to the same timezone and stop them from changing it
This user has been denied support. This user has been denied support.
thanks for helping me..
as i was searching for it..
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication