Site cleanup

I’ve spent the last two days cleaning up the website. Some pages were removed. My services page was broken down into a number of pages for easier reading. I changed some page titles and edited one form. I also updated the theme. Hopefully the site is cleaner, less cluttered and easier to use.

February 2018 work summary

The nature of my business seems to be that it the work is few and far between or it all comes in at once. The first half of the month was mostly quiet. The second half was mostly busy … too busy. Anyhow, here’s a summary of my work in February. As always, I am not identifying my clients:

  • A lot of work here for one client. Basically, the client wanted a whole lot of changes to his forum. The endeavor was sort of successful.
    • I installed a development radio extension. This puts a player on the screen that plays music from a playlist for all members on the forum. I had to tweak the composer.json file to get it to install. To get the radio player images to appear on the portal, I had to hack one of the programs for the extension to use an image path that starts with / or they would not appear on the portal.
    • I tried to install Tapatalk a number of times but to no avail. I kept getting an installer error creating the Tapatalk tables. Upgrading phpBB didn’t work. So I tried installing an earlier version of Tapatalk. That didn’t install either. Since the issue was with the Tapatalk table not being created, I installed Tapatalk on a test environment, got the needed SQL there using phpMyAdmin and recreated it manually on the client’s site in phpMyAdmin. I changed the phpbb_ext table to make it active and cleared the cache. I could then see it in the Extensions tab and could enter the key.
    • Created an Apache redirect so non-www URLs went to www instead. Lines were added to .htaccess file.
    • Changed the color of the text in mChat when editing chat text. It was white on white, made it black on white.
    • Added a favicon for the site
    • Installed an extension to open external links in new tabs
    • Installed the Profile Flair extension. This allows badges to be created.
    • Installed the YouTube Video Gallery extension. It requires creating an application in Google console to enable, which the client did.
    • Updated phpBB 3.2.1 to 3.2.2. Applied three manual changes afterward, bugs that were subsequently found in the release.
    • Edited some colors on the portal sidebar that kept text from being seen.
    • Fixed a resizing issue with embedded videos on mobile devices by adding max-width:100% and max-width:100% CSS directives for the object tag.
    • Made more tweaks to colors for the “time” line near the navigation bar, made better CSS selectors for poll links in the portal and moved vote buttons in the portal more to the right, along with vote totals.
    • Radio extension turned out not to be viable. So I disabled it. I tried to place the player manually. I tried a number of approaches, once I figured out how to write the Javascript correctly. The easiest way was to turn it into an ad in the Advertisement Management extension and place it above the navigation bar.
    • More trouble with Tapatalk when the client tried to add a permanent Tapatalk key. Again the extension failed in an ugly manner and again the issue was some sort of database privilege that should have been there was not, probably for creating new objects like tables, columns and indexes. I commented out some code in the extension to get it to come up so the board was usable, but feels jury rigged. Installed some smilies that client needs to configure. The client is getting with his web host to try to solve the underlying issues of database privileges needed to create new tables that seems to be the issue with Tapatalk.
  • I upgraded forum from phpBB 3.0.10 to 3.2.2. I applied patches to 3.2.2 after the upgrade. There were two issues during the upgrade. The first (duplicate row in config table) went away by running the upgrade again. The second required using phpMyAdmin to edit the prosilver style and make it active. Then the upgraded completed. I removed some dead modules carried over from phpBB 3.0. I created keys on reCaptcha site and entered them into reCaptcha spambot settings, but they were not recognized. I eventually discovered if I requested invisible reCaptcha those keys would work. There was a similar issue with a Cleantalk authorization key. The client had to generate a key on Cleantalk site and he installed it himself. I also installed the Advanced BBCode extension. I noted an email error I encountered with the upgrade. It may be an issue with integration with email. Later that day when the client removed my FTP account (since it gave access to the web root) it also removed everything in the public_html folder! So his whole web site including the forum was gone! The web host had to recover it. The next day I reapplied the file changes for the upgrade and uploaded the programs for the extensions that were installed. The database was still good so I didn’t need to run the upgrade program again. The client asked me to look into errors in some 3rd party software tied to phpBB in his members folder. It asked for PHP 5.4. I changed his .htaccess file but that exposed an issue that the code was using super globals, so it didn’t work. I suggested contacting the original author and having him update the program to use the new phpBB 3.2 libraries. Client eventually figured it out himself.
  • Lots of work for this client too:
    • I converted a forum from phpBB 2.0.23 to 3.2.2. About 200,000 posts with about 7000 attachments. The conversion went smoothly. Allen Subsilver style installed. I replaced the logo. I recreated search index. I moved the old forum into old_forum folder where it exists as an archive.
    • Later I installed a Board Rules extension and Custom Registration Agreement extension.
    • Customer discovered a weird problem. When using the search index, sometimes a XML parsing error occurred. After lots of puzzling it through I realized I had seen this before. Non UTF-8 characters (probably belonging to the Windows character set) were in post_text column and other columns. The parser could not parse these characters because they were not translatable into UTF-8. I fixed it with SQL using MySQL CAST and CONVERT functions on all columns in tables where users type in text.
  • Removed and re-place some ads in overall_header.html for a phpBB 3.0 forum
  • I got called in as a consultant for a huge forum, the biggest I’ve ever seen: 14M posts! That’s about 4 times as many posts as are on’s forums which have been running since 2001! What a strange issue they were having! For about 48 hours they could operate as normal, then the database would freeze updating num_posts in the phpbb_config table. All they could do is recover the database and start again, then 48 hours later it would happen again. They were very frustrated. The error message suggested that some transaction was not getting completed. In addition, the value for num_posts in the phpbb_config was not consistent with the actual number of posts. On top of all this, this phpBB 3.0 forum has a site Wiki outside of phpBB, and the Wiki made posts to their forum using a MySQL stored procedure. What to do? It took hours to get command line access just so I could look around. Once inside MySQL I looked at the tables. Most were using the MyISAM storage engine, but the phpbb_config table where the problem was happening was using the InnoDB storage engine. If I changed its storage engine to MyISAM, would the problem go away? I did and the problem went away! Oh, I also wrote some SQL so num_posts matched the actual number of posts in the phpbb_posts table.
  • Upgraded a forum from phpBB 3.2.1 to 3.2.2. No surprises.
  • Updated a forum from phpBB 3.2.0 to 3.2.2. A direct 3.2.0 to 3.2.2 update would not work and caused Symfony errors. After much trial and error an upgrade to 3.2.1 then to 3.2.2 worked. I reapplied the logo and styles. I was asked to set permissions so users could edit their own posts and to fix an issue with their posts not going through moderation. It took some puzzling to figure this out. Apparently when a new user registers, they are placed in both the Newly Registered Users group and the Registered Users group. Unless permissions for Newly Registered Users are set to Never the privileges for Registered Users, if more generous, will take precedence. So for Newly Registered Users, I added Never permissions for seeing forums they weren’t supposed to see. Although newly registered users were required to have one post before they were considered registered users, posts are only moderated if the moderation permission is enabled, which it was not. So I turned on these permissions for this group.

