Blog

May 2021 work summary

May was a strange month. Not much work came in, but I was kept plenty busy anyhow. The reason I was busy was because of one large commercial client who I’ve been working with for more than a year now. By the end of the month I had worked 65.5 hours for this client, all at my commercial rate, so it was very profitable work. In addition the work was mostly interesting.

Work performed for this commercial client began with analyzing their shopping cart interface for phpBB 3.0 and trying to make it work on phpBB 3.3.4. When on the view topic page, administrators and moderators see additional fields under the user’s profile that link to their order history so moderators can respond to problems they are having with products they make. To make this work required an extension, tying some logic into some phpBB core and template events and writing some template logic too.

It turned out that another styling extension I wrote for them (to inject their proprietary headers and footers) interfered with this extension, so I had to make changes to that extension to carry this information too. This resulted in a re-think as we were beginning to introduce duplicate code across extensions. Since the styling extension always had to be on, it was the common dependency, so I moved the common code into that extension and adjusted the other extensions to use it the common code as a service. An issue emerged with duplicate post rows on the view topic page that was resolved with the help of kasimi on phpbb.com, who got a nice monetary tip as a result from me. It took a couple of weeks to tediously work through these issues.

Afterward I started next on an integration challenge. The accounting system for this client needs to send push events to synchronize its database with phpBB. For example, if a user’s email address or username changes on the accounting system, it must change in phpBB as well. In addition, the accounting system may issue a ban, which requires users to be banned on the forums as well, either permanent or temporarily. There is also a push event to remove an account, which will require a user’s account in phpBB to be removed as well. First I tried creating an extension with a public facing controller as the command is invoked as a HTTP request using curl. But no forum headers and footers were wanted, so this approach eventually introduced unacceptable problems. So the idea became to write something that works outside of phpBB’s extension system, refactoring code they had written for phpBB 3.0. I’m going with this approach now and have the ban logic working again, as well as user changes needed. Still quite a bit of work to go, and I struggled through a number of issues relating to the need to bypass phpBB’s session logic and cookie usage. This should be solved during June.

As for work for other clients:

  • Upgraded a board from phpBB 3.1.9 to phpBB 3.3.4. I created a custom style inheriting from AllanStyle-SUBSILVER style. Only theme changes were necessary. No surprises, it just took a while to make it work as a custom style.
  • Updated a board from phpBB 3.3.3 to phpBB 3.3.4. Updated the French Language pack to version 4.4.4.
  • Upgraded board from phpBB 3.2.2 to phpBB 3.3.4. There was a major issue during database upgrade … lots of timeouts. I had the client complain to web host about how locked down they were with phpBB and seeing error messages from phpBB to troubleshoot the issue. Not sure what changed, but I was eventually able to get it to work. I created a custom style inheriting from the ne-blackgreen style. I upgraded the advertisement management, national flags and Tapatalk extensions. Later, discovered that Tapatalk has some bugs working with phpBB 3.3. Wrote a hack to use a require_once statement in posting.php instead of an include statement to get around Tapatalk’s bugs.
  • Upgraded two boards for the same client, the first from phpBB 3.2.8 to phpBB 3.3.4, using the standard prosilver style with no extensions. An error when clicking on index went away when I changed PHP from 7.2 to 7.3. Change the CAPTCHA from default to reCaptcha V3. The second board was upgraded from phpBB 3.2.2 to to phpBB 3.3.4, but also updated Flat style to a phpBB 3.3 version and also upgraded these extensions: media embed, style logo and tables. Similar issue with the first board when clicking on the view topic link was mysteriously solved by changing PHP from 7.3 to 7.4. Regression tested the first board to make sure the earlier error did not recur. Investigated an emailing issue on the second board. Siteground’s SMTP mail server had changed as part of Siteground moving into the Google Cloud, but also the email account password was wrong so I had to reset it to get mailing to happen. I also found the domain on email blacklist on mxtoolbox.com. Sent recommendation to client to get off that blacklist and ask Siteground to allow outgoing emails (likely the issue why emails were not being received). I never received test email from phpBB, but phpBB reported no errors. Siteground has no tool to check email deliverability.
  • Upgraded a phpBB board from version 3.2.4 to version 3.3.4. I upgraded the AllanStyle-SUBSILVER style to latest unofficial version. I changed PHP to version 7.4. I removed from file system and the board’s databases for an extension and a bunch of Elegance styles. I created a custom style but all it does is place the new logo.
  • Updated phpBB from version 3.3.3 to version 3.3.4. Also updated the Italian language pack and Advertisement management extension (to version 2.0.4).

phpBB 3.3.4 released

Version 3.3.4 of phpBB was released today. It’s a maintenance version with no critical security fixes and no important new features. The only new feature that I could find is that it supports a new image format: WEBP, introduced by Google and supported by most browsers which provides more compact, lossless image rendering than PNG.

Mainly it offers better support for PHP 8. It contains a bug fix that I drew to their attention and an important fix that I stumbled across recently if you have unusual characters in your database name, which kept the database size from displaying and actually wouldn’t let you get into the ACP at all! But if you had this issue, you would have patched it already.

One thing you might notice: the RESET button goes away on a number of forms because, arguably, a RESET button is obsolete. One way to reset a form is simply to refresh the page.

So update to it if you want, but there is probably no tearing hurry for you to do so. You can download it from phpbb.com’s download page, read the announcement, see a summary of the release here and see all the issues addressed here.

April 2021 work summary

I stayed busy in April. The bulk of my work was for a commercial client, work that has been ongoing since February 2020. This work is part of a large project to upgrade their phpBB 3.0.11 board with lots of custom tailoring to phpBB 3.3, keeping the custom logic but moving it into extensions. Since last autumn we’ve been challenged to make a custom OAuth authentication work. In this case the client has its own OAuth server, so it’s a matter of creating an extension that handles this correctly. The good news is by the end of the month we had solved the last major OAuth integration issues. So my next step is to analyze the issues to replicate their moderation changes. The poster’s profile description on the view topic page contains information only seen by moderators including links to their order history. In addition there are two new moderation control panel screens with logic. Presumably this will handled by an extension. So this work tended to keep me busy and fill in time that would otherwise be slow.

Other work I did in April:

  • Converted a board from phpBB 2.0.21 to phpBB 3.3.3. There are only 1400 posts on this board. The major issue I dealt with was infrastructure related. The database server had been moved and old forum wasn’t connected up right to it. This involved lots of tedious back and forth conversation with the hosting company to get it fixed. The host also had to upgrade PHP to 7.2 because the control panel interface wouldn’t let me do it. After that the conversion was straightforward. I created a new phpbb3 database. I disabled the contact page and set up reCaptcha V3 spambot countermeasure. I re-created the search index and set a home link. I removed a dead report statistics module and changed the cookie name to address login issues. The old board’s files were moved into an archive folder.
  • Client’s board was having a problem sending email. I tried a number of things to no avail. Client worked with host and they upgraded to PHP 7.3. I reverted the email settings for the boarad to non-SMTP and a test mail reportedly went out. Later, I upgraded board from phpBB 3.2.8 to 3.3.3. I had to update the custom style to make it work on phpBB 3.3. The work was mostly on the breadcrumb menu, which changed with phpBB 3.3. New versions of LightBox, Thanks for the Posts and Cleantalk extensions were uploaded and enabled.
  • I upgraded a board from phpBB 3.2.5 to 3.3.3. This is a generic board with all the defaults and no custom styling. One weird issue occurred: an error saying all extensions were disabled but only default Viglink was installed and probably not used. Eventually I solved it by re-uploading a program that appears to have not uploaded correctly: dummy.php.
  • Installed phpBB 3.3.3 in a subdomain. Installed the proprietary Milk style. Tutored client for one hour online. Later, answered more questions and uploaded an extension for the client, who is new to phpBB.
  • Working with a client that eventually wants to upgrade their board to the latest. Their calendar mod is not available as an extension, so I installed a couple calendar extensions on my test board and let them see if one of them would meet their needs. It looks like one of them will, so I upgraded their testing board with the extension and some style changes with the hope of eventually upgrading the production board with these changes too. Work included a half hour chat over Zoom.
  • Attempted to upgrade a board but couldn’t because of FTP issues with hosting. Maximum of eight user connections allowed and these seem to stack up. FTP became essential because there was to interface on web host control panel to create or decompress archive. Spent an hour on technical support trying to resolve this with no success.
  • Finished a huge, hairy, and frustrating upgrade to phpBB on old GoDaddy hosting that only supported PHP 5. Move to new hosting plan had issues with MySQL buffer size that couldn’t be fixed. I tried to move to 3.2.11 on old plan, but after dropping the tables I was unable to load the converted tables due to shared hosting limitations. On my recommendation, the client eventually moved to Dreamhost and that worked on PHP 7.4 and phpBB 3.3.3. I installed four extensions, one style, a Bulgarian language pack, replaced logo and rebuilt search index.
  • Troubleshooting. The client was having issue with some images not displaying. He thought it was a Lightbox extension issue. There were about 100 orphaned attachments that were likely the root of the problem. Later, recovered the database but could not get into ACP. I purged the cache in the file manager and I was able to get into the ACP with his credentials.
  • I upgraded a board with 1.44M posts from phpBB 3.0.6 to phpBB 3.3.3. Client used a custom style but had no mods installed. I downloaded their database and converted it on my machine with no issues. Uploading database took a while due to many repeated 504 Gateway Timeout issues. I split the posts table into ten exports and eventually got all posts and all other tables moved over. Issue logging into ACP was due to colon in the database name. There is a patch to fix this that I installed and it should be fixed in phpBB 3.3.4. I installed the French language pack. I disabled the contact page and enabled the reCaptcha V3 spambot countermeasure. Later, the search index had to be rebuilt again. Spent ninety minutes on styling changes.
  • Build a commercial client for some minor work over the last few months, mostly related to troubleshooting issues that at its root were due to Tapatalk servers going down, and Tapatalk sending erroneous emails suggesting that upgrading their phpBB extension would solve the problem.

