• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

How to have sound notification for user entry into chat

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
6 posts • Page 1 of 1

Postby Hobbiest » Wed Jan 19, 2011 1:35 am

First of all, I am using phpfreechat1.3. I tried putting the below codes to have a sound alert for new user join.

Code: Select all
 function alert()
{
$objResponse = new xajaxResponse();


                $objResponse->addAssign("alert","innerHTML","<embed src='entered.wav' hidden=true autostart=true loop=false>");
return $objResponse->getXML();
}

in srcphpfreechat.class.php:

and
Code: Select all
<span id='alert'></span>

in defaultchat.html.tpl.php

entered.wav is placed in default directory and the root as well.
No sound. It did not work. Also, it disabled the message notification sound !

I tried some Javascripts but they did not send notification to all opened chat clients.

Can someone help me please. Thanks in advance.
Last edited by Hobbiest on Wed Jan 19, 2011 1:41 am, edited 1 time in total.
Hobbiest
Member
 
Posts: 15
Joined: Wed Jan 19, 2011 1:12 am
Top

Postby re*s.t.a.r.s.*2 » Wed Jan 19, 2011 3:43 am

You Need to call the function function alert();

Possibly using <body onload="alert();"> because users loads the page when enters..

Just saying something..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby Hobbiest » Wed Jan 19, 2011 4:21 pm

Do you mean to say that add:

Code: Select all
<body onload="alert();">

in defaultchat.html.tpl.php

It disables the message notification for incoming messages.
Hobbiest
Member
 
Posts: 15
Joined: Wed Jan 19, 2011 1:12 am
Top

Postby Hobbiest » Wed Jan 19, 2011 4:30 pm

I tried it. It doesn't work:(
Hobbiest
Member
 
Posts: 15
Joined: Wed Jan 19, 2011 1:12 am
Top

Postby re*s.t.a.r.s.*2 » Wed Jan 19, 2011 5:43 pm

Never mind that wouldn't work because it doesnt get sent for the user you only able to heard it because your browser request it.. not them.

In order to workout something you must find the JS code that calls the Sound when someone PV you...
Check at pfcclient.js... and find the code..
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top

Postby Hobbiest » Wed Jan 19, 2011 6:41 pm

I used JS and it makes sound only on my machine, not other open chats.

So, when someone sends, message, which code kicks in to make sound?

This sound notification is very helpful to bring more people in the chat room as some people leave the chat client on to find someone to chat with. Often, they miss people just logged in and quit after waiting for sometime.
Hobbiest
Member
 
Posts: 15
Joined: Wed Jan 19, 2011 1:12 am
Top


Post a reply
6 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 22 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub