Navigate to Posting > BBCodes.
Click on Add BBCodes to create a new BBCode for YouTube.
In the Add new BBCode form, fill in the fields as follows:
BBCode: youtube (or any desired name)
BBCode: youtube (or any desired name)
HTML Replacement
Code: Select all
<iframe width="560" height="315" src="https://www.youtube.com/embed/%1$s" frameborder="0" allowfullscreen></iframe>
Description: A short description (e.g., "Embed a YouTube video")
Click Submit to save the new BBCode.
Step 2: Using the YouTube BBCode in Posts
Once the BBCode is set up, users can embed YouTube videos in their posts using the following format:
Code: Select all
[youtube]VIDEO_ID[/youtube]
Example Post
If you want to embed the video from the above example, you would write:
Code: Select all
Check out this cool video! [youtube]dQw4w9WgXcQ[/youtube]
Create a new topic or reply to a post in your phpBB forum.
Use the BBCode as described.
Submit the post and ensure the video displays correctly.
Important Notes
Permissions: Make sure users have the correct permissions to use BBCode in their posts.
Responsive Design: The iframe dimensions (width and height) can be adjusted to fit your forum's layout. For a responsive design, you might consider using CSS styles.
Security: Ensure that your forum's settings allow iframes to avoid security issues.
By following these steps, you'll enable your phpBB forum users to easily embed YouTube videos in their posts using a simple BBCode!