Опубликовано: 24 декабря 201311 г 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 я знаю, но не хочется ставить лишние компоненты.
IPB 3.4.6
Shoutbox 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 я знаю, но не хочется ставить лишние компоненты.