Blog

October 2016 work summary

October was a very slow month as far as requests for service, my slowest month this year. When not servicing customers I was working on version 3.0.7 of the digests extension. In addition I am doing some teaching for the Tech Foundry in Springfield, Massachusetts (three classes) and hosted a local WordPress meetup. Among my paid work in October:

  • I continued work for a client started in September. Provided advice on handling resource issues and general WordPress advice on potentially placing a photo of the day on a sidebar.
  • I upgraded a forum from phpBB 3.0.11 to 3.1.9 using the subsilver-based but responsive AllenStyle-subsilver style, so it would look familiar after the upgrade. I made tweaks to make it imitate the green in background containers used in the client’s larger website. Tweaked the link color to make it a dark green and changed Global Moderator color to black (had to make it the default group for these moderators).
  • I upgraded a prosilver-based forum from phpBB 3.0.11 to 3.1.9. There were lots of mods installed but all were removed with the upgrade. I installed the beta advertising management extension and the Advanced BBCode 3 extension after the upgrade. I manually removed lots of dead modules for 3.0 modifications.
  • I upgraded a forum from phpBB 2.0.23 to 3.0.14. I tried to upgrade directly to phpBB 3.1 because the host switched on PHP 5.4 which would support phpBB 3.1. After trying though I discovered that the host did not actually support PHP 5.4, which meant the host was unusually sloppy and poorly managed. They had to roll PHP back to 5.3.29, which meant phpBB 3.1 could not be installed, which led to the decision to use 3.0.14 instead. I redid the conversion and it worked. I installed new logo. Old forum is disabled and in an old_forum folder. Later I installed the location on registration mod. The upgrade soon drew spam registrations because of the default CAPTCHA. I then set up the Q&A countermeasure and deleted the hundred or so spam registrations.
  • A client upgrade attempted about a year ago did not complete successfully. Client wanted to complete the upgrade so the forum could be used again. I analyzed his site. His upgrade attempt did not affect the database. By comparing his database with a reference, I determined phpBB 3.0.12 was really installed and manually changed the version back to 3.0.12 in the database. I then attempted to do the upgrade again. However, the installed Black Pearl style would not port to 3.1. Client approved using the Black style instead, which works on 3.1 and looks similar. I then upgraded the forum successfully, but I had to refresh each page to continue the migration as the button at the bottom of the page was unresponsive. Upon completion there was an incorrect version reported, said 3.1.9, not 3.1.10. I verified 3.1.10 was actually installed by looking at the contents of the migrations table. When I purged cache the correct version was reported. I then installed two extensions: to move the search bar to the navigation bar and to compile .sccs files (needed for the Black style). I made lots of tweaks to the Black style to emulate the old look and feel with the new Black style.
  • I upgraded a forum from 3.1.9 to 3.1.10.
  • I investigated a concern from a client on why search engines weren’t seeing his content. The bots role did not enable searching but that may not matter as the read permission attached to the bots role should be what matters. Client changed the permissions on some forums that needed bot access.
  • I replaced an ad managed by the Advertising Management mod.

Setting up your forum, part two (installing styles)

Note: post updated August 26, 2019 to bring it up to date.

(Click here for part one.)

Once your forum is setup for basic public access, you generally want to change its look. If you like the default prosilver style, and many admins do, then perhaps the only thing you might want to do is add a logo.

Selecting a new style

If you want to use a different style, there are many sources:

  • Official styles are styles that are submitted to the phpBB group and are made publicly available for download on phpbb.com after a review team asserts that the style meets the group’s design standards. The easiest way to tour styles is to use the styles demo for phpBB 3.2. If you find one you like click on the download link. These styles are free.
  • There are other sites that provide phpBB styles that may cost money. Some of these include artodia.com, awesomestyles.com, rockettheme.com and themeforest.net. Since many of these styles have not been approved by the phpBB group (because paid styles cannot be downloaded from phpbb.com), it’s possible but unlikely that they won’t meet their criteria.
  • If you are trying hard to match colors used by your website, check out colorizeit.com. The site offers a way to colorize some of the more popular phpBB styles.

