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.