Tentatively recommending DreamHost

(If you decide to buy DreamHost hosting, please use my affiliate link. This way I earn a commission. You won’t pay extra.)

Hosting is changing

The world of hosting has been changing, and often not for the better (at least from the perspective of hosting customers). As I noted in this post, many hosts are getting gobbled up by other firms, usually Wall Street firms looking to maximize profits by consolidating hosts, cutting services and maybe raising prices.

Another big trend is to go virtual. GoDaddy, for example, is moving into Amazon’s cloud. That certainly saves the expense of managing their own hosting centers and paying a hosting staff. More recently, the same is true with Siteground, which I have been using for a few years, which is going into Google’s cloud. Siteground has also raised prices rather substantially, hoping most clients will opt for inertia. For its shared hosting, Siteground keeps an eagle eye on resources you are using and will quickly complain if you go over these resources.

So I’ve been looking for acceptable alternatives, always aware to not to put too much faith in my web host of the moment, since there’s a good chance they’ll get bought out, raise prices, reduce staff or do all of these things. I tend to be irritated by hosts that provide generally incompetent support staff, obscure really important features like limits on disk space or outgoing emails, or who raise prices way beyond the rise in inflation.

A week spent in GoDaddy support hell

I thought GoDaddy had been improving in general. Going virtual wasn’t necessarily bad if the cloud provider can provide greater speed and reliability. But this month I got caught up with a client using GoDaddy which suggested they were reverting to old habits. It might have been because his board was on an old machine that hadn’t transitioned to the cloud yet. The support experience with GoDaddy though was just horrible.

His plan was so old it only supported PHP 5. There was no migration path to PHP 7 except to buy a new plan, and they couldn’t be bothered to help him move his gigabytes of files from the old to the new hosting, or transition the database. Not that we didn’t try. Downloading and uploading files from home is generally a painful, tedious and slow experience. The volume of files was large and the uploading was very tedious because his ISP severely limits upload speeds. It took days.

On the back end I was busy trying to upgrade his board and get that working. The shared hosting timed out exporting a database and timed out uploading it too. I tried all sorts of tricks to get it to work and upgraded the database on my machine since the upgrade scripts would time out due to resource caps. This went on for more than a week.

DreamHost turned out to be reasonably dreamy

Eventually I recommended he get rid of GoDaddy. But where to go? I sent him to DreamHost.

I had a good impression of DreamHost based solely on a seminar I attended at a Boston Wordcamp in 2019. In the seminar the speaker talked about how they fended off lawsuits by the Trump Administration to monitor their servers, and succeeded. I asked my peers about DreamHost and the reviews were generally positive. Still you don’t know until you try.

Was rehosting with DreamHost a wonderful experience? Overall it was pretty good, but it had its quirks. Like most hosts they offer various kinds of hosting, and the client chose the shared hosting plan. Loading his database on DreamHost, it timed out there too with resource limitations, but I was able to work around the problem. His database is nearly a gigabyte in size. Essentially I figured out where it failed (in the middle of populating the phpbb_posts table) and created an extract of the rest of the database. That got the rest of it. I’m just glad I have a text editor that can handle really big files (BBEdit, BTW).

Their tech support was responsive, helpful and reasonably quick. One thing I liked was that they didn’t have explicit quotas on database sizes and overall file sizes. That was important for this customer. Looking through the fine print of the hosting plan, I saw only one red flag: there was a limit of 100 outgoing emails per hour. That didn’t matter for this customer. It looked like a good fit.

Curiously my hosting plan with Siteground was up for renewal, so I took the plunge myself buying their multi-site shared hosting plan. Siteground wanted about $300/year, and this initial 3-year DreamHost contract was about $142, which is a huge savings. This got me more into the weeds.

The good:

  • It’s a very good value. Naturally new customers get a discount. Mine is $3.95/month for three years (my contract) which is a great value if they can maintain the same level of service. The discount is 72%, so the non-discounted price is probably $12.95/month. This gives me unlimited storage, bandwidth and databases, making it a good deal if you have to store lots of stuff online. However, it is shared hosting so it’s not appropriate for highly trafficked sites.
  • Technical support was reasonably quick, responsive and helpful, and I threw a lot of issues at them.
  • Moving WordPress sites is easy. They offer a plugin you put on your old host. You enter the WordPress username and password and wait. It does the work for you.
  • It’s easy and quick to set up free Let’s Encrypt certificates. But you have to wait until the DNS transfers to DreamHost. (There’s no way for any host to get around this.) So for a short period of time there will be certificate errors.
  • End to end solid state hosting. This speeds up rendering of web pages and makes the hosting more reliable.

The bad:

  • While tech support was good, they are based on the USA West Coast, and they work standard hours. It doesn’t appear that support is available outside of this window, although it is available seven days a week.
  • 100 emails per hour is pretty skimpy. Anything over that just doesn’t get sent and won’t go into a queue for sending later.
  • Testing your domain can be confusing. Your database server will have a subdomain like mysql.mysite.com but until the DNS transfers over the only way to test it with a database is to configure the database server’s IP address. (This was a problem with phpBB, but not with WordPress thanks to their plugin.) Otherwise modifying the local hosts file worked for testing. So you really need to remember that the server’s IP could change, so after the domain moves you should go back and replace the IP with the subdomain name.
  • Their support system has no way to reply to a ticket, as best I can tell. So I coped by entering a new ticket with the same subject line.

The weird and unusual:

  • No cPanel. They rolled their own control panel and it’s not the most intuitive. For example, it’s unintuitive to go to Domains > Manage websites to manage a website. Most hosts cleanly split domain functionality from web hosting.
  • For each domain or subdomain you get a separate set of SSH and FTP credentials. Keeping these organized is a bit of a challenge!

If you can deal with these oddities, DreamHost may be for you. It is for me, presumably for the next three years at least! It does appear to be a very good value.

March 2021 work summary

