PDA

View Full Version : play a sound when a forum is loaded


gullbird
05-22-2014, 05:46 PM
is there a way so that i can play a sound whenever a forum is loaded
defining through admin panel which sound file is for the forum or sub forum

final kaoss
05-22-2014, 06:34 PM
I would hate hearing a sound every time a page loads, especially if I frequented the forum & browsed/posted alot.

gullbird
05-22-2014, 06:41 PM
I would hate hearing a sound every time a page loads, especially if I frequented the forum & browsed/posted alot.

the one who hate will never visit the forum again or step away on visit thats Good
i seeking an idea
admin cp ll have option to set a sound file for each forum
so when a user loads a forum it will see audio and play it

--------------- Added 1400788640 at 1400788640 ---------------

i have some code like this
<script type="text/javascript" src="src/java.js"></script>
<script type="text/javascript">
some JS
</script>

to add javascript
and have some DIVs to include


<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
Some Text
</div>
</div>


hope some one will help

Zachery
05-22-2014, 07:36 PM
You're only likely to chase away your own visitors with this :(

gullbird
05-22-2014, 08:36 PM
You're only likely to chase away your own visitors with this :(

yes :D
conditions come true false based on purpose
if i go to a bar i have to accept there'll be music chill etc and if i don't like that i should not go there

Zachery
05-22-2014, 08:47 PM
Are you okay when your music stops/cganges/reloads, everytime you sip your drink, move slightly, ask the bartender something, pay?

gullbird
05-22-2014, 09:14 PM
Are you okay when your music stops/cganges/reloads, everytime you sip your drink, move slightly, ask the bartender something, pay?

Yes this is what i am doing
i am a teacher i ll not allow non students (of mine) to enter into forum
my students know they are visiting to listen

Not sure why but i had the same situation on a free board script personally i think public forums are crap
a very big WHY for every question that do not fits to marketing seo traffic

Zachery
05-22-2014, 09:23 PM
It is your forum, if you want to kill all of the traffic going to it, that's your choice.

Lynne
05-22-2014, 11:07 PM
Please don't play sound on your forum. Please. Pretty please.

tbworld
05-23-2014, 12:19 AM
Although, I completely agree with the other board members on the topic, you cannot make that determination unless you try it yourself. This is just to give you a 'possibility' as you asked -- something you can do yourself. It will not work with most older browsers, with older browsers it will either not display, or not play 'mp3' audio. See Google "HTML5 <audio>" for details ...

Put your "renamed" MP3 files in a directory named "music".
For example: "/music/music_XX.mp3". Where "XX" is the "forum ID".

Place code before or after the footer variable ({vb:raw footer}) in the "FORUMDISPLAY" template

<!-- HTML5 solution -->
<audio controls autoplay id="tbworld_audio" src="{vb:raw vboptions.bburl}/music/music_{vb:raw forumid}.mp3" type="audio/mpeg"></audio>
<audio controls autoplay id="tbworld_audio" src="{vb:raw vboptions.bburl}/music/music_{vb:raw forumid}.ogg" type="audio/mpeg"></audio> <!-- Opera Next -->

<!-- HTML5 --- Pre-Adjust volume level -->
<script>
var AudioPlayer = document.getElementById("tbworld_audio");
AudioPlayer.volume = 5.5;
<script>

<!-- or -->

<!-- Embedded Solution -->
<embed src="{vb:raw vboptions.bburl}/music/music_{vb:raw forumid}.mp3" type="audio/mpeg" width="120" height="35" autostart="true" loop="false">

Firefox now supports Mp3 for HTML5.:) Opera Next, will require the embedded solution or an ".ogg" extension.

This code will play a unique mp3 file given a "unique forum ID".

Nothing fancy.