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

Message notification (sound)

This forum is now locked as we will no longer be developing the v1.x branch

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

Topic locked
28 posts • Page 2 of 2 • 1, 2

Postby cpinhawaii » Wed Mar 29, 2006 2:46 am

Re: sound & smiley/online bug:

I found that by adding the following to the page holding my chat, the smiley/online hide/show seems to work fine in IE (so far):

<style type="text/css">
body, html {margin:0;padding:0;background:#ffffff;font-size:13px;
font-family:Verdana,Arial,Helvetica,san-serif}
</style>

(If someone could post the above in the correct place, that would be great, Thanks)

For adding sound to the new message event:

I created a swf file 1px x 1px clear, which carries a wav file, set to play onload, no loop.

(You'd have to change the value of the param movie and embed src tag to your swf file.)

Add this xajax function (innerHTML) if new chat message sent (not sure best place to put this, haven't studied your script too much.)

function soundalert()
{
$objResponse = new xajaxResponse();

$alert = "<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" id="ping" width="1" height="1">";
$alert .= "<param name="movie" value="/audio/ding.swf">";
$alert .= "<param name="loop" value="false">";
$alert .= "<param name="quality" value="high">";
$alert .= "<param name="wmode" value="transparent">";
$alert .= "<param name="bgcolor" value="#78A2BD">";
$alert .= "<embed name="ping" src="/audio/ding.swf" loop="false" quality="high" wmode="transparent" bgcolor="transparent" swLiveConnect="true" width="1" height="1" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object>";
$objResponse->addAssign("sendalert","innerHTML",$alert);
return $objResponse->getXML();
}


Add this at the very top of chat.html.tpl.php to hold the object info:

<div id="sendalert"></div>

This worked for us, using thewall example in xajax. I'll certainly share my swf if someone could help in placing this code.
cpinhawaii
New member
 
Posts: 2
Joined: Wed Mar 29, 2006 2:37 am
Top

Postby phpfreechat » Wed Mar 29, 2006 9:03 am

cpinhawaii wrote:I found that by adding the following to the page holding my chat, the smiley/online hide/show seems to work fine in IE (so far):

<style type="text/css">
body, html {margin:0;padding:0;background:#ffffff;font-size:13px;
font-family:Verdana,Arial,Helvetica,san-serif}
</style>

Hum this tip is nice but I think I can't integrate into the pfc source code because it will change the page layout.
I don't want pfc changes other elements styles than its own box.

However I will suggest this workeround to IE users. Thanks.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby cpinhawaii » Wed Mar 29, 2006 10:23 am

That's just what I happened to use for my page, but any code should do, ie

body, html {margin:5px;padding:5px}

This wouldn't have any effect on your base html.
cpinhawaii
New member
 
Posts: 2
Joined: Wed Mar 29, 2006 2:37 am
Top

Postby phpfreechat » Wed Mar 29, 2006 10:26 am

Wrong, if the parent page body has a default zero margin/padding, it will affect the layout.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Hattu » Fri Mar 31, 2006 12:14 pm

Bonjour,

Ne serait-il pas possible d'avoir la barre du titre de la page qui clignote quand il y a un nouveau message ?

I don't know if it is easy to do but why not having a flashing title bar on new message or connections ?
Hattu
New member
 
Posts: 1
Joined: Fri Mar 31, 2006 11:35 am
Top

Postby phpfreechat » Fri Mar 31, 2006 12:29 pm

This kind of notification is planned in the roadmap but I don't know when I will have time to work on it.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby xyzzy_bill » Wed May 31, 2006 10:13 pm

I've got sounds working in FF, haven't tested elsewhere. I put in a delay so that you don't get beeped for every message, just if there's been no activity for a minute.

I'm using the embeddummy code posted above. The patch to src/command/getnewmsg.class.php is:

55d54
< $other_data_sent = false;
67,69d65
< if($this->u->nick != $m_sender) {
< $other_data_sent = true;
< }
78,83d73
< $lastTime = $_SESSION["lastTime"];
< if ($other_data_sent && $lastTime != 0 && time() - $lastTime > 60) {
< // Beep to get user's attention.
< $xml_reponse->addClear("embeddummy","innerHTML");
< $xml_reponse->addAssign("embeddummy","innerHTML","<embed src='success.wav' hidden=true autostart=true loop=false>");
< }
88d77
< $_SESSION["lastTime"] = time();
97c86
Last edited by xyzzy_bill on Wed May 31, 2006 10:14 pm, edited 1 time in total.
xyzzy_bill
New member
 
Posts: 1
Joined: Wed May 31, 2006 9:48 pm
Top

Postby cebronx » Wed Sep 06, 2006 8:04 pm

bsemf wrote:Here is my solution (in 3 steps!!)
Add at the end of ~pfctemplatesdefaultchat.html.tpl.php this line:
Code: Select all
<span id='embeddummy'></span>

Find this line in ~pfcsrcphpfreechat.class.php:
Code: Select all
      $xml_reponse->addScript($c->prefix."parseAndPost(".$m_id.",'".addslashes($m_date)."','".addslashes($m_heure)."','".addslashes($m_nick)."','".addslashes($m_words)."','".addslashes($m_cmd)."',".(date("d/m/Y") == $m_date ? 1 : 0).",".($from_id == 0? 1 : 0).");");

Add after that line this one:
Code: Select all
      $xml_reponse->addAssign("embeddummy","innerHTML","<embed src='success.wav' hidden=true autostart=true loop=false>");

It works fine on win32 with FF and IE. You just have to get a sound file called success.wav into clientfile directory.

I found my one here but I dont like it (Hope there are no copyright problems)^^
http://www.phon.ucl.ac.uk/home/mark/audio/success.wav

IT DOESN"T WORK FOR ME WHY IS THAT? IS IT BECAUSE IM USING PFC 1.X? I WOULD LOVE TO HAVE THIS WORKING.... THANKS!
Luis
cebronx
Member
 
Posts: 32
Joined: Mon Aug 28, 2006 3:22 am
Location: Bronx, NY
  • Website
Top

Postby phpfreechat » Tue Sep 12, 2006 8:51 am

Hattu wrote:Bonjour,

Ne serait-il pas possible d'avoir la barre du titre de la page qui clignote quand il y a un nouveau message ?

I don't know if it is easy to do but why not having a flashing title bar on new message or connections ?

With the lastest subversion revision (753) it's now possible to have window title notifications.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby markdarb » Fri Dec 08, 2006 2:58 am

Hi. I'm using 1.0-beta7, and I don't know where to put the coding to make the sound play when a new message is received. Where should it go?

Also, I've made a sound in Audacity which is at http://gark.goldeye.info/chat/sound.wav. Feel free to use it if you like it.
markdarb
New member
 
Posts: 3
Joined: Fri Dec 08, 2006 2:50 am
Top

Postby phpfreechat » Fri Dec 08, 2006 9:11 am

markdarb, please wait for the next 1.0-beta8 release, it will include the sound feature.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby markdarb » Fri Dec 08, 2006 11:04 am

OK, thanks. By the way the program in general is really good; thanks and keep up the good work!
markdarb
New member
 
Posts: 3
Joined: Fri Dec 08, 2006 2:50 am
Top

Postby spin0us » Tue Jan 16, 2007 3:43 pm

- Est-il possible d'avoir un son lorsque l'on parle de nous sur un salon, même si on est déjà sur ce salon ?

- Est-il possible d'avoir un son lorsque l'on nous parle en MP ?

--------------------------

- Is it possible to play sound when someone talk about us on a room, even if we are already on this room ?

- Is it possible to play sound when someone talk in private ?
phpFreeChat 1.0pre8 installed on http://forum.cb500.org
spin0us
New member
 
Posts: 4
Joined: Tue Jan 16, 2007 1:51 pm
Location: Lyon, France
  • Website
Top

Previous

Topic locked
28 posts • Page 2 of 2 • 1, 2

Return to Feature Requests (v1.x)

Who is online

Users browsing this forum: No registered users and 1 guest

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