Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Qartvela™

ShoutBox - Поменять функция Sound Play на Page Title Notification

Recommended Posts

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 я знаю, но не хочется ставить лишние компоненты.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...