Digests 3.2.6 (not RC13 this time) released

Please see this post for details. You can download the latest version from my digests page or get it here in GitHub.

There’s really no new functionality but it does clean up a few bugs, changes in minor ways the look of some ACP pages (Edit subscribers mostly) and addresses the issues by the last review by the phpBB extensions team. It’s been submitted for review by the extensions team and most likely will get approved.

It took about 6 weeks to get a review last time, so I expect it will take about that long this time too. But maybe since it is reaching a release stage they will expedite the process.

Some pricing changes

I’ve upped some of my prices. You can see a list of all my prices on my services page.

I’m trying to recapture the labor involved in answering your questions prior to you hiring me. Not everyone who inquires of my services hires me of course. Typically there is at least an hour of time involved in back and forth emails with clients. This time was not built into my pricing structure, meaning I am effectively discounting my own labor rates by giving away this time for free.

So mostly this amounts to $10 or $20 increases for services I do most of the time, such as updates, upgrades, conversions and extension installations. My basic labor rate is unchanged. Obviously if you choose not to hire me you don’t have to pay anything. But if you do I want the work I do for you to reflect the full amount of my effort. And that typically involves at least an hour of back and forth communications over email, often more, usually over many days, as details about the work are refined.

My prices remain very competitive. If you can find a better deal out there, please go for it.

I also updated the page to discuss developing extensions for clients. In general I don’t do it, but I will refer you to other extension authors I trust. Mostly it’s due to a lack of time as developing extensions takes considerable time. Extension development is quite costly and most clients usually decide they cannot afford to have custom extensions developed anyhow.

January 2018 work summary

I didn’t do much work in January, mainly because I spent most of it on vacation: 19 days in total! It was a great vacation: a 16 day circuit of the Panama Canal on Holland America, from Fort Lauderdale to San Diego with lots of ports of call. In addition we stayed an extra day in San Diego to see its infamous zoo! I do have a few buns in the oven at the moment including a large project for a large client that I am starting work on that may take a month or two.

During my vacation my site’s certificate expired. I tried to fix the issue remotely when I had Internet, but just couldn’t do it with my Windows laptop. That may have cost me some business. It’s all fixed now.

On the infrastructure side, I upgraded my iMac to use a solid state drive. Things are so much spiffier now!

Before and after my vacation though I did squeeze in some jobs:

  • A client got rid of his forum due to low traffic but wanted me to do some WordPress work for him. He was been having WordPress security issues. I examined his WordPress .htaccess file. I found no issues there but redundant duplicate code was removed. I explained how the .htaccess file works and provided advice on updating, finding, fixing and proactively handling security for WordPress including Wordfence and UpdraftPlug plugins.
  • Two forums were upgraded for the same client, both from phpBB 3.0.12 to 3.2.1. Since the forums caters to German speakers, with the upgrade I installed two German language packs (casual and formal honorifics). On the first forum, I installed the prosilver_se style. I installed the Navbar search extension thinking it would help with styling but eventually disabled it as it was not needed. I changed style a bit to somewhat match old logo and background, experimenting with CSS until I found something that fit. Since the user could not login, I created a new account (after enabling registration) and gave myself founder privileges in the database. The next day I upgraded the second forum. I integrating the old logo but it did not look right with the new style. I tried changing the background color for the style but it still looked off. However, it was acceptable to the client. I then installed version 3.2.6 of my digest extension, and set up and tested the system cron job to ensure digests went out in the hour requested. I used curl and set the cron to run at top of the hour. I resolved a permissions issue that allowed any registered user to be a global moderator. There were some hosting issues: I could not find a link to cron in the web host control panel until the customer added it to my account. The next day I fixed a database issue: changed default for user_topic_sortby_type from m to t. This was apparently changed by some phpBB 3.0 mod. I updated the database to change this value to t for all users.
  • Troubleshooting. A forum gave a “is_dynamic missing” error message, which was actually a row in the phpbb config table. It took a bit of puzzling but it turned out that the forum’s config.php file was pointing to a phpBB2 database! No wonder the row was missing! I searched and found another database that looked like it had the tables for phpBB 3. But it was missing the last 5 tables. I found a copy of the database in the store folder dated 12-18-17. With customer’s permission, I reloaded that database. Bringing up board, the phpbb_login_attempts table was missing so I created it manually. I could not login with customer’s credentials so I created an account for myself and gave myself founder privileges via the database. The subsilver2 style was misidentified as Red Silver. I renamed it to subsilver2 in the database and enabled the Red Silver style. This fixed the styling issue and the site’s logo appeared in the header like before.
  • I upgraded a forum from phpBB 3.2.1 to 3.2.2. An issue with quoted characters repeating themselves horizontally and vertically, overwriting the quote, was solved with upgrade. Replicated logo in header and changes to footer. This was my first attempt to update to phpBB 3.2.2. I quickly learned that (a) the incremental update still does not work reliably and (b) you need to apply some patches. Other than that (to quote Monty Python), phpBB was perfectly fine!
  • I upgraded another forum from phpBB 3.2.1 to 3.2.2. Database updater failed due to timeout. The real issue were some bugs in 3.2.2 and had to apply some patches to complete the upgrade. I reapplied the logo. The search index erroneously pointed to nonexistent MySQL index. Pointed it to phpBB native and message went away.

