Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: joebrian43 on February 08, 2024, 01:20:56 PM

Title: Implementing Custom BBCode for YouTube Embedding
Post by: joebrian43 on February 08, 2024, 01:20:56 PM
Hello everyone,

I'm currently working on a project using Simple Machines and I'm trying to enhance the user experience by allowing them to embed YouTube videos directly into their posts using custom BBCode. However, I'm facing some difficulties in implementing this feature.

Here's what I've tried so far:

I created a custom BBCode for YouTube embedding using the SMF admin panel, but the videos aren't displaying correctly.
I've searched through the SMF documentation and forums but couldn't find a clear solution to my issue.
I attempted to use HTML embedding directly into the posts, but it seems like the forum software is stripping out the HTML tags for security reasons.
Can anyone guide me through the process of properly implementing custom BBCode for YouTube embedding in SMF? Any insights, tips, or code snippets would be greatly appreciated.

Thank you in advance for your help!
Title: Re: Implementing Custom BBCode for YouTube Embedding
Post by: Diego Andrés on February 08, 2024, 01:26:36 PM
How would it be different from the current YouTube BBC the forum has by default? Or just posting the video link?
What additional functionality are you trying to achieve?
Title: Re: Implementing Custom BBCode for YouTube Embedding
Post by: Sesquipedalian on February 08, 2024, 04:49:50 PM
Screenshot 2024-02-08 at 2.47.39 PM.png
Title: Re: Implementing Custom BBCode for YouTube Embedding
Post by: Illori on February 08, 2024, 05:08:40 PM
that is assuming that the op is using SMF 2.1 and not SMF 2.0.
Title: Re: Implementing Custom BBCode for YouTube Embedding
Post by: Sesquipedalian on February 08, 2024, 05:13:51 PM
True.

@joebrian43, if you are using SMF 2.0, you should consider installing the Ohara YouTube Embed (https://custom.simplemachines.org/index.php?mod=3268) mod.
Title: Re: Implementing Custom BBCode for YouTube Embedding
Post by: Kindred on February 08, 2024, 09:01:32 PM
Or upgrading and using 2.1.x
Title: Re: Implementing Custom BBCode for YouTube Embedding
Post by: joebrian43 on February 09, 2024, 01:08:19 PM
Quote from: Sesquipedalian on February 08, 2024, 05:13:51 PMTrue.

@joebrian43, if you are using SMF 2.0, you should consider installing the Ohara YouTube Embed (https://custom.simplemachines.org/index.php?mod=3268) mod.

Thank you so much for your prompt response and suggestion! Installing the Ohara YouTube Embed mod did the trick, and now the YouTube videos are displaying perfectly within the posts. I really appreciate your help and guidance on this matter. It's made a significant improvement to the user experience on my forum. Thanks again!