One factor to consider is whether the style is “Sassy” or not. All phpBB 3.1 and 3.2 styles should be responsive, i.e. they should intelligently “size down” for mobile devices. A “Sassy” style is one that uses .sccs files. These must be edited and then the style must be “compiled” to change what is displayed. Often you will get a user interface for making changes to Sassy styles, such as changing the colors. Otherwise, changes you make will need to be compiled. For the novice, the process of editing and publishing these files can be intimidating. I discuss this more in this post. If you download a style and it contains .sccs files in the style’s theme folder, it’s a Sassy style.

Installing a new style

The phpBB group has full instructions for installing a style. It’s straightforward. If you are going to be customizing the style, you may want to customize it to reduce the hassle when you apply updates to the style.

Adding a logo

Typically you will want to add your own logo. You will of course need a logo, and it should be in a .jpg, .gif or .png format, and probably fairly small in size too. You will need to know the image’s width and height. Clicking on the properties of the file may tell you this information. If you have a Mac, use the “Get Info” button of the Finder after you select the file. Images should be uploaded to your style’s theme/images folder.

You will generally have to edit at least one file to place the image, usually colours.css and common.css. Search for the “.site_logo” class. For width and height, use the width and height of the image. You can specify a different size if you want the browser to stretch or shrink the image. If you want to make the image proportionately smaller, you will have to figure out the dimensions you want. There are websites that allow you to resize images. A simple search will pull these up for you. Usually you make changes to the background-image property and width and height properties. Save the files back to your style’s /theme/images folder.

Generally refreshing the page will show the style changes. You may have to hold down the SHIFT key when you refresh the page. Sometimes you may have to purge your browser’s cache. If you still don’t see the changed, check your web host control panel.

There may be some software running like Supercacher or CloudFlare that is actually serving these files. You may need to flush this cache so it is refreshed.

This topic may be of interest.

Suppressing the forum name and forum description

The default prosilver style shows both a logo and the forum name and forum description as text. Some styles show just the image. Some don’t show the image at all and only the forum name and forum description. Since many logos have the name of the forum or site already on the logo, showing both can be redundant and look unappealing. Approaches to fixing this vary:

  • “Sassy” styles generally have a switch that turns the display of the logo and/or the forum name and forum description on and off. Look in the style’s theme folder for a file with “config” in the name an a .scss extension. You can probably find a switch in there. The .sccs files though must be “compiled”. There is an extension you can install to make this easy.
  • Some styles require editing the overall_header.html file in the theme’s template folder. You will have to either delete or comment out the HTML that shows this information. To show a logo, you might have to uncomment or add the HTML that will display the logo.

Template changes require purging the cache in the ACP to be seen. You may also have to delete your browser’s cache and reload the page to see the changes.

Tweaking the style

Making further customizations is not for the timid and requires a moderate understanding of both CSS and phpBB’s templating system. If you have both, go ahead. Again, this post may be useful.

Making the new style the default

As an admin, you can permit as many styles as you want on the forum and users can select their style preference in the User Control Panel. As a practical matter, it is easier and less confusing for everyone to use the same style. You can set this in ACP > General > Board configuration > Board settings. You can select a style to be the default style in ACP > Customise > Style management > Styles. Click on the details link for the style you want to make the default and select the appropriate controls.

Digests extension and phpBB 3.1.10

It appears that there are some bugs or features in phpBB 3.1.10 that affect the digest extension:

  • If you install versions of the digest extension prior to the latest 3.0.6, phpBB will complain because there is no exp.php program in the extension. This was introduced in 3.0.6 and appears to be required in phpBB 3.1.10.
  • If after disabling the digests extension you also select the option to delete the extension’s data, the following error will appear: “Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors. A required module does not exist: ACP_CAT_DIGESTS”. In fact based on my testing all the data is deleted including modules, config table rows and columns added to the phpbb_users table. So the message is erroneous.

I think it’s likely that this is caused by bugs introduced in phpBB 3.1.10 to the migrator class. This may require the phpBB group to put out a patch to this version. Issues with the migrator are known so presumably these will be fixed.

I have not extensively tested Digests 3.0.6 with phpBB 3.1.10 but I have not encountered any other bugs so far, so if installed it should work correctly, just flag a bogus error when uninstalled.

Updated 10/26/16:

Setting up your forum, part one

(Note: this post was edited on August 26, 2019 to bring it up to date.)

Installing a phpBB forum is pretty straightforward, particularly if you use the option available from many web hosts and install it in the web host control panel scripting center. I won’t get into how to install phpBB in this post, assuming that you have done that already. If you haven’t installed phpBB, there is an official guide published by the phpBB group for setting up and administering a forum. However, it’s a lot to parse through.

Since I do a lot of these for a living, you might want to follow some of my steps after installation. ACP means select the link for the Administration Control Panel (ACP).

  1. Change the name of your forum. ACP > General > Board configuration > Board settings. “yourdomain.com” is obviously not very helpful to a visitor. This does not have to be a domain name, but something textual that briefly describes the purpose of your forum. Also change the default site description or leave it blank if it’s not useful.
  2. Review the board settings. ACP > General > Board configuration > Board settings. Make sure they are what you want, but you can defer installing styles until later if you don’t like the default prosilver style. The guest timezone is also the board’s timezone so make sure that is the way you like it. If your board is regional, you might want to set it to your local timezone. I discuss adding and changing styles here.
  3. Add language packs. If you need to support a language other than British English, follow these instructions. Generally you don’t want to support more than one language on your forum. If you do the expectation is that users are fluent in both languages and can post in either language.
  4. Change the name of the default category. ACP > Forums. A category is a collection of forums that have a similar theme or content. Manage forums is highlighted by default. Click on the green wheel next to ‘Your first category” and change the name of the category. You can have many forums inside a category but you cannot create posts under a category, only under forums inside the category.
  5. Change the name of the default forum. Again, ACP > Forums. Click on the link for your newly renamed category. Then click the green wheel next to “Your first forum” and change it to an appropriate forum name for your category.
  6. Edit or delete the default post. You can’t do this in the ACP, but on the forum index select the links for the category, topic and post and look for the edit icon. Edit the subject and content if you want or delete it altogether. Look for a little button with an X on it to delete the post.
  7. Add additional forums. Most likely you will want to add additional forums and may need to create more than one category. ACP > Forums. This part can be a little confusing but to start off it’s important when creating a forum to copy the forum permissions from the default forum. You can change these permissions later if needed. If you don’t do this, no one can access the forum until you explicitly add them later on. This can be very confusing if you are not familiar with phpBB. This video may be of help.
  8. Create and set an effective spambot countermeasure. The defaults is “Simple image” which has been thoroughly hacked. This means you could get spam registrations. You have two logical choices: the Question on Registration and (for phpBB 3.2 only) reCaptcha.
  9. ACP > General > Board configuration > Spambot Countermeasures
    1. For the Question on Registration:
      1. Under installed plugins, select “Q&A”
      2. Press the Add button and create one or more questions.
    2. For reCaptcha:
      1. Go to the reCaptcha site and generate a public and private key for your site. You must select a set of keys for ReCaptcha V2 Checkbox.
      2. Under installed plugins select “reCaptcha” (it is greyed out on first use) and press Configure
      3. Copy and paste the public and private reCaptcha keys from the reCaptcha site and press submit
    3. You will eventually find yourself back on the Spambot Countermeasures page. You must now enable your selection, so pick either Q&A or reCaptcha (depending on which one you setup) then press Submit. This will enable the spambot countermeasure.
  10. Review your server settings. ACP > General > Server configuration > Server settings. The main setting to check here is server protocol. If you use https to encrypt traffic, specifying it in the Server protocol field. Set up SMTP for email if you have Windows hosting or will send board emails through a SMTP server. Here’s why it may be a good idea to use SMTP.
    1. ACP > General > Client communications > Email settings
    2. Under SMTP settings select Yes for “Use SMTP server for email”
    3. Enter the SMTP information provided by your host or mail provider
    4. To test SMTP, ACP > System > General tasks > Mass email. Enter the username you created for admin when you set up the forum (it may be “admin”) and send yourself a test email. If it doesn’t work repeat these steps until it works correctly.
  11. ACP > General > Contact page. Disable the contact form. Since it has no Captcha, it will probably attract spam. There is a Contact Admin extension with Captcha you might want to install later.
  12. Create a link to your site’s home page. ACP > General > Board configuration > Board settings. If your forum is part of a larger site, you might want to fill in the URL field on this page for the home page of your site. It will add a Home link on the navigation bar.