End phpBB update styling rework with a custom style

Updated February 15, 2018 to add a few things.

Has this happened to you? You update phpBB to the latest version and find out that your custom logo or various style changes that you tediously made to phpBB are gone, or partially gone. It’s a common problem and one reason many forum owners defer updating phpBB.

You can end this hassle by creating and installing your own custom style. Using this approach your custom style inherits most of its styling from a primary phpBB style. You then selectively override the primary style’s CSS, HTML or Javascript with your own changes. This way when the primary style you use is changed, you don’t lose your custom changes. This also ensures that your styles and templates use the most current and approved code, which often includes security patches.

In this tutorial I will show how you can do this. I will keep my example simple by using my custom style to swap out the default phpBB logo with my own logo, sized to the new logo’s dimensions. In principle though you can go way beyond this simple use. For example, your custom style can overwrite the inherited style’s colors, padding and margins, or container widths and heights. You can also overwrite HTML and Javascript files.

Overview of steps required

The basic approach is:

  1. Make a note of all the changes you made to your style
  2. Reload your preferred style
  3. Create a custom style that inherits from your preferred style
  4. Override the preferred style’s stylesheet directives. This is best done by creating a stylesheet.css file for your custom style and placing your style customizations there.
  5. If you changed some templates, place the custom version of these templates in your custom style’s template directory. Frequently, forum owners will make changes to overall_header.html and overall_footer.html.
  6. Install the custom style
  7. Make the custom style the primary style
  8. Test and refine

Let’s delve into each step to see how this is done.

Make a note of all the changes you made to your style

You probably know what these changes are, but if you have any questions you can use a file comparison tool like WinMerge (for Windows) or kdiff3 (for pretty much any operating system) to compare your files with a reference version.

  1. Download your current style folder where you made all your custom changes, such as /styles/prosilver
  2. Download a reference version of your style for your current release of phpBB. phpBB keeps a list of its releases here. If your styles are based on prosilver then you would use the reference /styles/prosilver folder for your current release of phpBB. If using a different style, find the style version you used. You may have to download it from or from the style author’s website.
  3. Run the file comparison tool and note the changes you made so they can be reapplied in the custom style.

Reload your preferred style

  1. Make certain you have documented all the changes you made to your style. Once they are overwritten, you may not be able to recover them.
  2. Since you made changes to your preferred style, it’s a good time to undo them. The simplest way to upload the reference version of your style, replacing anything that’s there. Purge the cache. If you don’t see the style changes afterward, clear your browser’s cache and reload the page.

Create a custom style that inherits from your preferred style

  1. First review phpBB’s Creating & Modifying Styles page.
  2. Create a folder in the styles folder for the name of your style. In this example I keep it simple and call the folder “custom”, i.e. /styles/custom.
  3. Create a style.cfg file in this folder. Copy the style.cfg contents from your parent style’s style.cfg file. Below is the code in /styles/prosilver/style.cfg for phpBB 3.2, which I used because my “custom” style inherits from prosilver.
# phpBB Style Configuration File
# This file is part of the phpBB Forum Software package.
# @copyright (c) phpBB Limited <>
# @license GNU General Public License, version 2 (GPL-2.0)
# For full copyright and license information, please see
# the docs/CREDITS.txt file.
# At the left is the name, please do not change this
# At the right the value is entered
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
# Single and double quotes do not need to be escaped.

# General Information about this style
name = prosilver
copyright = © phpBB Limited, 2007
style_version = 3.2.0
phpbb_version = 3.2.0

# Defining a different template bitfield
# template_bitfield = lNg=

# Parent style
# Set value to empty or to this style's name
# if this style does not have a parent style
parent = prosilver
  1. In my example I changed “name = prosilver” to “name = custom”. Since I want to inherit from prosilver I left the “parent = prosilver” line unchanged. If you are changing a style other than prosilver as the primary style, you need to change the parent style to the correct style name. It must match the parent folder name in the styles folder. You might also want to edit the copyright, style_version and phpbb_version lines. If it’s only for your own use, this is not necessary. Here are my changes:
# General Information about this style
name = custom
copyright = © Mark D. Hamill
style_version = 1.0.0
phpbb_version = 3.2.2

# Defining a different template bitfield
# template_bitfield = lNg=

# Parent style
# Set value to empty or to this style's name
# if this style does not have a parent style
parent = prosilver
  1. Save the file, making sure it is in the root folder for the custom style, e.g.: /styles/custom/style.cfg.

Override the preferred style’s stylesheet directives

  1. Create a theme folder for your style. In my example, this would be /styles/custom/theme.
  2. Create an images folder inside the theme folder. In my example, this would be /styles/custom/theme/images.
  3. If changing the logo, upload the logo you will use to /styles/custom/theme/images. Make a note of the image’s height and width as you will need this later.
  4. Create a file called stylesheet.css in the theme folder.
  5. To inherit styles from your parent style, you need an @import statement at the top of this file. For example, if prosilver is the preferred style, this line would be at the top of the file. Generally you just need to reference the stylesheet.css file in the parent style. You will have to amend the path so it finds the parent style’s stylesheet files. In my case for the @import line, I added “../../prosilver/theme/”. The ?v=3.2 indicates the version of phpBB expected, so it may have to be changed.
@import url("../../prosilver/theme/stylesheet.css?v=3.2");
  1. Any style changes that you want to override should now be appended to the end of this file. In the example of replacing the logo, in the prosilver style you would normally edit the .site_logo class in colours.css and common.css. In my case I added these lines at the end of my /styles/custom/theme/stylesheet.css file, which provides the correct image to use for the logo and its proper dimensions:
