|
How should I go about an HTML interegation into posts? So if I post [shout]39[/shout], it will display the shoutbox from my site with an id of 39 in my post?
Please don't steal my ideas...
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
For ProBoards?
Anyways, you'd use RegExp.
data = data.replace(/\[shout\](\d+)\[\/shout\]/gi,"<iframe src='shoutbox.php?id=$1'></iframe>");
Something like that.
|
|
|
|
|
So that is all I would need to do for finding and converting? I can add the ubbc button so I guess the code will be done soon. Cheers!
Last Edit: Jun 9, 2006 20:04:24 GMT by Singular
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
If you need anymore help with it, post here.
|
|
|
|
|
Do I need more than that one line? It doesn't work with just that?
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
|
Beastly. How can I make it so it displays <script type="text/javascript" src="http://www.s-shouts.com/viewshoutbox.php?id=1"></script> instead of an iframe? I tried puting it in and it didn't work.
Last Edit: Jun 9, 2006 22:47:03 GMT by Singular
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
Or you can be an innerHTML-phobe like me and write complicated DOM-hoodoo to get the job done. <script type="text/javascript"> <!-- function traverse(gNode) { if(gNode.nodeType == 3 && gNode.data.match(/(\[source\].+?\[\/source\])/i)) { var iString = RegExp.$1; var iFrame = document.createElement("iframe"); iFrame.src = iString.split("[source]")[1].split("[/source]")[0]; var index = gNode.data.indexOf(iString); gNode = gNode.splitText(index).splitText(iString.length).previousSibling; gNode.parentNode.replaceChild(iFrame, gNode); } else if(gNode.nodeType == 1 && gNode.hasChildNodes()) { for(var i = 0; i < gNode.childNodes.length; i ++) { traverse(gNode.childNodes ); } } } var gCell = document.getElementsByTagName("td"); for(var i = 0; i < gCell.length; i ++) { if(gCell.colSpan == "3" && gCell.vAlign == "top" && gCell.firstChild.nodeName == "HR" && gCell.firstChild.className == "hr") { traverse(gCell); } } //--> </script>[/size] If you need a breakdown of the code i'll supply it.
Last Edit: Jun 9, 2006 23:58:41 GMT by Aaron
|
|
|
|
Derfleurer, yours is still in a fram and it goes to the URL /1 instead of /shoutbox.php?id=1. Chris's is shorter and easier to understand for me, so I think that I will stick with Chris's as long as I can get it to write the actual JavaScript instead of the iframe.
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
[source]http://www.google.com[/source] Is that what you're using? Because it works fine for me in both IE and FF. kisrpg.proboards91.com/index.cgiIt opens up the URL provided in those tags in a frame.
Last Edit: Jun 10, 2006 0:52:38 GMT by Aaron
|
|
|
|
Oh, I see what you did. This script was going to be for a shoutbox from Singular Shouts, but I guess that would work too.
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
Go with what you understand. I was just being a pest.
|
|
|
|
But I still can't use CD's code to make it JavaScript? It should work.
|
Further Solutions :: Hosting :: Scripts :: Templates furthersolutions.com
v4 Studios - Coming soon
|
|
|
|
You can, you just need to change parts around... oh, AND you need to change </script> to <\/script>
|
|
|
|
|