This is enough to get your started with a useful, bare bones forum for public access.

Digests extension … more work ahead

It took about four months but I finally got a review by phpBB’s extension team of my Digest extension version 3.0.5. They are requesting some pretty extensive changes so I’ll be in coding mode for a while but it’s good to have a review. No one gets approved on the first time through so I’m hoping the second time is the charm.

There may be an issue when deinstalling digests. I am analyzing that and will post a correction when I figure out what the issue is. If you need to manually deinstall digests and it doesn’t work, use these instructions.

Digests 3.0.6 (RC5) now available

Digests version 3.0.6 is available for testing. It can be downloaded here or you can grab it from GitHub.

For details on installing and configuring digests, see the first post of the digests extension topic on phpbb.com.

You can see a complete list of changes compared with 3.0.5 here:

To highlight some of the major changes since the last release:

  • The code has been cleaned up with PhpStorm, removing a lot of unused variables, fixing a lot of inconsistencies and in some cases fixing errors that PhpStorm found. It’s an impressive IDE.
  • Edit subscribers search feature is now case insensitive.
  • Duplicate digests bug is hopefully fixed. For a given hour, digests will ensure that a user has not received a digest for the requested time period. For example, for daily digests at least 24 hours must have passed since the last digest was recorded to have been sent for it to go out.
  • Encoding of the FROM email name now matches how it is handled in /includes/functions_messenger.php
  • If a user has not chosen a timezone in the User Control Panel, the board timezone is used. This prevents a HTTP 500 error. This can happen when installing a new forum and using the admin account for testing.
  • html_messenger object is reset after each email is sent, which might also address duplicate digests going out for a given hour.
  • Added ext.php to the archive, which enforces rule to use phpBB 3.1.9 (but not phpBB 3.2)
  • Email templates now include the missing <html> tag for HTML digests, making them valid HTML 5.
  • Both the date and hour are shown in the admin log when a digest is sent (assuming this option is enabled). This aids troubleshooting if more than a day has elapsed since digests were sent out.
  • Migrator fixes issue with User Control Panel permissions if a user converted Digest 3.0 mod subscriptions using Digests 3.0.4 or earlier. The bug had limited seeing the Digest options in the UCP to admins only.

Thanks to testers for finding bugs both large and obscure, and to Praggle for the German translation.

September 2016 work summary

I was busy in September helping clients. I had little downtime. Here is some of the work I did in September. All client information has been anonymized:

  • I was asked to remove an ad that appeared after a user’s posts. It turned out the ad that was actually in his post signature.
  • I did an analysis of a client’s forum. Like many I see, someone wrote an integration between phpBB 3.0 and a client’s in house content management system. The CMS handled the registration and by being logged into it was also logged into the forum. The forum is using phpBB 3.0, so some hacks were added to the base code to permit the integration. I compared his files with a reference to see what was different and summarized the custom changes that were made by a previous programmer. I provided guidance on upgrading to 3.0.14 if desired along with a work estimate, and guidance on implications of moving to phpBB 3.1 (a better long term solution). Later in the month, the client decided to upgrade phpBB to 3.1 and created a test area for client review. He added the integration code. I moved the forum files over into 3.1 instance client created. Client also moved the 3.0 database to the test area. I edited config.php to point to the 3.0 database. 6300 files took a while to move. The upgrade to phpBB 3.1 was successful. I changed server and cookie settings to point to test domain. User to take care of style changes and to add integration with custom CMS. Customer feedback will determine if this will be done for production. Later, worked on retrofitting we_clearblue style to customer’s CMS. It was not entirely successful. There were some integration issues. but the client’s designers will handle them.
  • I upgraded forum from phpBB 3.0.11 to 3.1.9 using the default prosilver style. I integrated the old logo. There were no issues during upgrade itself, but I had to remove a lot of dead modules. I added a home link and changed the server settings to https.
  • I investigated mysterious HTTP 406 errors that occurs when editing a post with lots of text and images. Assumed it was due to an Apache mod_security issue. I added some instructions in the forum’s .htaccess file to disable mod_security but it had no effect. I tried an online chat with web host’s tech support, who could not resolve it. They wanted a ticket filed with image of problem and IP used. I asked the client to submit the support ticket since this was a hosting issue I could not fix. They did fix it, but it took a few days.
  • A forum had my digests extension version 3.0.3 installed. Client complained of cron email errors, and a user getting 30 copies of digest and a messages in the admin log indicating there was nothing to send in a digest. The latter is not a problem and is by design. I could find no evidence of 30 copies being sent. The cron error may be due to “Administrator1” who was subscribed not having a valid email address on the domain. Days later I had a short screen sharing conference call. The remaining issue was that some users could not see digests tab in UCP. This was a permissions issue I fixed in version 3.0.5 but the migrator program did not explicitly overwrite these settings. Toward the end of the month, I got a note that some users were still getting multiple digests. I added debug code to see SQL being issued. No cartesian product was resulting from the SQL query, but the messenger object was not reset after each mailing. I added that line of code. I am still troubleshooting this issue and I am not sure of the cause, but want to fix it for the next version of the digests extension.
  • A poor web host a client was using would not allow a forum upgrade from version 3.0 to 3.1 because PHP could not be upgraded to one supported by phpBB 3.1. I recommended using siteground.com. Client purchased hosting on siteground.com. I created new phpBB 3.1 instance on new hosting since there were only test posts. I installed the Metro Purple style and FAQ manager extension. I moved the domain when he provided registrar information. At his request, I hid links for FAQ and member list links. I tweaked viewtopic_body.html to move the poster’s profile to left side of screen. I then helped sort a logo placement issue with the style and answered search engine questions. I did a lot of work trying to make the logo fit the size proportionately when screen width shrank. I found no easy way so created 3 versions of the logo at different breakpoints.
  • Digests were not going out in a phpBB 3.0 forum. After investigating it looks like they started going out again that morning. Hosting had changed from Window to Linux, so the issue of digests not going out was due to SMTP being enabled. Client turned this off and it seems digests started going out again. I did upgrade digests from 2.2.25 to 2.2.27. Client upgrade from 3.0.12 to 3.0.14 did not seem to overwrite any digest file changes.
  • Client wanted an ability for his users to enter and report on events on his website and asked if I could write PHP scripts to do this dynamically. He provided an Excel spreadsheet as a mockup. I loaded the data in the spreadsheet into a MySQL table. I created a preliminary report for review. After feedback, I created the data entry module that users could use to post events. Later I made tweaks to these dynamic pages to meet other requirements.
  • Client wanted to reach forum users that hadn’t posted or visited in awhile. I created a CSV export of selected fields from the users table containing username, user_email, last visited date and registration date.
  • Former client contact information had changed. The new contact couldn’t get into iPage hosting. I provided the information I had after getting prior contact’s approval to do so.
  • I had two Skype discussions with an existing client on why email notifications weren’t going out. There were SMTP email errors. In addition, the client had his email notifications turned off in the user control panel. Worked with in house tech person to get new SMTP server information and configured it for the phpBB form. I showed client how to use the mass email feature to send out test emails.
  • I installed version 3.0.5 of my digests extension on test forum running phpBB 3.1.9. Sending digests manually and via a phpBB cron worked but sending it via system cron did not. After analysis, it turned out that GoDaddy’s jail shell could not handle multiple statements in a cron. I tried a number of approaches but eventually used curl to call cron.php hourly and turned off the system cron configuration.
  • Client needed an emergency installation of phpBB. Installation failed in the web host’s scripting manager. It looked like it was mostly installed. A populated database existed, and software was in /phpBB3 folder. I had to turn on PHP which for some reason was turned off and create the config.php (it was empty) for the forum to come up. I reset the password for admin and gave it to him. Client provided logo. I resized it and placed it.
  • I updated the Tapatalk extension for a client from version 1.3.7 to 1.3.8
  • I updated the Tapatalk extension for another client from version 1.3.7 to 1.3.8. I checked potential connection problem with Tapatalk for SEO and Push, but if it existed the update fixed it.
  • A forum used by Croatians was running slow. Forum was running phpBB 3.0.7-PL1. I checked indexes of the most frequently used tables. I found one duplicative index that I deleted. Most tables were using MyISAM storage engine. I optimized the tables but slowness persisted. So I changed the storage engine for these tables to InnoDB and performance suddenly became quick. Converting search_wordmatch table however seem to hang cPanel but eventually finished. Client is very pleased.
  • I upgraded a forum from phpBB 3.0.12 to 3.1.9. My digest mod was only mod installed. Crons used by digest had stopped working with rehosting causing no digests to go out. I installed digests extension version 3.0.5 and created an hourly cron to call cron.php. Tested and it worked. I warned client about possible duplicative digests due to possible bug.

