The user profile would be completely wiped. Only the username would be preserved using the “guest poster” function.
Interesting, but would have to create a new field in the database to make that happen. I’ll post more about this in the BOB 2.0 topic.
Here’s the current table structure of the POSTS table.
+-----------------+-----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-----------------------+------+-----+---------+----------------+
| post_id | mediumint(8) unsigned | NO | PRI | NULL | auto_increment |
| topic_id | mediumint(8) unsigned | NO | MUL | 0 | |
| forum_id | smallint(5) unsigned | NO | MUL | 0 | |
| poster_id | mediumint(8) | NO | MUL | 0 | |
| post_reason_id | mediumint(5) unsigned | YES | | 0 | |
| post_time | int(11) | NO | MUL | 0 | |
| poster_ip | varchar(8) | NO | | | |
| is_mod_post | tinyint(1) unsigned | NO | | 0 | |
| best_answer | tinyint(1) unsigned | YES | | 0 | |
| post_locked | tinyint(1) unsigned | NO | | 0 | |
| post_username | varchar(25) | YES | | NULL | |
| enable_bbcode | tinyint(1) | NO | | 1 | |
| enable_html | tinyint(1) | NO | | 0 | |
| enable_smilies | tinyint(1) | NO | | 1 | |
| enable_sig | tinyint(1) | NO | | 1 | |
| post_edit_time | int(11) | YES | | NULL | |
| post_edit_count | smallint(5) unsigned | NO | | 0 | |
| post_attachment | tinyint(1) | NO | | 0 | |
+-----------------+-----------------------+------+-----+---------+----------------+
POST_ID is the unique key for the post.
TOPIC_ID is the foreign key for the TOPIC the post belongs to.
FORUM_ID is the foreign key for the FORUM that the TOPIC and the POST belong to. This is essentially for shortcut joins but also drives the “last post in the forum” logic.
POSTER_ID is the foreign key to the USERS table. It either contains a positive integer that is the USER_ID value, or it contains a -1 indicating that it’s a guest (non-logged in) users. For BOB we never allowed guest posts.
I’ll skip a number of the other fields, and talk about POST_USERNAME next. For a guest poster, they have to enter a username that will be used to display on their post. Since there is only one guest entry in the USERS table (with the ID of -1 as already mentioned) the username has to be stored on the post itself.
So the PII elimination process looks like this:
Step 1:
UPDATE POSTS_TABLE P
SET POST_USERNAME = (SELECT U.USERNAME FROM USERS U WHERE P.POSTER_ID = U.USER_ID)
That, or something like it, would transfer the user name from the USERS table onto the POSTS table.
Step 2:
UPDATE POSTS_TABLE
SET POSTER_ID = -1
That marks all posts as being from guest, showing only the username of the original poster. At this point I can drop the USERS table content and all PII - including the country flag - is gone.
Now if we wanted to preserve the country flag, I would add a flag_id column to the POSTS table and update accordingly. The column, as you might expect, is USERS.FLAG_ID.
If you look at the POSTS table information I included above, the following columns were added during various code modifications / enhancements here on BOB and are not part of a standard phpBB2 install.
POST_REASON_ID
IS_MOD_POST
BEST_ANSWER
POST_LOCKED
If you want a tech reference for the phpBB2 table structure, I built one years ago here:
http://www.phpbbdoctor.com/doc_tables.php
Dave Rathbun (BOB member since 2002-06-06)