New extension under development: Filter by country

As my paid work has remained slow in May, I’m working on yet another extension. This extension filters traffic by country code. An administrator can either allow traffic only from selected countries, or not allow traffic from selected countries. Some forums attract a lot of spam, often times robots from countries like Ukraine, Russia or Belarus. This extension may be part of this solution. Other forums really don’t want traffic from outside the country because their focus is strictly national, or applies only to a set of given countries. This extension will prohibit the rest.

The extension uses the free MaxMind GeoLite2 country database, which is downloaded upon first use of the extension. The database examines the IP address of the user and determines the country of origin. The database is updated weekly by MaxMind and is automatically refreshed using a phpBB cron job.

There are other ways to block traffic by country. For example, CloudFlare has a paid service that can do this. This has the advantage of keeping this traffic from ever hitting your site, which reduces server resources used. This extension will show a blocked message, but will present standard forum headers and footers. However, clicking on any link will simply bring up the same message. The extension though has some unique and special features that make it more useful than a basic IP block:

  • A setting allows registered users in blocked countries to login. This basically enables the login link. If they can provide a valid username and password, they can login. However, this does not allow registration.
  • In the event an IP address does not match to a country, a setting can allow or deny access. New IPs are added from time to time, so this accommodates this possibility. It may also help accommodate VPNs. See the discussion below.
  • You can log all blocked page requests. The log entry will identify the user (which could be “Anonymous” for guest), the IP used and the country. One downside is that this could make for some very large log tables.
  • You can keep statistics on the number of allowed and blocked page requests by country and see the details in a report. This too can result in some large tables.

Here are the two screen interfaces developed so far in version 1.0.0-dev.

Since a lot of people use virtual private networks (VPNs) today, it’s unclear how well this solution will address these. If the address of a VPN is not in this database, it can be allowed using the setting described above. MaxMind sells a separate database of anonymous IPs used by VPNs. I may integrate an interface to check this database too, but it will depend on users buying a subscription from MaxMind for this database. In general, the phpBB Group frowns on ties to commercial paid products.

Since this is in development, it’s a long way from being approved. You should not use it on a production forum.

It’s been tested, but it’s the kind of extension where it really needs to be tested on a site with a fair amount of traffic. You can participate in the discussion on my topic here. It can be downloaded here or you can grab it from my GitHub archive.


Why aren’t my private messages getting read?

phpBB is excellent forum software, but there are aspects of the way phpBB works that are not intuitive. One of these how it handles private messages, including private message notifications and how it stores and labels private messages.

Sending a private message

In phpBB, you can send a private message to a user from a convenient link on the navigation bar. In this example, the user “tester” is sending me a private message:

Once the submit button is pressed and the screen refreshes, and the just sent private message appears in the user’s outbox:

Receiving a private message

Now let’s look at it from the perspective of the email recipient. Here I login to my board. Notice the private message notification on the navigation bar, which appears unless this notification is turned off:

If I click on the private messages link, I can see the new and unread private message with the red unread private message icon next to it, to distinguish the private message as new:

I can click on it to view the message:

The act of viewing the private message marks it as read. From the sender’s side, this takes it out of their outbox. Now logged in as “tester”, see the difference:

How phpBB handles private messages

All this demonstrates the non-intuitive way that phpBB handles messaging. All private messages are stored in the database. But a “sent” private message is not considered “sent” until it is read by the recipient. Until then, it hangs around in your outbox because, I guess, phpBB does not assume it was actually delivered.

You are probably saying to yourself: “But this makes no sense.” And most people would agree with you. But that’s not how phpBB was designed. When you “send” the private message, a notification may be generated to the recipient. The notification can be an email notification, or just a notification that appears on the navigation bar when the recipient logs in, or both! But phpBB won’t consider it “sent” until it is read — it’s just an item in your outbox! To count it as read, the recipient must login to the forum and read it in the private message interface.

How notifications changed with phpBB 3.1

To make this all the more confusing, the phpBB group changed the way the notifications system works with phpBB 3.1. Previously, the default was to get email notifications when private messages were “sent” to you. Since phpBB 3.1, the default is now not to send an email notification. Instead, when you login in you will see private message notifications on the navigation bar.

If a user wants to get email new private message notifications, they have to reenable this feature. Doing so is not intuitive: User control panel > Board preferences > Edit notification options. See this screenshot for the checkbox that needs to be enabled:

So if this bothers you, you have to let your users know. Perhaps post a global announcement on the forum, or send a mass email to all users telling them how to change this setting. If you got hundreds or thousands of users, you may want to pay me to change this in your database for everyone. If so, send me a service inquiry.

This is just one of these quirks. All software has them, and this is one of those phpBB features that makes a lot of sense to the designers of phpBB, but little sense to the rest of us.


New extension under development: selective mass emails

So far I’ve developed two extensions, Smartfeed and Digests. Another one is now under development, Selective mass emails. You can read about it on the topic here which includes a download link.

