1
wishcraft
Background Sound Hack [bgsound]...[/bgsound]

Hi everyone, I had a page on indigenous Australian data and I wanted a dige there, so I made this hack so you could insert any sound you wanted.. Doesn't work in Mozilla as they don't support this tag which has been around for a very long time. But there are a lot of other browser that do.

$patterns[] = "/[bgsound noembed loop=([0-9]*) delay=([0-9]*) volume=(['"]?)([0-9]*)]([^"()?&'<>]*)[/bgsound]/sU";
$patterns[] = "/[bgsound noembed loop=([0-9]*) delay=([0-9]*)]([^"()?&'<>]*)[/bgsound]/sU";
$patterns[] = "/[bgsound noembed loop=([0-9]*)]([^"()?&'
<>]*)[/bgsound]/sU";
$patterns[] = "/[bgsound noembed]([^"()?&'<>]*)[/bgsound]/sU";
$replacements[] = '<bgsound src="\4" loop="\1" delay="\2" volume="\3" />';
$replacements[] = '<bgsound src="\3" loop="\1" delay="\2" />';
$replacements[] = '<bgsound src="\2" loop="\1" />';
$replacements[] = '<bgsound src="\1" />';
$patterns[] = "/[bgsound loop=yes]([^"()?&'<>]*)[/bgsound]/sU";
$patterns[] = "/[bgsound]([^"()?&'
<>]*)[/bgsound]/sU";
$replacements[] = '<embed src="\1" autostart="true" loop="true" hidden="true"></embed>';
$replacements[] = '<embed src="\1" autostart="true" hidden="true"></embed>';


Insert this code at line 180 in /class/module.textsanitizer.php and you will be able to put in a background sound on a page with the following examples.

[bgsound noembed loop=11 delay=11 volume=80]http://www.ididj.com.au/downloads/quicktime/didgmagmp3/walarri_1.mp3[/bgsound]
[bgsound noembed loop=11 delay=11]http://www.ididj.com.au/downloads/quicktime/didgmagmp3/walarri_2.mp3[/bgsound]
[bgsound noembed]http://www.ididj.com.au/downloads/quicktime/didgmagmp3/walarri_3.mp3[/bgsound]
[bgsound loop=yes]http://www.ididj.com.au/downloads/quicktime/didgmagmp3/walarri_4.mp3[/bgsound]
[bgsound]http://www.ididj.com.au/downloads/quicktime/didgmagmp3/walarri_7.mp3[/bgsound]


To see an example in for example ie6 or ie7 goto -http://www.extraterrestrialembassy.com/gallery/Ancient-History/Aboriginal-Spirits---Australia/24,3

End of Transmission
Resized Image
www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

2
Runeher
Re: Background Sound Hack [bgsound]...[/bgsound]
  • 2008/6/19 9:54

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


or you could add this simple code in the page's template:

<embed src="http://yoursite.com/music/something.mp3" autostart="true" loop="true" hidden="true"></embed>


Also works in Mozilla...

3
wishcraft
Re: Background Sound Hack [bgsound]...[/bgsound]

Ok Rune, how you doing? Hey I use to talk to a Norwegian diplomate about a few things called Lars Alser, he seemed nice - hows all things in the land of the trolls, I have altered it to do your embed, but for some reason something is preventing me from downloading quick time drivers, which is okay they are here in my computer.

I have altered that code, do you think I should pull some detect if it is IE, otherwise use the embed method?
Resized Image
www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

4
kerkyra
Re: Background Sound Hack [bgsound]...[/bgsound]
  • 2008/6/19 12:50

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hey mate perhaps you could try the following!
i think ie detects the object tag and mozilla detects the embed tag. Or the other way around.:)

Quote:
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" >
<param name="SRC" value="source file">
<param name="AUTOPLAY" value="true">
<param name="CONTROLLER" value="true">
<embed src="source file" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/" >
</object>
www.guidemap.gr - Beta is out...

5
Peekay
Re: Background Sound Hack [bgsound]...[/bgsound]
  • 2008/6/19 19:59

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


@wishcraft

Er... thats a 66 Kb animated image in your sig. You will not be popular with the mod.
A thread is for life. Not just for Christmas.

6
luciorota
Re: Background Sound Hack [bgsound]...[/bgsound]
  • 2008/6/19 20:15

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


a wish for the next XOOPS version:
customizable XOOPS tags, by users and by modules too...
it will be a very useful function
Rota Lucio
lucio.rota@gmail.com;
mobile: +39 338 9966321

7
eejut
Re: Background Sound Hack [bgsound]...[/bgsound]
  • 2008/8/4 17:31

  • eejut

  • Just popping in

  • Posts: 86

  • Since: 2005/5/16


so how wouod visitors turn that off?
cos lordy, that was a racket

Login

Who's Online

255 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 255


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits