{"id":1081,"date":"2011-09-27T10:28:10","date_gmt":"2011-09-27T14:28:10","guid":{"rendered":"http:\/\/mossiso.com\/?p=1081"},"modified":"2014-09-22T15:12:32","modified_gmt":"2014-09-22T19:12:32","slug":"making-smf-static","status":"publish","type":"post","link":"https:\/\/mossiso.com\/2011\/09\/27\/making-smf-static\/","title":{"rendered":"Making SMF static"},"content":{"rendered":"

\"\"<\/a>We have a few legacy forums powered by the good software SMF (SimpleMachines Forum<\/a>). Like many of the WordPress installs, it’s a pain and a security risk to keep these up-to-date when they are no longer needed as content creation platforms. So, once again I need to convert a web app into static HTML pages. This process proved a bit harder than converting WordPress to static HTML.<\/p>\n

Step 1: Upgrade<\/strong><\/h2>\n

The first thing to do is update to the latest version. This ensures that if you need to turn this back into a dynamic site, it should hopefully be compatible with whatever the latest version is at that time.<\/p>\n

Step 2: Make it public<\/strong><\/h2>\n

Next, we’ll need to make it public to guests, so that wget has access to the pages.<\/p>\n

Go to the Admin->Features and Options page and check the “Allow guests to browse the forum” box, then click save. Now we have to change the permissions on each board separately. Or with a bit of MySQL magic, we can change them all at once using the CONCAT operator. Open of phpMyAdmin, or something else of your choice. Before we mess with the data, make a copy of the table, just in case we totally hose it.<\/p>\n

Browse to the ‘boards’ table, and then to the SQL tab. We’re going to enter an SQL command that will pre-pend (that’s append but onto the front rather than the end) some data.<\/p>\n

UPDATE boards SET member_groups=CONCAT('-1,', member_groups) WHERE 1<\/pre>\n

 <\/p>\n

This will add a -1, to the beginning of each field, which makes the board viewable by guests. No need to log in, which means wget can scrape the pages and turn them into HTML.<\/p>\n

Step 3: Edit Theme files<\/strong><\/h2>\n

Now we get to play around with the theme files to get rid of forum specific items that we won’t need, like links to member info, the login, help, and search links, and anything else that we don’t want.<\/p>\n

Here are some items to delete or alter, and the files I found them in for our home-made theme based off of an old default theme.<\/p>\n

index.template.php<\/strong><\/h4>\n