Please login or register. Welcome to the Studio, guest!

Quick Links:



Chris Avatar

Head Coder


June 2005
<script type="text/Javascript">
// YouTube UBBC for Posts by Chris
// Do not redistribute without permisison of the creator

var ubbcURL = ""; // URL of the YouTube UBBC image

// No need to edit
var aTD = document.getElementsByTagName("TD");
if(aTD[a].colSpan == 2 && aTD[a].vAlign == "top" && aTD[a].height == "100%" && aTD[a].innerHTML.match(/\[yt\](.+?)\[\/yt\]/gi)){
aTD[a].innerHTML = aTD[a].innerHTML.replace(/\[yt\](.+?)\[\/yt\]/gi,'<object width="425" height="355"><param name="movie" value="$1"></param><param name="wmode" value="transparent"></param><embed src="$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>');
} else if(document.create_post){
var m = document.postForm.message;
m.value = m.value.replace(/\[yt\].+?\[\/yt\]/gi,"");
var h = document.createElement("span");
h.innerHTML = " <a href='javascript:add(document.create_post.message, \"[url=\", \"]YouTube Video[/url]\");'><img src='"+ubbcURL+"' border='0' alt='YouTube' /></a>";
var c = document.create_post.message_color.parentNode;
c.insertBefore(h, c.getElementsByTagName("br")[1]);

This code will let you embed YouTube videos in your posts. They won't automatically play until the user hits the play button, so it won't make computers load the page slowly.

The module should go in your global footers.

Please note that the YouTube UBBC is only supported in posts, not PMs.

When posting a video, you put the video ID between the [url= tags. The ID is the part of the URL following v=

Last Edit: Nov 4, 2008 1:35:31 GMT by Chris