vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   play a sound when a forum is loaded (https://vborg.vbsupport.ru/showthread.php?t=311585)

gullbird 05-22-2014 05:46 PM

play a sound when a forum is loaded
 
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

Quote:

Originally Posted by final kaoss (Post 2499000)
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 [DATE]1400788640[/DATE] at [TIME]1400788640[/TIME] ---------------

i have some code like this
Code:

<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

HTML Code:

<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

Quote:

Originally Posted by Zachery (Post 2499006)
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

Quote:

Originally Posted by Zachery (Post 2499014)
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
HTML Code:

    <!-- 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.


All times are GMT. The time now is 03:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01183 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete