How to change the Timezone used by Dolphin

How to change the timezone of your Boonex Dolphin social community

By default Boonex Dolphin will use the timezone of the server it is currently installed at. However in many cases this timezone might be different than yours and this might cause some inconvenience since Boonex Dolphin uses timestamps when for example a post to your Forum is added or for the Spy module to properly display the data.

 

In this tutorial we will show you how to edit the timezone of your Social Community in order to fit the timezone you are currently located at.

 

To change the timezone used by Dolphin, you need to:

Step 1 Access the Code Edit Feature

The change will require entirely edits upon the code of your Boonex Dolphin platform, thus we would like to begin by letting you know that we will be describing those edits using the Code Edit feature of the File Manager service of your cPanel.
 

cPanel-file-manager

 

The“Code Edit feature is available by selecting a file you would like to edit the code for, right clicking on the selected file and then choosing the Code Edit option:

 

file-manager-code-editing

 

Now that we have a common way of editing the code of the files let’s begin doing so.

 

Step 2 Edit the Code of your Files

The first file you will need to edit is the header.inc.php file. It is located in the inc/ folder contained in the installation directory of your platform. For example if your Boonex Dolphin platform is installed in the public_html folder the inc/ folder will be located at the following path:

/public_html/inc/header.inc.php


The code you will need to add here should be added AFTER the following piece of code located near the 160th line:
 

mb_regex_encoding('UTF-8');

 

The new code you should add is:
 

date_default_timezone_set(“timezone”);

 

The “timezone” sting should be changed with the concrete identifier for your timezone. All of the currently available identifiers can be checked at the official php documetation page.

 

For example if you would like to set the timezone for your Social Community to Chicago please use the following line of code:
 

date_default_timezone_set(“America/Chicago”);

 

Now save the file!
 

The second file you will need to edit can be found in the inc/classes/ folder and ti is called BxDolDb.php (public_html/inc/classes/BxDolDb.php if your Boonex Dolphin platform is installed in the public_html folder).
 

Find the following line of code in that file:

 

mysql_query("SET @@local.connect_timeout=9000;", $this->rLink);


and add AFTER that line the following code:

 

mysql_query("SET @@local.time_zone='offset'", $this->link);

 

Now save the file!

 

The third file you will need to edit can be found in the flash/modules/global/inc/ folder under the name of db.inc.php. (public_html/ flash/modules/global/inc/db.inc.php if your Boonex Dolphin platform is installed in the public_html folder).

Find the following line of code in that file:
 

mysql_query("SET @@local.connect_timeout=9000;", $this->rLink);

 

and add AFTER it the following code:

 

mysql_query("SET @@local.time_zone='offset'", $this->rLink);

 

Now save the file!

 

The fourth file you will need to edit can be found in the modules/boonex/forum/classes/ folder and ti is called BxDb.php (public_html/modules/boonex/forum/classes/BxDb.php if your Boonex Dolphin platform is installed in the public_html folder).

Find the following line of code in that file:
 

mysql_query ("SET NAMES 'utf8'", $this->link);


and add AFTER that line the following code:
 

mysql_query("SET @@local.time_zone='offset'", $this->link);

 

Now save the file!

 

That is all! Once you are done with all of these changes please do not forget to clear the cache of your Social Community via Tools >Cache by clicking on the Clear All link.