1

Topic: Sound Tag

I'm looking to make a bbcode sound tag but I'm still new to understanding PHP.

Basically my idea is to make a tag similar to an [img]tag such as [snd]x[/snd]

I don't no where the bb code is in Punbb, but I imagine that you could do something like how the image tag replaces [img]image.jpg[/img] with <img src "image.jpg">(or something like that) except you'd have the [snd]sound.mp3[/snd] would be replaced with something like.

<script type="text/javascript">

var sndURL = 'sound.mp3';

var hasWMP = false;
var hasQT = false;

var playWMP = '<object id="MediaPlayer" width=320 height=45 classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Windows Media Player components..." type="application/x-oleobject"><param name="url" value="' + sndURL + '" /><param name="autoStart" value="0" /><param name="volume" value="100" /><embed type="application/x-mplayer2" src="' + sndURL + '" name="MediaPlayer" autostart=0 volume="100" width=320 height=45></embed></object><br />';
var playQT = '<embed src="' + sndURL + '" autostart="FALSE" width=144 height=16><br />';
var playLink = '<a href="' + sndURL +'">[SOUND: ' + sndURL + ']</a><br />';

if (navigator.appName == "Microsoft Internet Explorer")
{
    document.writeln(playWMP);
}
else
{
    for (i = 0; i < navigator.plugins.length; i++ )
    {
        if (navigator.plugins[i].name.indexOf('Windows Media') >= 0)
        {
            hasWMP = true;
        }
        else if ((navigator.plugins[i].name.indexOf('QuickTime') >= 0))
        {
            hasQT = true;
        }
    }
    
    if (hasWMP)
    {
        document.writeln(playWMP);
    }
    else if (hasQT)
    {
        document.writeln(playQT);
    }
    else
    {
        document.writeln(playLink);
    }
}

</script>
<noscript><a href="http://www.psychoholiday.com/uploaded/New%20Liam%20Song_mixdown01.mp3">[SOUND]</a></noscript></div>

I look through both the Punbb mods section and the PunBB Resource and didn't find anything. Any help would be greatly appreciated. smile

2

Re: Sound Tag

<embed src=... - potential security bug.

i C q  1 3 o o 7 5 5 5 5

Re: Sound Tag

KCEOH wrote:

<embed src=... - potential security bug.

I thought only if not under control....

Re: Sound Tag

Well, it's not under control if you can put arbitrary things inside it tongue

5

Re: Sound Tag

So this is plausible right? Could someone point me in the right direction of what I'd have to do?