.site_logo {
    background-image: url("./images/mark.jpg");
    width: 181px;
    height: 229px;
  1. I then saved the file stylesheet.css with my changes.

Changing templates

In my example, since I am only replacing the logo so no template changes were needed. If you need to change templates there are two approaches.

  1. The simplest is to copy the template, for example, /styles/prosilver/template/overall_header.html to /styles/custom/template/overall_header.html. Then make the changes that you need to make and save the file. This has a downside: if there are changes made to this template with an update, your version won’t have them unless you manually inspect for any changes and apply them to your custom version.
  2. In many cases you want to insert some HTML or Javascript rather than change existing HTML or Javascript. In this case it’s better to use template events, if you can “hook into” an appropriate event. This way if the parent style is changed with an update, you don’t have to worry about replicating any changes to it in your style. For example, overall_header.html has a template event in it marked as <!– EVENT overall_header_head_append –>. In this case you could create an event folder in your template folder then create a file called /styles/custom/template/event/overall_header_head_append.html. Add whatever HTML you want inserted when this event is encountered into this file. A list of template events can be found here.

Install the custom style

  1. ACP > Customise > Style management > Install Styles
  2. Select the new style you created (“custom” in my example) by pressing the corresponding Install style link.

Make the custom style the primary style

ACP > General > Board configuration > Board settings. Generally you set the default style to your new custom style, the guest style to your new custom style and you may optionally want to set the override user style option to Yes. Submit the form.

Test and refine

You should not need to purge the cache if you make any stylesheet changes. However, if you make subsequent changes to any templates first purge the cache then test.

Approach when upgrading

This approach is unlikely to work correctly when upgrading. An upgrade is when you go from one minor release of phpBB to another, such as from 3.2 to 3.3. You can of course go through the process of creating a new custom style again. As for updates, this should work.


December 2017 work summary

December was a very slow month. December often is as clients have other priorities as did I. I finished teaching a class and issues two new releases of my digests extension. Revenue-wise, 2017 was my best year so far. Here is a summary of my paid work in December. All client information has been anonymized. Since I will be on vacation for 18 days in January, I expect next month will be slow as well.

  • Undertook a painful upgrade of a forum from phpBB 3.0.1 to 3.2.1. It ended up taking most of the day. A database timeout meant I could not upgrade phpBB on the client’s site. So I had to extract the database, download it, recreate it on my machine and convert it there. Some tables requires multiple extracts to export due to timeouts. Because I have PHP 7 on my main computer and I needed to first upgrade the forum to phpBB 3.0.14 (which does not work on PHP 7), I had to do the conversion on my laptop. After I upgraded the forum on my laptop, extracting the database from the laptop turned out to be an issue until I explicitly told mysqldump to export as UTF 8 (UTF-16 was the default). This seems to be a MySQL peculiarity when it runs on Windows. In addition, the client’s file manager was rudimentary. All files had to move using FTP. Installed the Advertising Management extension and mChat extension but left client to configure. Client will handle styling. Upgraded PHP to 5.6 (was on 5.0).
  • Moved a forum from Westhost hosting to A2 hosting. Client had a temporary domain name on the new host. I first tried to upgrade forum on old server but it didn’t work. I created a new forum on new server but database and files were not moved by the new host. Client provided a copy of the database. I loaded it on local machine (3.1.9 database) and upgraded it there to 3.2.1. I then created a new forum database on new host. I populated it with upgraded database from my machine. I changed folder permissions to standard. Moved /files, /images and /store folders from old server. Changed Imagemagick path as it had changed so embedded images would display. Installed ID_Launch Fresh Style. Installed Google Analytics and Shareon extensions.
  • Installed Authorized for URLs extension. I went through the client’s numerous user groups and disabled privilege for bots, guests and newly registered users. I enabled extension to work for every other group. I provided instructions for its use.
  • Troubleshooting. Slow server, mostly manifested in slow database but also a lot of spam traffic. I discovered a WordPress temporary table issue. Two search tables in phpBB had repair issues as well; repairs would not stick for long. To keep a lot of the spam traffic from ever reaching the server, I installed Tapatalk both for WordPress and phpBB and enabled its spam firewall feature. I changed the storage engine for forum tables to use InnoDB. Converting the search tables to InnoDB required doing it from the command line as phpMyAdmin would time out.
  • Issue with routing and mChat on other than first page of the mChat display. Not sure what was causing issue is. .htaccess file for forum was missing uploaded it but didn’t solve the issue. Suggested disabling mod_rewrite. Installed SEO Sitemap extension and Italian language translation for it.

Digests 3.2.6 (RC13) released

This version incorporates the bug that the Czech translator for digests, Petr Hendl found and fixed. You can download it from GitHub or on my digests page.

In my testing I was only able to get digests to mail from my web server when the email package size was 0. I assumed this was something about how my web server email interface was configured, which I can’t control.

I also assumed that when $html_messenger->send() was called it placed it into the queue unless email_package_size = 0. It’s counter-intuitive to call $html_messenger->send() and then have to call $html_messenger->save_queue() afterward to ensure it gets in the queue. Thanks to Petr, he determined this was the way it is apparently done.

So if you are using digests, after you install this release feel free to change your email package size from 0.

Digests 3.2.5 (RC12) released

Digests version 3.2.5-RC12 is released! In addition, it’s been submitted for extension team review. With luck it may finally get approved. Given its complexity I expect they will reject it again. I expect it will take a few months to get a review, based on past experience.

You can download the archive from my digests page.

Not much new, fixed some bugs, most changes are to the ACP:

  • Templates were converted to use TWIG syntax. Minor HTML5 validation errors were also fixed.
  • Fixed bug in Edit Subscribers that would store a user_digest_send_hour_gmt outside the valid values of 0 – 23 in certain cases
  • Balance load now has individual columns to show daily, weekly and monthly subscribers for a particular hour rather than use bold and italics to distinguish digest types
  • Fixed bug in get_subscribers_for_hour function. The second parameter for the function is supposed to be an offset in hours from UTC.
  • ACP edit subscribers and balance load functions now have different background colors for alternating table rows
  • As many inline styles as possible were moved into stylesheets
  • Fixed various SQL statements to cast values into integers or floats explicitly. This is a phpBB coding standards requirement.
  • In the admin log, dates now actually show two digit months and day
  • includes/html_messenger.php, which overrides the messenger class, was updated to include new code added in /includes/functions_messenger.php since the html_messenger class was first created