XMB Forum Software

Youtube install problem

merchant1307 - 2-13-2019 at 01:41 AM

Only shows bbcode and not the video.

bfgadmin - 5-7-2020 at 08:10 PM

I had the same problem. I ended up finding a partial workaround, and implementing the BBCode in functions.inc.php only.

Users have to manually enter their YouTube videos, for now. But I'll find the workaround and post it here when I do.

Here is my code:

Code:
$patterns[] = "#\\[youtube]([a-zA-Z0-9_-]+)\\[/youtube]#Si"; $replacements[] = '<object width="425" height="350" class="youtube"><param name="movie" value="https://www.youtube.com/v/\\1"></param><param name="wmode" value="transparent"></param><embed src="https://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';


Just above this line in functions.inc.php

Code:
$message = preg_replace($patterns, $replacements, $message);


NOTE: I changed my youtube link to https to support SSL. If you aren't using SSL, feel free to change the <param> and <embed> src attributes back to "http://www.youtube.com"

To use this, you simply enter this in when posting a thread or reply:

Code:
[youtube]movie-ID-here[/youtube]


Still working to determine where the break-down is, since I'd love to have the prompt as well. My users just seem happy to be able to embed YouTube movies.

lottos - 5-8-2020 at 12:14 AM

Youtube modification that works with prompt: https://www.xmbforum2.com/modifications/youtube-bbcode.zip


Some youtube id's simply do not work though and as OP said, only the bbcode appears.

For example, if you try this one on a forum that has the youtube mod:

[youtube]ahZFCF--uRY[/youtube]

This is not an issue unique to xmb as even the playground:
https://www.bbcode.org/playground.php

results in just the bbcode showing for the id above.

bfgadmin - 5-8-2020 at 02:35 AM

Quote: Originally posted by lottos  
Youtube modification that works with prompt: https://www.xmbforum2.com/modifications/youtube-bbcode.zip


Some youtube id's simply do not work though and as OP said, only the bbcode appears.

For example, if you try this one on a forum that has the youtube mod:

[youtube]ahZFCF--uRY[/youtube]

This is not an issue unique to xmb as even the playground:
https://www.bbcode.org/playground.php

results in just the bbcode showing for the id above.


Oh snap! Good look lottos, going to implement this on my board.