Log in

View Full Version : Make your own bbcode?


Kyojii
11-24-2010, 05:32 AM
I'm attempting to replicated the current [video] tag in vB 3.8.4. Now I thought I could do this with a custom bbcode.

<script type="text/javascript"> if (/youtube/i.test("http://www.youtube.com/watch?v=7xrU5BxaPWo")){ var a ="http://www.youtube.com/watch?v=7xrU5BxaPWo".split('?')[1].split('&amp;'); var b = []; b[0] = a[0].split('=')[1]; b[1] = a.slice(1).join('&amp;'); document.write('<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/'+ b[0] +'?fs=1&amp;'+ b[1] +'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+ b[0] +'?fs=1&amp;'+ b[1] +'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>'); } </script>
This works, however if someone were to use the ajax edit, the javascript will not be run again and the videos do not show if you refresh the page. Thus I was wondering if there is a post somewhere on how to make your own custom bbcodes via php?

BirdOPrey5
11-27-2010, 03:42 AM
You can't use php in a bb code. But have you tried this mod? https://vborg.vbsupport.ru/showthread.php?t=202476