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.
Code:
<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('&'); var b = []; b[0] = a[0].split('=')[1]; b[1] = a.slice(1).join('&'); document.write('<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/'+ b[0] +'?fs=1&'+ 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&'+ 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?