Jump to content
N-Europe

Website Code/Forum YouTube Embed Query/Proboards


ReZourceman

Recommended Posts

http://rule3dimension.proboards47.com/index.cgi?action=display&board=sugg&thread=1206906546

 

Okay, so I added this code that should work to my website. The code is ;

 

---------------------

 

<script type="text/Javascript">

// YouTube UBBC for Posts by Chris

// Do not redistribute without permisison of the creator

 

var perPage = 1; // How many YouTube videos per page. I suggest a limit below 3, as there are dialup users out there.

var ubbcURL = "http://img472.imageshack.us/img472/9892/yuotubeubbc8oa.png"; // URL of the YouTube UBBC image

 

// No need to edit

var aTD = document.getElementsByTagName("TD");

var curr = 0;

if(location.href.match(/action=display/i)){

for(a=0;a<aTD.length && curr < perPage;a++){

if(aTD[a].colSpan == 3 && aTD[a].vAlign == "top" && aTD[a].firstChild.nodeName.toLowerCase() == "hr" && aTD[a].innerHTML.match(/\[yt\](.+?)\[\/yt\]/gi)){

curr = curr+parseInt(aTD[a].innerHTML.match(/\[yt\](.+?)\[\/yt\]/gi).length);

aTD[a].innerHTML = aTD[a].innerHTML.replace(/\[yt\](.+?)\[\/yt\]/gi,'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/watch?v=$1"></param><embed src="http://www.youtube.com/watch?v=$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>');

}

}

} else if(document.postForm){

if(location.href.match(/quote=/i)){

var m = document.postForm.message;

m.value = m.value.replace(/\[yt\].+?\[\/yt\]/gi,"");

}

if(document.postForm.color)

document.postForm.color.parentNode.innerHTML += "<a href='javascript:add(\"[yt]\",\"[/yt]\");'><img src='"+ubbcURL+"' border='0' alt='YouTube' /></a>";

}

</script>

 

---------------------

 

And it worked here aswell but no where else.

 

http://rule3dimension.proboards47.com/index.cgi?board=ontopthr&action=display&thread=1155522574&page=2

 

No idea if anyone will be able to help, but fingers crossed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...