Qartvela™ Posted December 24, 2013 Share Posted December 24, 2013 IPB 3.4.6Shoutbox 1.4.1 ShoutBox - Поменять функция Sound Play on new shout на Page Title Notification При новое сообщение играет shout.mp3 За это отвечает: /admin/applications_addon/other/shoutbox/sources/classes/library.php # Found new shouts?!? if ( $content != "" ) { $new_ids = count($new_ids) ? implode(",", $new_ids) : ""; $a = array('shouts' => $content, 'ids' => $new_ids, 'sound' => '', #'force' => 0, //TODO: this variable is needed in a future version to fix the bugs caused by editing a shout/clearing the cache ); //---------------------------------- // Shout Alerts //---------------------------------- if( $new_ids != "" AND $this->settings['shoutbox_enable_sound'] AND ! $this->prefs[ 'disable_sound' ] ) { $a['sound'] = "soundManager.play('shoutbox-shouts', ipb.vars['board_url'] + '/public/sounds/shout.mp3' );\n"; } $content = $this->registry->output->getTemplate('shoutbox')->shouts_ajax( $a ); } Никак не получается засунуть там за место:$a['sound'] = "soundManager.play('shoutbox-shouts', ipb.vars['board_url'] + '/public/sounds/shout.mp3' );\n";код Page Title Notification:<script type="text/javascript"> var origionalTitle = document.title; var titleInterval; var newTitle = "Новая сообщение в чате"; window.isActive = true; function alertTitle( ){ if(!window.isActive){ window.clearInterval(titleInterval); titleInterval = window.setInterval( changeTitle , 1500 ); } }; function changeTitle() { if( document.title == origionalTitle ){ document.title = newTitle; } else { document.title = origionalTitle; } }; </script> P.S. О Audio Shoutbox Alerts я знаю, но не хочется ставить лишние компоненты. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now