Search code examples
phpmysqlmarkupphpbb

What are these characters for within PHPBB tags?


I'm in the process of migrating a website using PHPBB forums to a new microsoft platform that doesn't use the same tag markup (for things like Bold, Italic, Images etc).

I've just noticed in the MySql database for the existing PHPBB site, that enclosed within many of the tags are additional characters that I wasn't expecting to see, and I don't know what their purpose is.

For example:

[b:522f1e2c15]bold[/b:522f1e2c15]
[i:522f1e2c15]italic[/i:522f1e2c15]
[u:522f1e2c15]underline[/u:522f1e2c15]

I was expecting to see:

[b]bold[/b]
[i]italic[/i]
[u]underline[/u]

What's the purpose of these additional characters?


Solution

  • phpBB 3.x adds a unique id (unique per post) to all BBCode tags. This is to improve parsing performance. To remove the uid markers, you can use decode_message.

    $clean_message = decode_message($row['message'], $row['bbcode_uid']);
    

    Hope that helps.

    Resources