Add a Tweet BBcode to a phpBB Forum

I was looking for a way to embed a tweet into phpBB using the BBcode funcationality. I found a decent solution but edited it a tiny bit (to account for http vs https URLs).

BBcode usage:


HTML replacement:

<script type="text/javascript">
function loadx(data) {
<script type="text/javascript" src="{IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>

Here’s the result:

Thanks to Evan Hoffman.


7 thoughts on “Add a Tweet BBcode to a phpBB Forum

    1. Hiya, you need to go to your admin panel > posting > BBcodes.

      Then add a new BBcode. You’ll see the two fields to complete: “bbcode” and “html replacement”. Fill those in and save. :)

    1. Dave, do you mean a closing “/div” ? (I think the comment box removed your code if you typed some there)… I just rechecked my forum and it seems to work exactly as per my post… maybe phpBB is smart enough to auto-close it?

      1. Hi.

        Thanks for the example, it works great, but has dpmcalister said, it’s better with a . On my phpbb, it works fine without, but when a post a tweet, the following signature has a wrong font and size. So just add the closing /div if you see a font glitch or something else.

  1. Yes, I did – darn WordPress trying to be helpful ;)

    On my forum, I needed to add it or it threw things out of whack. May be just my forum though.

    Thanks again :)

Leave a Reply