Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Youtube Code Button Not Working Properly
Topic Started: Jul 8 2014, 01:39 PM (1,000 Views)
Spartins1988
Member
 *  
i'm trying to get a youtube button on my board but every time i use this code:

Code:
 
if(location.href.match("showtopic"))
{
var z = document.getElementsByTagName("div");
}
else if(location.href.match("Post&CODE"))
{
var z = document.getElementsByTagName("span");
}
for(x=0;x<z.length;x++)
{
if(z[x].className.match("postcolor") && z[x].innerHTML.match(/\[YOUTUBE\](.*)\[\/YOUTUBE\]/))
{
z[x].innerHTML = z[x].innerHTML.split("[YOUTUBE]").join("<embed src='").split("/watch?v=").join("/v/").split("[/YOUTUBE]").join("' type='application/x-shockwave-flash' wmode='transparent' width='425' height='355'></embed>");
}
}
var z = document.getElementsByTagName("td");
for(x=0;x<z.length;x++)
{
if(location.href.match("Post&CODE") && z[x].className.match("pformright") && z[x].innerHTML.match("Close all Tags"))
{
z[x].innerHTML = z[x].innerHTML.split("Close all Tags").join("</a><input type='button' value='YOUTUBE' onclick='addtheyttag()' onmouseover='giveythelp()' class='codebuttons'> <a href='javascript:closeall();'>Close all Tags</a>");
}
}
function addtheyttag()
{
document.REPLIER.Post.value+="[YOUTUBE][/YOUTUBE]";
}
function giveythelp()
{
document.REPLIER.helpbox.size="100";
document.REPLIER.helpbox.value="Paste full URL of Youtube video between these tags";
}


this is all i get:

Posted Image

I originally put the code under the board section but that's what i got. I tried moving the code around but it just moves everywhere but where its suppose to be. Could someone help me out here?
Edited by Spartins1988, Jul 8 2014, 01:40 PM.
Offline Profile Quote Post Goto Top
 
Meta Ing-ZNR
Member Avatar
---
 *   *   *   *  
Place <script type="text/javascript"> before the start of the code, and </script> after the end.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · zIFBoards - Skinning & Code Support · Next Topic »
Add Reply