I wrote Smartfeed and Digests as mods for phpBB 3.0. Digests even has a version for phpBB 2.0. So I pretty much had to turn them into extensions when phpBB 3.1 was introduced. Unfortunately, both are rather complex extensions, so to the extent I had time to work on them, it was a long and complex learning curve. It took about three years to turn digests into an approved extension.

Selective mass emails extends phpBB’s mass email function. Mass emailing is an administrator privilege only. It’s available in the Administration Control Panel: ACP > System > Mass email. The built-in function is pretty basic. It allows administrators to send mass emails to exactly one group or to a list of individual users whose names you have to type in. Only text emails are sent.

I was asked to consider developing this as a paid extension. After looking at the work involved, which was not much (and given that my schedule is not busy at the moment) I decided to develop it for free.

So it’s a simple extension. Moreover, now that I have a couple extensions under my belt, creating a relatively simple extension that is not too complex is pretty straightforward. Now I know what I am doing. So I’m becoming more willing to develop custom extensions since I find them less intimidating. If you have one you want me to consider developing, you can send me a service inquiry and we can discuss my comfort level and a cost range.

The extension will evolve but you can see version 1.0.1 in development mode:

Selective mass emails (version 1.0.1)
Selective mass emails (version 1.0.1)

Basically, the extension refines the mass emails allowed to be sent. By using core and template events built into the phpBB code base, I was able to add fields to the form. The number and placement of these events is also something of a limitation. For example, mass email allows you to send all emails to one group, and only one group. I can’t change that because I can’t tie it to one of the available events.

The extension can be used to do things like send reminder emails to people who haven’t posted in a while, for example. You can also use it to send emails to inactive users, users who have posted more (or less) than a specified number of posts, or have more or less than a specified number of private messages. If you use ranks, it will also allow you to send emails to people with the ranks specified.

As this is a development extension, it should not be used on a real board. At some point I will create a GitHub archive for the extension. You might want to take it for a spin, but on a test forum only for now.


Breaking the GoDaddy domain registrar habit

I have never used GoDaddy hosting. This is in part because I have worked with so many clients who did use GoDaddy hosting, and it left a bad taste in my mouth.

The good news was that over the years GoDaddy’s hosting and support have improved from abysmal to acceptable. Their hosting now rates a solid C, which is not bad in the hosting business, and their support a solid B. You don’t usually have to wait long on hold when you need their tech support, and their support tends to be good.

I do use GoDaddy as my domain registrar, however. I do this because over the years I learned painfully that to divorce from a bad web host, it helps to keep your domain registrar separate from your web host. Move your files and databases to the new host, point your nameservers for your domains to the new web host and you have the equivalent of a Las Vegas divorce. It’s all done quickly and neatly.

It turns out though that GoDaddy’s domain services are pricey and annoying. If you’ve used GoDaddy, you no doubt learned they will try to upsell everything, and that includes domain management. While that is annoying, when I looked into it I discovered that they really charge quite a lot for their domain registry services. In fact, they are one of the most pricey registrars out there.

So I used the excuse of their latest bill for renewing a domain as an excuse to find a cheaper and less annoying registrar and move my business there. I’ve only got five domains but it looks like I should save at 33%-50% by moving to my new registrar, Not only are their charges for domains significantly less than GoDaddy’s, but they throw in some very valuable extras.

For example, charges $8.99 a year for a .com domain, while GoDaddy charges $15.17. That’s a savings 33%, but the savings are comparable for other popular top-level domains.

I have a blog that I would just as soon not associate with me personally, in part because opinions expressed there might affect this business. The business me is strictly agnostic. I take on pretty much all clients as long as they will pay my rates and I don’t find their content personally offensive. I have worked on some adult sites if their content was clearly legal. This business is less than five percent of my total business.

For my blog, I would like to disassociate its domain from me personally. In case you don’t know, when you have a domain you have to fill in various contact information where you are supposed to enter your actual name and address. On GoDaddy, I paid $9.99/year for privacy protection so this information was not shown publicly. It comes at no charge though on also offers free domain protection. This means someone can’t steal my domain. GoDaddy charges $5.00/year per domain for this service.

It takes about a week to transfer most domains. Transferring my domains also meant a bit of hassle: I had to unlock my domains, get transfer authorization codes for each domain and enter them into various web forms on the site. But it’s all straightforward, while generating a lot of emails from both registrars. works like most registrars: to transfer the domain you are essentially buying another year for the domain.

There’s no point in paying a lot of money to GoDaddy for domain services anymore. Nor do you have deal with GoDaddy’s constant and annoying upselling features. The support on was good when I tried it. It took only a few minutes to get them on their online chat system and they answered my question promptly.


April 2019 work summary

April was a slow month. Not sure why, but I think April 2018 was the same way. Maybe people were focusing on their taxes. When things slow down though, it can be good. In my case, it meant getting out a new version of my Smartfeed extension and two new versions of my Digests extension. Anyhow, here’s a summary of my work in April:

  • This work was for a client with a very large forum and active community of women. The forum was phpBB 3.0.12 and an upgrade to phpBB 3.2.5 was desired. I did this in stages.
    • Back in January, I did a development upgrade as a proof of concept. Here’s a summary of that effort. First, I upgraded the client’s development forum. As is often the case, I had to manually create the phpbb_config_text table first before the upgrade would start. I tailored the chosen style to match current style in phpBB 3.0.12. I installed Tapatalk, Thanks for the posts, Digests, ACP Add User and Google Analytics extensions  I disabled the contact page and enabled the reCaptcha V2 spambot countermeasure. I added a home link. I did not set up digests cron as it would interfere with the digests going out on the production forum, but the digest subscribers carried over correctly. I noted that the Tapatalk extension may not work correctly until moved to production. There was no ForumRunner extension available. I asked about installing PM Search extension (RC) extension. I noted that the Thanks for the posts extension may need permissions set up. A few days later, I installed PM Search extension, a release candidate.
    • Finally in April I did the production forum upgrade. This was more complicated than usual because the new forum was going to be on a newer and faster machine, which meant the old forum was put in read only mode until it was complete, and a copy of the database and files were first staged on the new machine. I also had to use SSH to do all the work. The first conversion failed due to various data consistency issues. Eventually I installed phpBB’s Support Toolkit for phpBB 3.0 that removed some inconsistencies in the database. I also loaded a vanilla phpbb_styles and phpbb_modules table from a phpBB 3.0.14 database to get past these issues. Then upgrade worked, after again creating the phpbb_config_text table. Afterward, it was pretty straightforward. I enabled styles, enabled extensions, and completed the digests cron setup and testing. I fixed an issue with popups not going away when marking all forums read. A few days later, an issue with the style I created was noted. Mark forums read would not work, nor would mark all/unmark all. The problem was two instances of including jQuery, both in the header and footer templates. I removed it from header, and added to footer to match how it was done in the prosilver style. A few days later, I fixed an issue with incorrectly formatted birthdates where the user_birthday field was DD-MM-YYYY instead of MM-DD-YYYY. I created and ran some SQL to fix the issue. Some dates have blank years. Later, tried again to install a version of Thanks for the Posts extension that works with Tapatalk, but which uses a different mobiquo folder. I had to enable both the original and new thanks extension, then disable the original one, to avoid seeing two thanks icons. When testing with the Tapatalk app, I saw a thanks button at the bottom of the post.
  • Painful update from phpBB 3.2.1 to phpBB 3.2.5. Lots of annoying hosting issues getting into cPanel, using the file manager, getting FTP to work reliably, etc. Also upgraded the Advertisment management and Cleantalk extensions. I reapplied the logo and cleaned up some custom code in the header and footer. Client’s hosting is subprime, slow and problematic to use.
  • Upgraded a tiny forum (just 55 posts) from phpBB 3.0.10 to 3.2.5. I changed PHP from 5.4 to 7.1. Hostgator hosting. So easy and simple!
  • In early April, a client had a strange database issue where a lot of the forum’s tables mysterious were dropped. So when trying to bring up the forum, an error occurred. The last good backup was from October 2018, so the database and files were recovered to that point. There were a number of emails with the client trying to figure out an earlier issue, the latest was that one spam post was in a digest. The recovered database was phpBB 3.2.1, so I upgraded it to 3.2.5 (second time!) and reapplied the logo. I then updated Stop Forum Spam, Digests and Cleantalk to the latest versions. Cleantalk was not enabled, but Stop Forum Spam was. Enabled both but probably both aren’t needed. To work, Cleantalk needs to be able to query its remote database, so allow_url_fopen had to work, so I tested it. PHP is up to date with 7.2. Previous cron job is still working and digests are going out. As for the spam in the digests, these were because of some spam posts. It probably occurred because Cleantalk was not enabled and the Stop Forum Spam database did not know this poster was a spammer. I manually deleted the spammer’s account and their posts. With Cleantalk now enabled and phpBB and all extensions up to date, it should not recur.
  • More work for a client I upgraded in March. Some members of the forum like to stream music on the site using an integrated Shoutcast server. The controls were integrated into the forum’s header on phpBB 3.0. He wanted to get this feature working again. It worked on phpBB 3.0 as a mod, but there was no approved extension with similar capability for phpBB 3.2. There was a development and abandoned radio extension that I tried. Testing involved setting up an account on a Shoutcast server hosting site and it seemed to work, but controls like showing the current playlist did not work with the extension. After the proof of concept showed that the songs could at least be streamed, the client got a formal contract for a Shoutcast server and asked me to integrate the new server so songs could be played and enjoyed by all. The old player used Flash technology. Since Flash is dying, buggy and a security risk I didn’t want them to use Flash anymore. I eventually found a low tech solution: use the <audio> HTML tag which renders a simple player on all browsers, but without any fancy styling. This worked quite well as a standalone solution, which I integrated into the overall_header.html template for the style. As for the radio extension, we eventually decided it was too buggy to use so it was disabled. In addition, they use the mChat extension so members can talk about what’s playing in real time. I showed the client how to use phpBB’s permissions to limit who can see the chat window, since many users didn’t like it. I suggested setting up a group for those who wanted to stream music and giving them permission to use the mChat window.