I restored a ten-year-old phpBB forum, and after upgrading it to 3.1.x, I noticed that the quote BBCode is not working correctly (but I don’t know if it worked in the old version).

If no username/URL is specified, everything’s fine:


But if the username/URL is specified, the format in old posts looks like this:


while phpBB seems to require this format (and this is also what the post editor generates):


So the quotes around the name/URL are missing.

How could I convert this BBCode in old posts? Or is it possible to make the version without quotation marks work in addition to the new one?


I just hunted down the code that Nathan and I developed back when we released version 1 of phpBB and it did use both quote= and quote=""

Here is the related code, perhaps it can point you in the right direction:

$text = preg_replace("/\[quote="(.*?)"\]/si",$bbcode_tpl['quote_username_open'], $text);

and for the .tpl file:

<!-- BEGIN quote_username_open -->
<table cellspacing="1" cellpadding="3" border="0" id="quoted-member">
        <td><span class="NormText"><b>{USERNAME}:</b></span></td>
        <td class="Comments_Quote">
<!-- END quote_username_open -->
  • Thanks! Do you have a suggestion for a possible way to implement this? Should I try to edit phpBB’s definition (in core) for quote so that it accepts both variants? (adding a custom BBCode doesn’t seem to work because of the same name it would need to have) – unor Oct 11 '15 at 5:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.