vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Battle music in RPG Inferno lite (https://vborg.vbsupport.ru/showthread.php?t=123258)

Renmiri 08-06-2006 10:00 PM

Battle music in RPG Inferno lite
 
You know how the music starts again every time you attack ? A bit annoying, isn't it ? Easily fixed with just 2 minimal template changes and a lil' plugin.

Step 1
Download the plugin from here and import it.

Step 2
On the inferno_battle_music template remove all that is there (causes the music to restart every time the page gets reloaded, which is every time someone attacks)

Step 3
On the inferno_battle_your_battle template (or any of those "inferno_battle..." templates) add a link to the battle music using the code below, which opens a new window for your music (which never gets reloaded so your battle music will stop "stuttering").

On to inferno_battle_your_battle
Find:
Code:

<td class="thead" width="100%" align='center'>{$turn}
Add right after {$turn} (or instead of it, like I did in the screenshot below)
Code:

Music: $inferno_battle_music2
Step 4:
Add the template $inferno_battle_music2 to your styles with this code:

Code:

<FORM>
<select onChange="if(options[selectedIndex].value) window.open(options[selectedIndex].value,'_blank','config');" size="1">$GLOBALS[bmusic]
</SELECT>
</FORM>

You are done!

Now the users need to click on the link you added to hear the battle music, which will be launched in a popup window by the javascript file. Sorry for the popup window but it is necessary: Being on a different window, the soundtrack won't start and stop anymore at every page refresh :D

Depending on each of your user's browser plugins (i.e if they have set Quicktime or Flash to handle midi files properly) the new window will also allow them to pause, stop, change the music volume, etc...

Version 2.0
* Eliminated the need for a javascript
* Added a Music selection bar instead of just replaying the same music over and over
* the new template with the music selection bar works ANYWHERE on the forum, including Forumhome and footer (second screenshot)! :)


All times are GMT. The time now is 05:02 PM.

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.01730 seconds
  • Memory Usage 1,711KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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