I kept very busy in March with little downtime. I did make some progress on a new version of my digests extension that should be able to better handle resource timeouts by failing more gracefully and not locking phpBB’s cron process. But mostly paid work got in the way of this other stuff. Here’s a summary of my work in March:

  • I removed an administrator and answered some questions for a client I helped in February.
  • Completed a long standing project by doing a final conversion for project: Delphi forums to phpBB 2 to phpBB 3.3.3. The phpBB files and database were then given to another contractor. Ultimately, it was converted again into bbPress, a WordPress bulletin board plugin. The client has now successfully moved his entire platform inside a WordPress framework in this months-long project.
  • Upgraded a board from phpBB 3.0.12 to 3.3.3. I changed the version of PHP to 7.4. I installed the Tapatalk extension (previously in a phpBB 3.0 mod) and reentered its key. Client chose the AllanStyle-SUBSILVER style to replace subsilver2 style, and I added their logo. I disabled the contact page and added a new home link on the navigation bar. I set up the reCaptcha V3 spambot countermeasure. Then I recreated the MySQL fulltext index. Later, I addedthe Black style and replaced the logo by editing overall_header.html.
  • Upgraded phpBB from version 3.2.7 to 3.3.3. I also upgraded the Lucid Lime style and created a custom style based on Lucid Lime to insulate some minor style changes. I updated the following extensions: 24 hour stats, Header links, Lightbox, Max-Width switch, phpBB Media Embed and the Sortables Captcha. I had to edit the services.yml file for one extension to get it to work. Upgraded German Casual Honorifics language pack to latest version. The security certificate is invalid. The client needs to take care of that. Later, I recreated as best I could the header links managed by the Header links extension. They had to be deleted to install the new extension. I also changed the header bar background color to black.
  • I updated a phpBB board from version 3.3.0 to 3.3.3. I created a custom style to show correct logo and to isolate navbar_header.html which shows an active topics link.
  • I updated a phpBB board from version 3.3.0 to 3.3.3. I updated the prosilver_se style, and reapplied their logo by replicating changes to stylesheet.css file. I installed and configured the Cleantalk extension and set up reCaptcha V3.
  • I upgraded a board from phpBB 3.0.14 to phpBB 3.3.3. Errors during upgrade required moving their database to my machine and upgrading it there. But the export had issues. Certain columns did not have the auto increment property set or default values, for example. I did not move over search tables, as they were too big and could be recreated. I set up reCaptcha V3 and disabled the contact page. I added a Home link. I installed the Black style. Recreated the search index overnight. Made test posts and private messages, revealing issues in phpbb_topics table and phpbb_privmsgs tables where some varchar(255) columns were blobs and there was no default value. Fixed those but there may be others. Client will finish fine-tuning the style.
  • Did check up of a board as requested as client reported various problems. I verified that phpBB 3.3.3 software was installed but phpBB 3.3.0 was reported in the database, so I changed the version reported for phpBB in the phpbb_config table. I also verified that all migrations were up to date. The main problem was there were lots of old and unused modules from phpBB 3.0 for various mods that needed to be removed including Gallery, Cleantalk, mChat, Category rules, Users merge, Report reasons and Blog. I provided a summary report. Encountered an issue creating new forums. A non-standard column did not have a default value. Removed it and a few others from the forums table and was able to create a forum. Next: I did a general database cleanup, removing unused tables, columns and removed a lot of rows from the phpbb_config table by comparing his tables with a reference implementation.
  • Began a staggered upgrade to phpBB for a well-trafficked board. Started with upgrading a test board. I upgraded the board from phpBB 3.2.7 to phpBB 3.3.3. I removed the Simplicity style. It was not needed as the custom style inherits from prosilver. I changed the spambot countermeasure to reCaptcha to V3. I upgraded Digests, Google Analytics, PM Search, Tapatalk, Thanks for the Posts and User Details extensions. I had to remove an unused module from User Control Panel for the PM Search extension. Users are testing the test board. I expect to upgrade the production board in April.
  • Upgraded a phpBB board from version 3.0.12 to version 3.2.11 on Network Solutions hosting. No PHP greater than 7.0 was available on Network Solutions. which meant I couldn’t install version 3.3 of phpBB at all! (As an aside, Network Solutions in general is a very poor web host, with slow page loads and system related issues frequently occurring. Avoid hosting with them.) I installed the we_universal style and then created a custom style based on that to use for their unique changes. I disabled the contact page, and added reCaptcha V2 checkbox spambot countermeasure. I installed the Tapatalk and Reimg Image Resizer extensions. I tried to install Recent Topics, but got HTTP 500 going to index, likely due to Network Solution’s poor hosting. I disabling it and made it go away. phpBB’s caching seemed problematic. Some files did not have expected permissions. Changed 777 permissions to 02777 permissions to match that used elsewhere hoping it would do the trick. The client really needs to rehost somewhere else and is working on it because the board feels fragile, runs slowly and can bring up what seems like random HTTP errors. I had a limited ability to trace PHP issues as no log files are available to look at. Later, I tweaked the mobile style to fix some minor issues.
  • Updated a phpBB board from phpBB 3.3.1 to phpBB 3.3.3. I reapplied a donate button to style. I updated my filter by country extension and the Google analytics extensions. I also installed my Digests extension, successfully did a manual test and a cron test mailer test. I set up cron to run every 15 minutes to handle digests and notifications using a system cron.
  • A client’s login issue returned. The cookie domain was incorrect again and /cache/production folder had 755 permissions. Fixed these again and purged the cache. Hope this solves the problem.
  • My work for a major client continued. We’ve been stuck for a couple of months trying to affect an OAuth authorization solution. We’ve been using a Spotify extension I found as a template to try to create our own OAuth service. The company has their own proprietary client management solution that works with OAuth on phpBB 3.0. The client wants to use phpBB 3.3’s extension architecture to do this without using any hacks. It is quite a challenge! This month though working with their developer we were able to login successfully and transparently using their OAuth service in a test environment. More work is needed though because it must create phpBB board accounts behind the scenes for new users. Also did some minor changes to the styling, as it has evolved over the last year.

Creating and implementing post count policies for users and groups in phpBB

phpBB has lots of features and some are very obscure. I ran into one of these recently for a client. Apparently, it’s possible for users and groups to not have their posts count in their total post count.

Obviously this is not an issue for most boards, and it’s hard to figure out a use case for why you would want to do this. One case is to avoid unearned ranks. phpBB has an optional ranking system which is typically based on the number of posts. Making lots of replies that aren’t really substantive can do this and it’s an issue on some boards. Presumably these boards are not well moderated, as moderators are usually tasked to find and remove these posts.

Whether a post is counted in a user’s total post count or not depends on whether the post_postcount column in the phpbb_posts table is 0 or 1. If it’s 1, it gets counted. If it’s 0, it doesn’t get counted.

For example, you could have a general chat forum and posts in these forums might not want to be counted in a user’s total posts because they are considered trite. Then you could have other forums where the meat of the board’s content is, and posts in these forums could count.

Changing the post count policy

By default, all posts count in a user’s total post count, so if you don’t want posts to count for certain groups or users, you will have to change phpBB’s settings.

This is controlled by a permission. Typically you set this group forum permission. ACP > Forums > Forum based permissions > Group forum permissions.

Next you pick the group, then the forums for the group where the permission will be changed. Next you select the Advanced permissions link and then click on the Post tab. Then set the Increment post counter setting to either Yes or No as desired for the group and the forum. Do this for all the forums whose permission you want to change for the group and save your changes. If you want to change this permission for other groups, repeat.

Increment post counter permission

If you want to remove this permission for a particular user or users only, you can avoid groups by selecting ACP > Forums > Forum based permissions > User forum permissions. In general though I think you’d want to avoid doing this on a user-by-user basis, and do this only for groups.

Changing post counts for old posts

While this works for future posts, it doesn’t affect existing posts. How do you fix these old bogus post counts? As best I can tell there is no extension to help you out. So you have to get down and dirty with your database, using a tool like phpMyAdmin.

Before attempting anything like this, disable your board and back up your database, or at least backup the posts table. This can be done in the ACP on the Maintenance tab.

Generally you need a list of forum_ids and group_ids. A tool like phpMyAdmin makes it simple to look inside your database. Your web host control panel will usually have a tool that runs phpMyAdmin. Make sure you select the database for your board. Your board’s config.php file will provide the database name, if there is any ambiguity.

Database tools like phpMyAdmin are very powerful. It is possible to make large, irreversible changes to the database if you type commands incorrectly.

A forum_id is a number assigned to a forum in the database. You can see a list of forum_ids with this query, which can be executed on the SQL tab for your database in phpMyAdmin. (Change phpbb_ if your table prefix is different):

SELECT forum_id, forum_name FROM phpbb_forums;

Getting forum_id for forums in phpMyAdmin

Next, you need a similar query to get the group_ids for your groups:

SELECT group_id, group_name FROM phpbb_groups;

Getting group_id for groups in phpMyAdmin

With these group_id and forum_id values, you can then write a query to change the post_postcount value in the phpbb_posts table for a particular group and forum. Using the example above, if you wanted to change this flag to 0 (don’t count) for all members in the Registered users group (group_id = 2) to the forum “Your first forum” forum (forum_id = 2), the SQL would be:

UPDATE phpbb_posts p, phpbb_groups g, phpbb_forums f, phpbb_user_group ug
SET post_postcount = 0
WHERE p.forum_id = f.forum_id AND
p.poster_id = ug.user_id AND ug.group_id = 2 AND f.forum_id = 2

If you wanted to set post_postcount to 0 (zero) for all posts made in a forum, the SQL is somewhat simpler. In the case of forum_id = 2 the SQL would be:

UPDATE phpbb_posts p, phpbb_forums f
SET post_postcount = 0
WHERE p.forum_id = f.forum_id AND f.forum_id = 2

Recalculating the post counts

There is one last step: you need to recalculate these statistics:

ACP > General > Resynchronise post counts

Clean up

If you messed up, restore the table you backed up.

Also, if you disabled your board, reenable it.

February 2021 work summary

February was a busy month. Here’s a summary of my activity last month for various clients:

  • Updated a board from phpBB from version 3.3.2 to 3.3.3. No extensions needed updating. No new Italian language pack needed to be installed either.
  • Upgraded a board from phpBB 3.0.12 to 3.3.3. Installed and configured Tapatalk and Cleantalk extensions, tested Tapatalk. Installed Absolution style, but created a custom style based on it. Placed ad at top, reused logo image and added a number of custom items to the navigation menu. Changed text in the footer to show in black otherwise it couldn’t be seen. Added some FontAwesome icons for use on the navigation bar. Later, I fixed a navigation bar issue, as menu items only showed when logged in.
  • Fixed a variety of invalid HTML issues by fixing templates. Then I fixed an issue brought up by the Google Search console on the breadcrumb list with a value for ID being required, testing on a Google tool site. Later in the month, I updated a different board from phpBB 3.3.1 to 3.3.3. In this job, I updated the AllanStyle-SUBSILVER style and made changes to the custom style to fix the same Google breadcrumb issue. I updated the Google Analytics extension to version 1.0.6 so G key could be entered, and my Digests extension from version 3.3.2 to 3.3.4.
  • Originally I planned to convert a client’s phpBB 2 board, but he bought the book and did it himself. He was kind enough to send a donation, however.
  • Upgraded board from phpBB 3.0.12 to 3.3.3. I installed the Elegance Green style, then created custom style to inherit from it to which I applied style tweaks. I tried to make the style look similar, mostly in colors, to the old board. Read/unread icons have a red image (in part) that I couldn’t fix because I couldn’t get Artodia’s colorizer to upload a 3.3.0 archive and fix that. I fixed colors where possible. I set a new logo provided by client, placed on left instead of center. I enabled reCAPTCHA V3 and disabled the contact form. Changed PHP to 7.4. No issues during upgrade. Pushed margins most of the way across page similar to the old look.
  • Updated board with a prosilver style from phpBB 3.3.0 to 3.3.3. Then I updated Cleantalk from 5.7.2 to 5.7.3 and Tapatalk from 2.1.7 to 2.1.8. I change captcha from reCaptcha V2 to V3. I added back code to show the logo to stylesheet.css.
  • Updated a board from phpBB 3.3.1 to 3.3.3. Updated the Multi-design style from version 1.0.5 to 1.1.5, which is built for phpBB 3.3. I added one line in stylesheet.css for the style to hide the logo, like before. I also uploaded ads.txt to web root as requested to support Google Adsense and upgraded the PiWigo gallery software and PiWigo extension by simply clicking on two links.
  • Installed Magic OGP links: thumbnails and descriptions extension to a board. I added permissions for registered users to allow them to thank posters on forums where they were missing.
  • Upgrade a board from phpBB 3.0.4 to 3.3.3. Since reverting to PHP 5 was not an option, I had to make changes to database manually, fixing issues with styles and templates tables. There was one phpbb_config table row problem that occurred running the upgrade program. I spent a lot of time getting the styling to reflect the red wine color. I also installed the pages extension and converted two static pages to it, moving code to BBCode. I configured reCAPTCHA V3 and disabled the contact form.
  • Errors came up on a board, likely due to Hostgator changing PHP default to 7.4. His style does not appear to be available for phpBB 3.3 so I updated him from phpBB 3.2.1 to 3.2.11. I tried to change PHP to 7.2 but it doesn’t stick, at least ACP shows 7.0 is being used. I had to upgrade the Media Embed extension to get it to come up. If PHP and style issue can be resolved, I will credit this toward an upgrade to phpBB 3.3.
  • Installed phpBB on a forums subdomain on Siteground hosting. Installed phpBB 3.3.3 and the proflat style. Inherited proflat style to create a custom style. Installed reCaptcha V3 and disabled the contact form. Tested email, set it up similar to how I have it set up on my Siteground hosting. I set up a couple of dozen forums inside a number of categories per outline provided. I spent a long time getting the styling right. Incorporated provided logo. Also, sold client a PDF of my book.
  • Changed changed to a different class of GoDaddy hosting and there installed phpBB with the hosts’s auto installer. But what he really wanted to do was move the old board, which was also at an earlier version of phpBB. So I cad to load database, upload the install folder and upgrade the phpBB instance from phpBB 3.2.0 to 3.3.3. I also installed the newest version of American English language pack. I applied logo changes to stylesheet.css and uploaded logo again.
  • My client had used up his file and database quota, causing errors. I tried clearing Trash in file manager but that didn’t work. I suggested working with web host directly, which did work when they upped his quotas.
  • Upgraded a board from phpBB 3.2.0 to 3.3.3. I used the standard prosilver style with custom logo. Bluehost hosting was flaky — could not change the PHP version or access file manager. It took a while to get access to figure out what was needed. Used FTP to do all the upgrade work. I changed reCaptcha from V2 checkbox to V3. I reapplied the logo but suppressed site title and description. Installed Contact Admin extension.
  • In my long term work for a client moving from phpBB 3.0 to 3.3, I finally made some progress on getting a custom OAuth authentication to work. Mainly, I discovered an extension that did something similar and tried to tailor that. The handshake with the OAuth server is not quite there yet, but it’s getting close. Also made some styling changes to reflect changes to the company’s styling made since this effort began nearly a year ago.
  • I upgraded a board from phpBB 3.2.8 to 3.3.3. There was an error after the upgrade clicking on the ACP General tab. Due to a bug in phpBB, phpBB failed to get size of database, due to a hyphen in the database name. This is a known bug so I applied the patch. It should show up as a fix in phpBB 3.3.4. I upgraded the Milk style and its extension. I updated the external links in new windows extension. I asked the client to check if avatar resize and post image upload extensions were still working correctly, as no upgrade was available for either extension. Both still work correctly.

January 2021 work summary

In January, I finally got around to releasing the first draft of my Spam remover extension. This extension finds spam in posts and private messages including very old spam that may be present on your board. It took longer than expected because work for clients comes first (as it pays money) but also because it turned out to be more time intensive than expected. The extension uses Akismet (mostly used to moderate WordPress comments) to make a spam determination and using the service is not necessarily free and requires a license. The most technically challenging part was the finding spam part, as some databases are huge. Based on my testing, you can’t expect Akismet to test more than about four posts per second, which means on larger boards finding all spam may take hours or days. Of course you can narrow the range to a date range. phpBB doesn’t have any great ways to handle long running tasks.

Otherwise, it was somewhat quiet doing work in January. Paid work included these jobs:

  • I was asked to upgrade WikiMedia software on a site where the client also had a phpBB board. To make a long story short, I ultimately did not succeed. WikiMedia is not an area of expertise, the software installed was very old and even following the instructions carefully wasn’t enough. So I billed for a few hours of my time and provided a link to some Wikimedia consultants who should be able to finish my work.
  • This was a strange job because the upgrade and rehosting that had to be done collaboratively in Teamviewer. In short, I was being watched and someone else was controlling the session. I worked collaboratively with a system administrator. The first attempt to upgrade the board from phpBB 3.1.11 to 3.3.2 failed for various reasons. Lots of issues were reported so eventually the decision was to move to phpBB 3.2.11 the following day, on the assumption that there was some instability issue with phpBB 3.3 and the hosting used. This went well and was faster than the first attempt. In this attempt, rather than make a custom style, changes were made to the Absolution style directly. Three extensions were added and some medium work CSS changes were made to add the old logo back, make it more black and adjust the margins. There were issues with emailing and on the first attempt bad form tokens on certain mobile devices that had to be resolved.
  • Upgraded a board from phpBB 3.2.8 to 3.3.2. Fixed an email sending issue by changing port to use for sending email to port 465. Upgraded Absolution style and reapplied logo. Installed updated American English language pack. Updated Digests, Pages and Board Announcement extensions to latest versions. Tweaked the cron job created for digests to add app.php in the URL. I had to add two missing columns to a table used by the pages extension to fix errors that occurred. Changed reCaptcha to Version 3.
  • Upgraded a board from phpBB 3.0.11 to 3.3.2. Installed SE Gamer Light style with a newer logo supplied by the client. Extensions installed: Tapatalk, Who Was Here, Recent Topics, National Flags, Thanks for the Posts, Collapsible Forum Categories, Add User and Advertisement Management. There was an issue with navigation bar overwriting part of logo text in the header background image. Could not connect with Tapatalk via the app. Not sure national flag settings were retained for each user. Thanks for the Posts extension zeroed out thanks totals as there is no migration process from the mod to the extension. But I was able to bring in all the old ads correctly from the old advertisement management extension. Renamed gb.png to uk.png because that flag was missing.
  • An issue a client had was similar to one that happened in November when I helped him. Basically, digests stopped going out. Again, the fix was bad PHP syntax was written to the /cache/production/queue.php file. The only real fix was to delete the file again and hope it did not recur again. Thought it might be due to running out of quota on the server, but the client’s web host said this was not the issue Also manually removed the cron lock and reset digests.
  • Updated a limit groups extension I wrote a couple of months earlier for a client. The error message now returns a relative number of hours, minutes and seconds until the user can make more posts or view more topics. Commented out old code in case it is wanted again.
  • Upgraded a board from phpBB 3.2.8 to phpBB 3.3.2. Updated the ne_blackgreen style, Cleantalk and NavBar Search extensions. Removed some buttons from the footer that were no longer wanted.
  • Troubleshooting ads mostly served by the advertisement management extension that should not show up for users in a new group that was created. Advertisment management extension looked set up properly to exclude this group. Two ads were served outside of the extension because the extension couldn’t place them where desired by the client. Changed the two locations in forumlist_body.html and overall_footer.html to add this new group_id = 34, which should not see the ad. Client reports it is still not working right. Unclear which ads are having this problem and if the issue is in the custom code I wrote, the advertisement management extension, or both. Suggested debugging in test environment.
  • Upgraded a board from phpBB 3.2.0 to phpBB 3.3.2. Changed PHP from version 7.0 to 7.4. Supplied new logo but it didn’t quite fit, so I reapplied the old logo. Eventually replaced the logo with a cropped version of the new logo provided that would fit the header space. Standard prosilver style with no extensions. No issues during upgrade.
  • Updated a commercial board from phpBB 3.3.1 to phpBB 3.3.3, which was just released on January 29. Updated digests extension from 3.3.2 to 3.3.4 and Google Analytics extension form 1.0.4 to 1.0.6. Updated base AllanStyle SUBSILVER style from 3.0.1 to 3.0.2. I was asked by the client if another forum could be merged with current forum – not currently possible. Changed a setting that capped uploads at 50MB to 100MB so more uploads could be made. Client may want me to create an extension to send top posts/topics to users on a regular basis.