phpBB2HTML - Script for converting phpBB forum to static pages

Each forum thread becomes an HTML page containing messages and the author's name.

The script is extensible and can contain all the information provided by the database.

The created HTML page will look like this:

Conversion d'un forum en pages HTML

SQL access to forum content

The name of each table is preceded by the contents of the $ table _ prefix variable. We use three tables from the database.

topics

topic_id   topic_title ... topic_moved_id
Wire number   Wire name   0 if not moved

What we are interested in in the stream table is the name of the topic, so the field topic_title, and the field should topic_moved_to be 0 if the topic is not moved, without which it is ignored.

The date is used in the query to classify flows chronologically when an interval is selected.

Request to read data from streams:

if(intval($starting) == intval($ending))
$condition = "((topic_id = '$starting') AND (topic_moved_id = 0))";
else
$condition = "((topic_id >= '$starting') AND (topic_id <= '$ending') AND (topic_moved_id = 0))";

SELECT topic_id, topic_title, topic_moved_id FROM $tabletopics WHERE $condition ORDER BY topic_time ASC

messages

... post_time poster_id post_text ... topic_id
  Date Author ID Contents   Wire number

The following query is used to read banknotes from the stream:

SELECT poster_id, post_text, post_time FROM $tableposts WHERE topic_id='$id' 

The date is then formatted using the $ dateformat variable. You can also use the default_dateformat field in the config table.

users

By the identifier of the author of the post in the post table, his name is obtained in the user table.

... user_id ... username ...
  Author ID corresponds to poster_id in posts   Author name  

This requires an additional request:

SELECT user_id, username FROM $tableusers WHERE user_id='$posterid'

Installation and use

Download the archive and extract the contents to a local folder.

All four files, including phpb2html.php, must be installed on the site containing the forum at the root of the forum in the directory containing the set.php file .

You can rename a script. It's desirable.

The script is run from the browser by entering the forum URL, for example:

http://www.example.com/forum/phpbb2html.php

This interface allows you to specify the flow number or the interval of all flows between two numbers.

Static pages are created in one directory and page URLs are displayed in the interface. Click the title to see the page you created.

Download Script: