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

Sound notification upon entry of new user

Post a bug fix, a new feature, a theme ...

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

Post a reply
8 posts • Page 1 of 1

Postby Hobbiest » Sun Jan 23, 2011 1:25 am

I posted this under Feaure request and I solved it by myself. http://www.phpfreechat.net/forum/viewtopic.php?id=4754

I studied the codes and found out that it's simple to solve:

****First back up the files before chaging anything****

Open up commands/notice.class.php
find:
Code: Select all
$res = $ct->write($recipient, $nick, "notice", $msg);

change that to:
Code: Select all
$res = $ct->write($recipient, $nick, "send", $msg);

That's all.

You should hear sound when new use logs in.
Hobbiest
Member
 
Posts: 15
Joined: Wed Jan 19, 2011 1:12 am
Top

Postby re*s.t.a.r.s.*2 » Sat Mar 26, 2011 1:53 pm

Well, it could work if you don't mind to loose the "notice" command...

regards.
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 Calman45 » Mon Mar 28, 2011 9:40 pm

.. tried it and seemed a bit untidy!!!

People were complaining about the timeout notices etc, appearing beside their name, rather than a global grey notice below messages in chat.

Nice idea though!

All the best,
Cal :)
Calman45
Support Team
 
Posts: 150
Joined: Sun Oct 26, 2008 11:09 pm
Location: Western Canada
  • Website
Top

Postby Jordan » Fri Apr 01, 2011 9:10 pm

But there is not any notice in below message chat.
Ear Plugs
Jordan
New member
 
Posts: 1
Joined: Mon Mar 28, 2011 10:03 am
Location: Chicago, IL.
Top

Re: Sound notification upon entry of new user

Postby Qem » Mon Apr 29, 2013 2:14 am

Great idea - To make it more obvious that a person was leaving, but still make noise, I changed this to "me" instead of "send".
Qem
New member
 
Posts: 7
Joined: Mon Apr 22, 2013 9:27 am
Top

Re: Sound notification upon entry of new user

Postby Alky » Fri May 03, 2013 1:13 am

I've been thinking about this one, but would probably do it as a file hack higher up the food chain. Like, in pfcclient.js look for "this.gui.notifyWindow();" and a handful of lines above it you'll see a fairly simple conditional to which you add 'or notify'.

Sorry about not having proper code quotes but I've been overhauling like crazy and don't know what in mine actually matches the real files :(

Then you get sound in addition to all the stuff that notify does, which means you'd also get a ding when someone quit or quit (timeout) ... which isn't what I'm after. I just want it when they enter a room.
Alky
New member
 
Posts: 8
Joined: Thu Mar 21, 2013 6:53 pm
  • Website
Top

Re: Sound notification upon entry of new user

Postby Qem » Sat May 04, 2013 12:12 pm

Oh hey, it does work, and doesn't give the double name variation.

Old Code:
Code: Select all
 if (oldmsg == 0)
        if (cmd == 'send' || cmd == 'me')
        {
          // notify the hidden tab a message has been received
          // don't notify anything if this is old messages
          var tabid = recipientid;
          if (this.gui.getTabId() != tabid)
            this.gui.notifyTab(tabid);
          // notify the window (change the title)
          if (!this.detectactivity.isActive() && pfc_notify_window)
            this.gui.notifyWindow();
        }


New Code:
Code: Select all
      if (oldmsg == 0)
        if (cmd == 'send' || cmd == 'me' || cmd == 'notice')
        {
          // notify the hidden tab a message has been received
          // don't notify anything if this is old messages
          var tabid = recipientid;
          if (this.gui.getTabId() != tabid)
            this.gui.notifyTab(tabid);
          // notify the window (change the title)
          if (!this.detectactivity.isActive() && pfc_notify_window)
            this.gui.notifyWindow();
        }
Qem
New member
 
Posts: 7
Joined: Mon Apr 22, 2013 9:27 am
Top

Re: Sound notification upon entry of new user

Postby Keesha951 » Mon Dec 02, 2013 10:41 am

Thanks for sharing.
Keesha951
New member
 
Posts: 1
Joined: Mon Dec 02, 2013 10:34 am
Top


Post a reply
8 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 7 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