This tutorial covers Google Analytics integration, mass mailing, databaserestoration, searching for content, backup phpBB3, backup restore and speed optimization.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Integrating Google Analytics
Google Analytics is a powerful tool of monitoring the traffic on your website. It is mostly used by the administrators of your board and in this tutorial we are going to show you how to integrate this feature with your Board in few easy steps.
To integrate Google Analytics with your phpBB3, you need to:
Step 1: Obtain the Analytics code
Step 2: Integrate the Analytics code
Step 1 Obtain the Analytics code
First you will need to have an active Google Analytics account. You should be able to sign up for such at the official Google Analytics homepage.
Once you are logged into your Google Analytics account you will need to obtain the tracking info provided by the feature. It is located under Admin>Tracking Info>Tracking Code for the website you have added to the service.
Usually the code is provided under the “This is your tracking code..” sentence on the accessed pacge and you should be able to easily copy it.
Step 2 Integrate the Analytics code
Now that you have your tracking code it is time to integrate the code with your phpBB 3 platform. Unfortunately the platform does not provide a universal way of doing such integration and you will need to add the code manually to one of the files of your board.
The file where that code should be implemented is located under:
/installation_directory/styles/style-name/template/
The “installation_directory” is the actual directory where your board is installed at and the “style-name” is the actual name of the style you are currently using as default. Note that if you change your default style in future you will need to reapply the code for the new style as well.
The most convenient way of editing the code of that file is by using the integrated in your cPanel Code Editor. The feature is located under the File manager service of your cPanel. So basically you will need to navigate to the folder where the template of your currently used style is located using the File Manager service and locate the file “overall_header.html”.
In the newly opened window you should be able to find the following line of code:
<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
Paste BELLOW that line of code your Google Analytics tracking info code you have obtained in Step 1 and save the file.
Now you will need to allow few days for Google Analytics to properly collect the access information so you can be presented with the same in your Google Analytics account.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Sending email to all of the members
The phpBB platform offers you the option to send an email to all of the members registered on your board. Such emails are usually used for some important announcement or for some notice to be presented to all of the users.
The process of sending mass emails in phpBB3 includes these steps:
Step 1: Access the Mass E-mail feature
Step 2: Configure and Send your message
Step 1 Access the Mass E-mail feature
In order to access the Mass e-mail feature you will need to login into the Administration Control Panel of your Forum and to navigate to System>Mass e-mail.
This link will redirect you to the Mass e-mail page where you will need to configure the email you will be sending.
Step 2 Configure and Send your message
The available fields for the configuration are included into the Compose section of the Mass e-mail page and the most basic you will need to fill are the Subject and Your Message fields.
Once you have filled the fields you will need and you are ready to send the email please scroll down to the bottom of the page and press the E-mail button so your email can be send immediately.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Restoring the Database of your board
phpBB is php/MySQL driven platform and as such it requires a backups for the database to be performed on regular base. Assuming that you have already generated a backup for the database, in this tutorial we will show you how to restore it using the restoration feature included in the Administration Control Panel of the platform.
If you are wondering how to generate a backup for the database you should check our other tutorial on that matter.
To restore your board's Database, you need to:
Step 1: Access the Restoration page
Step 2: Restore the Database from an existing backup
Step 1 Access the Restoration page
In order to access the restoration feature you will need to login into the Administration Control panel of the platform and then navigate to Maintenance>Database>Restore.
Once there you will be able to notice a detailed description of the feature right below the name of the feature – “Restore”.
Step 2 Restore the Database from an existing backup
In order for the restoration process to begin you will need to simply select the backup you would like to restore and then to click on the Start Restore button.
Next you will be asked for a confirmation if the database should be restored and once you confirm the restoration it will begin.
The restoration process might take a while if the database of your Board is too large and you should allow some time for the process to be finished.
Note: The restored database will take the place of your currently used database. This mean that all records added to the database (such as posts, topics, forums, new users, user settings etc.) after the generation of the backup you are restoring will be LOST!
At the end you will be presented with message indicating that the database has been restored successfully.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Using the phpBB3 integrated search
The Search feature of the phpBB platform allows you to easily search the posts in your forum and also it provides you with large amount of search options which we will review in the following lines of this tutorial. The basic search will allow you to specify a single key word and the platform will automatically run this key word for matches against all of the posts you have on your Board.
To search for content inside your phpBB3 Board, you need to:
Step 1: Locate the Search feature
Step 2: Use the Advanced Search feature
Step 1 Locate the Search feature
The Search box will be presented at the top right corner of your board once you login in the frontend of the board.
The so called Simple Search can be used by directly using the keyword you would like to search for in the Search box without any other settings for the search.
Step 2 Use the Advanced Search feature
The Advanced Search feature allows you to specify concrete search criteria so the search can be more accurate and present only the most related results. In order to use the Advanced Search feature you will need to simply click on the Advanced Search link located bellow the search box.
This link will direct you to the Search page where you will notice few sections of searching options. The first one is called Search Query and there you will need to enter the keyword you will be searching for and/or the author of the post you are searching for.
The next section of options is called Search Options and it contains the advanced search criteria you will need to select as options.
First in the list of options is the Search in Forums options where you will need to select the concrete forum you would like to search for the above entered keyword.
Next you will find the options Search subforums and Search within which will allow you to search also the subforums for the keyword and also to specify more concrete the searched contents such as message, topics or posts only.
Last in the list you will be able to locate the options for how the results should be displayed. These are quite intuitive and you should be able to easily configure them.
Once you are done with the settings of the search options you should click the Search button so the search can begin. Depending on the options you have selected and the amount of searched contents the search process can take a while. Once the search is finished you will be presented with a list of the found entries as posts.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Backing up the Database of your Board
Backing up the database of your Forum on daily or weekly basis is an action which will provide you with a backup plan for every possible issue you might experience with your application.
To backup the Database of your phpBB3 Board, you need to:
Step 1: Access the Backup Restoration page
Step 2: Configure the Backup Procedure
Step 1 Access the Backup Restoration page
In order to access the backup feature for the database of your Forum you will need to login into the Administration Control Panel of the Forum and navigate to Maintenance>Database>Backup.
This will redirect you to a page where you should configure the backup before you can download it.
Step 2 Configure the Backup Procedure
The options available on the page for configuration are the following:
Backup Type (The type of backup you would like to perform for the database of your forum):
Full – Complete backup of the structure and data contained in the tables of the database
Structure Only – Only the structure of the tables in your database
Data Only – Only the data contained in the tables of your database
File Type – Once the backup is generated you will be prompted to download it and this option will allow you to choose either if the file should be compressed or you would like to receive it as plain text
Action – Either if you would like to have the backup stored on your hosting account where your forum is installed and accessible at or if you would like to download it. Werecommend for the backup to be downloaded locally in order to avoid its loss in case of emergency related to file loss on your Forum
Table Select – Select the tables you would like to be included in the backup. Usually here you should simply click on Select all so you can have the entire database backed up, however if you prefer to have a backup for concrete tables and not for all of them you should simply select the tables you will need to backup
Once you have configured all of these settings it is time for the backup to be initiated. This can be achieved with the Submit button located at the bottom of the page.
Then you will be prompted with the file in which the database is backed up for download and if you accept the download and allow few minutes you will have the backed downloaded on your local computer.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Generating a full phpBB3 backup
Creating a backup of your entire Board will guarantee that you will have a restore point on your local computer for the files and the database of your Board. It is important that you make such backups at least once a month or when you are implementing some major changes on your entire board.
To make a full backup of your phpBB3 Board, you will need to:
Step 1: Download all of the files
Step 2: Export the Database
Step 1 Download all of the files
In order to backup all of the files of your Board you will need to download those. This can be easily done via the FTP service for your account. If you are not familiar with that service please check our full FTP tutorial series.
Once you are connected to the folder where your phpBB 3 platform is installed you will need to select all of the files by actually selecting a single one and using a keyboard combination of Ctrl+a.
Then you should simply right-click and choose the Download option so you can begin the downloading process. Once the process is finished you will have a full backup of the files for your Board.
Step 2 Export the Database
In order to backup the database of your script you can consider the following two options:
• Option 1: Simply follow on of our other tutorials from the phpBB3 series.
• Option 2: Manually export the database of your phpBB3 platform via the phpMyAdmin feature provided in your cPanel.
If you are not aware for the name of the database your phpBB3 Board is using you can check it in the configuration file of the platform. That file is located in the root (installation) directory of the platform and it is named config.php.
If you check the code of that file you will find the line beginning with the “$dbname” sting and there you will find the database name. For example:
$dbname = 'example_phpb585'
Once you know the name of your database you should be able to easily locate it in the left navigation menu of the phpMyAdmin feature once you access it. If you click on the name of the database there you will be presented with a full list of the tables contained in the database which is the actual data you will need to export.
Then by simply clicking on the Export button from the top navigation menu you will be able to export the database on your local computer.
Further reading:
How to manage your phpBB3 board
Managing Users and Permissions in phpBB3
Optimizing the Loading Speed of phpBB3
The optimization of your phpBB 3 board can be performed by many ways, however before you can begin with this procedure you will need to analyze the resource consumption of your board and of course to check its loading speed.
This can be easily achieved if you look at the resource consumption of your board via your cPanel > Resource Consumption and also if you test your Board via some of the online speed checking tools.
Assuming that you have received not satisfying results from these checks you will probably want to optimize the loading speed and in this tutorial we will show you few techniques for doing so.
To optimize the speed of your phpBB3 Board, you need to:
Step 1: Optimize the Database
Step 2: Optimize using the .htaccess file
Step 3: Optimize the Server Side
Step 1 Optimize the Database
First technique we will present you with is related to the optimization of your database. Since your database is the main storage unit where all of the forums, posts, user information and configurations are stored you will need to determinate if its size is too large and what generates this size. You can perform that via the phpMyAdmin feature of your cPanel.
There, once you access the database you will be able to sort the tables of your database by size in order to determinate which from the tables are with the most largest size.
Usually if you have spam posts on your Board you will notice how the *_posts table will be probably largest. In such case you will need to remove the spam posts and reduce the size of that table.
You should do so for every table you are finding with needlessly large size and once you are ready with the reducing of that size you should run the following procedures for all of your tables of your database:
- Check Table
- Repair Table
- Optimize Table
In order to run these you should select all of the tables in your database and scroll down to the bottom of the tables view page where you will find a drop-down menu called “With Selected”. There you will find the mentioned scripts.
You should do that action for each one of these procedures – selecting all of the tables and then selecting the procedure.
Step 2 Optimize using the .htaccess file
Now that you have your database optimized it is time to optimize the loading speed of your website by enabling few server side features.
The first feature is called Leverage browser caching and it is related to setting an expiry date or a maximum age in the HTTP headers for static resources.
This action will instructs the browser to load previously downloaded resources from local disk rather than over the network. In simple words you will allow your users to cache the static contents of your website on their local computers which will allow these resources to be loaded from there instead downloaded each time they access your phpBB 3 Board.
In order to activate this feature you will need to add few additional lines in the .htaccess file of your board using for example the Code Edit feature of the File Manager service provided in your cPanel. Once you open the file for editing please paste the following lines in it:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING ##
These direct instructions will tell the browsers to cache the listed resources for period of 1 year.
The second feature is also an optimization you can perform by adding some extra lines to the .htaccess file of your phpBB 3 Board. This feature is called Mod_Deflate and it serves for the compression of static contents. The compression is reducing the overall size of the downloaded static contents by your users which is dramatically decreasing the loading time in combination of the Mod_Expires directives we have mentioned above. In order to activate the compression please paste the following line into the .htaccess file of your phpBB3 installation:
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
Step 3 Optimize the Server Side
In this step we will discuss some other additional optimization techniques which are commonly used on VPS/Dededicated Server solutions as the shared hosting environment will not always allow these.
The feature is called Memcache and it is NOT natively supported by the phpBB 3 platform. In order to have this feature installed you will need to download a single file from the authors of the ACM plugin and place the downloaded file in the following folder of your phpBB 3 installation:
/phpBB3_installation_folder/includes/acm/
Where the “phpBB3_installation_folder” is the folder where your phpBB3 installation is located. The file should be named the same way as the above URL suggests - acm_memcache.php.
Once you have the file in the correct folder you should get back to the installation folder of your website and find the config.php file where you will need to change some code. Please find the following line of code in that file:
$acm_type = 'file'
And replace that ling entirely with the following:
$acm_type = 'memcache'
This will tell your board that the Memcache apache module is installed and it can begin using it.