How do I add youtube videos to my PhpBB3 board?

The problem

A client who owns the message board at http://www.electrofreaks.com/ wanted to allow his users to embed youtube videos within their messages. Currently people are able to link to youtube videos, but are not able to embed videos within their posts.

The Solution

Within phpBB3 there is a feature which allows you to create custom BBCodes. This means that it is possible to embed anything into your phpBB3 message board, so long as embedding is supported on the site which contains the content you wish to embed. Here are the steps:-

1) Log in to the administration control panel (ACP) of your phpBB3 installation and click on the “Posting” tab on the top menu.

2) On the right hand side of the screen click “Add a new BBCode”.


3a) Enter the following in the box which says “BBCode usage”:

[YouTube]http://www.youtube.com/watch?v={IDENTIFIER}[/YouTube]

3b) Enter the following in the box which says “HTML replacement”:

[sourcecode language=”html”]
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/{IDENTIFIER}" frameborder="0" allowfullscreen>
</iframe>
[/sourcecode]

3c) Enter the following in the box which says “Help line” (This will appear when a user puts the mouse over the custom BBCode):

Insert YouTube URL – Example: [Youtube]http://www.youtube.com/watch?v=0BU8M0sCXAM[/Youtube]

3d) Make sure that the “Display on posting page” check box is checked. This ensures our new BBCode is visible when users post a message.

3e) Click the submit button.

That is all! You can now leave the administration control panel and return to the forum. You should now be able to see the custom “YouTube” BBCode in the editor when a user posts a new topic.

To post a youtube video simply paste the url of the youtube video into your post, select the url, and click the YouTube BBCode.

For example this will convert the url http://www.youtube.com/watch?v=AzgtFLk1GUw into [YouTube]http://www.youtube.com/watch?v=AzgtFLk1GUw[/YouTube]

When you click on post the youtube video will appear embedded inside your post.

If you would like help with a technical problem that you are having difficulty with, please click on the contact tab at the top of the page and write me an email and I will post the solution in a future post 🙂

6 thoughts on “How do I add youtube videos to my PhpBB3 board?

  1. Iddee

    While following your instructions, I bounced my wireless mouse on the desk and it activated “submit” before I was finished. Now, after finishing, when I click submit, it says the bbc code is already there, but doesn’t give me a button to overwrite it. How do I remove the partial.

    Reply
  2. andrew

    Good day I tried that on my site but it only shows the youtube URL inside the tags when i post. Do you have any idea what could be causing that?

    Reply
  3. steve

    I looked everywhere, and nothing, great help thanks. Quick FYI. For the code to work properly, the “s” in https needs to be removed in my forum.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.