August 2016 work summary

August was generally a slow month workwise. I took the first ten days of August off as I was hosting relatives. Even so the rest of the month was slow. I used the downtime to work on updating my Smartfeed extension. Work picked up toward the end of the month. Work in August included (all client information has been anonymized):

  • I completed a project I started in July. See the last item in July’s work summary if interested. The additional work included various troubleshooting, mostly regarding newly registered users having posts placed in the moderation queue for some forums. I changed the “Newly registered” role to No from Never for whether posts required moderation and that solved the problem. This is because the Registered Users (a group to which Newly registered users also belonged) had posting without moderation permissions. I also partially installed a style. The client had someone else finish this work as I was unavailable due to hosting guests.
  • I had an interesting project where a user recovered his database but the database backup was not complete. On a phpBB 3.0.11 forum, all tables after the sessions table were empty including key tables like topics and users. However, he had an earlier backup that had some data in these other tables. So essentially I had to recreate the missing rows in the topics table and recreate the missing users in the users table. To recreate the missing topics, I used a program I developed for a client who had this problem in 2015, which basically gleaned the information from the posts table and inserted the necessary rows in the topics table. There was no way to recover the missing users, but I could create pseudo-users instead, which was okay with the client. So I looked at the user_ids in the posts table and found those that were not in the users table, then created new rows in the users table for these users. I gave them a pseudo-username, basically member_99999 where 99999 was the user_id in the posts table. My script created a unique password, a phony email address then called phpBB’s create user program to place these users back in the users table. This gave the forum’s tables a relational consistency so all topic replies could be seen. Certain other tables though, like users_groups and topics_track could not be fully restored, but this was something the client agreed he’d have to live with. After completing this portion successfully, I was asked to upgrade the forum to phpBB 3.1.9. The forum had 1.47M posts but at least had a dedicated server, meaning there would be no resource problems during the upgrade. The upgrade still faltered because the forum’s cache folder had public write permissions taken away executing any line of database_update.php. The client fixed this odd permissions issue then the upgrade went successfully. I looked into issue of possibly missing posts in a topic but they were all there.
  • For a regular client, I added another advertiser image to the overall_header.html template and linked it to the advertiser’s website.
  • My client was given a copy of the database from a forum its webmaster no longer wanted to host and got his permission to move it to a new domain. But he did not get contents of files or images folders. Using the database extract, I moved the forum to a new domain but after doing this the client got stuck on a number of technical issues. I helped him get through these. Two scripts had syntax errors that had to be fixed. Also, PHP had to be upgraded, the old style was missing and i had to install it and make it look similar to before. I had to change some file permissions. The next day I added two menu links to the style to match the old site and upgraded forum to phpBB 3.1.9.
  • I upgraded a forum from phpBB 2.0.22 to 3.1.9. I installed a colorizeit.com generated variation of Elegance style I called Elegance Orange to match the old colors. I reduced the width of the content to match the site styling that was already there on other parts of the site. The user had to upgrade PHP before the upgrade could proceed.
  • I upgraded 1.1M post forum on shared Bluehost hosting from phpBB 3.0.12 to 3.1.9. I installed the Tapatalk extension and an extension to compile the style. I created a custom version of the Elegance style on the colorizeit.com site. It was very painful to convert forum. I had to move everything to my machine to get the database update program to run without resource problems. I then had to reimport it back into his database, which was already bulging because he had gone over quota for his MySQL database. I ended up removing three other databases to avoid 504 gateway timeout errors. I use a staggered import program (bigdump.php) to load these large databases on shared hosts. But even using that it wasn’t enough. It would stop at random points while running bigdump.php. The extract file was huge (about 800MB) so to finish I basically snipped out the parts of the import file that had loaded successfully using a very large file editor then ran bigdump.php again. I had to do this five times to get it all to load, then I had to correct some schema and duplicate row issues that had crept in due to my process. Upgrading large databases on underpowered shared hosts really sucks! Afterward, I Integrated logo and tweaked style to make it resemble how it looked when running phpBB 3.0.12.
  • I added Sortable Captchas extension for a client and created some sample questions for it. While I was there upgraded client from 3.1.8 to 3.1.9.

Compiling and tweaking styles in phpBB

Many fancier phpBB styles are now written to be “compiled”. This means that if you need to make changes to a stylesheet, you actually need to find the right .scss stylesheet and edit that instead of the traditional approach of editing a .css file. If your style uses this approach, you will find these .scss files in the theme folder of your style.

Unfortunately, after editing these files no changes are automatically affected on your website. You must “compile” these .scss files into a stylesheet that the browser will recognize, i.e. with a .css suffix. In the phpBB world this generally means compiling all these .scss files into one file, stylesheet.css. Once that file is rewritten the changes will be applied by the browser.

Using Chrome's developer tools to inspect the CSS for a page object
Using Chrome’s developer tools to inspect the CSS for a page object

How do you know what .scss file to edit? It’s hard to know when a stylesheet is compiled since all the styling is in stylesheet.css. It helps to “snoop around”. There’s a simple way to do this: use the Inspector built into all the browsers. While the look varies a bit from browser to browser, you just right mouse click and find the Inspect option. You can save some time if you have your mouse pointer focused on the area you want to inspect first then doing the right mouse click.

In the example shown, I used the Inspector built into the browser to look at the <div> object containing the search box. This gives a clue to how I might change the background color of the search box. In this example I used the default prosilver style, which does not use .scss files. However, it does say that I need to change the .search_header style to change its background color. In this case I know it’s in colours.css, but in a theme using .scss files you’d have to hunt for the file containing the style. It’s often not too hard based on what you are looking at, its intended purpose and the .scss file names.

The nice thing about both these tools is that you can test changes in the tool on the styles tab of the tool. Once you have it looking right, you can apply the change to the appropriate .scss file.

How do you compile these .scss files? If running phpBB 3.1 or 3.2, there’s a little known extension that allows you to do it. (It is little known because it is not considered an official phpBB extension, so you have to get it off the Artodia website instead.) Install it as you would any other extension then find it on the customise tab in the ACP under “Compile Themes”. Once compiled, go test it. There should be no reason to purge the cache, but if you don’t see the changes you may need to clear your browser’s cache.

If you have a phpBB 3.0 style that uses .scss styles, look for documentation with the style on how to compile it.

Many of these styles have a control file used to easily change colors, fonts, common object widths and heights, etc. It is probably called _style_config.scss.

If curious, SCSS means “Sassy CSS” files which are described in more detail on the SASS website.