XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author:

Youtube install problem

merchant1307
Member
***




Posts: 9
Registered: 12-19-2018
Member Is Offline


[*] posted on 2-13-2019 at 01:41 AM
Youtube install problem


Only shows bbcode and not the video.
View user's profile View All Posts By User
bfgadmin
Member
***




Posts: 34
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 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.




XMB Rocks!
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 364
Registered: 6-3-2002
Location: Competitions Australia: https://www.lottos.com.au/
Member Is Offline

Mood: pass me a TimTam

[*] posted on 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.




Largest list of competitions online!
View user's profile Visit user's homepage View All Posts By User
bfgadmin
Member
***




Posts: 34
Registered: 5-7-2020
Location: Pittsburgh, PA
Member Is Offline

Mood: Technical

[*] posted on 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.




XMB Rocks!
View user's profile Visit user's homepage View All Posts By User

  Go To Top

Powered by XMB 1.9.11 (Debug Mode)
Forum Script Software by XMB © 2001-2020 The XMB Group
[Queries: 16] [PHP: 33.2% - SQL: 66.8%]
Funded with thanks to competitions website.