Administrator
Administrator
Posts: 27
Joined: 18 Oct 2003, 16:43
User avatar
Administrator
Administrator
Enable YouTube BBCode

Post by zabar »

Log in to your phpBB Admin Control Panel (ACP).
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>
Usage Example:
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]
Replace VIDEO_ID with the actual ID of the YouTube video you want to embed. For example, for the URL https://www.youtube.com/watch?v=dQw4w9WgXcQ, the VIDEO_ID is dQw4w9WgXcQ.

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]
Step 3: Testing
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!

Information

Users browsing this forum: No registered users and 3 guests