PDA

View Full Version : Play a sound when new PMs are recieved..


EvilLS1
17 Nov 2002, 09:48
This is a very simple little hack that will play a sound when you have a new (unread) private message.

A friend was asking if there was a hack to do this so I searched the hacks database and this forum and didn't see anything, but I'd be suprised if someone hasn't already done it because its so simple. So if this has already been done by someone else, my appologies..

We just converted over to vB from phpBB a few weeks ago, and for some reason the import script set everyones preferences to not be notified by email or pop-up when new PMs are recieved. So this helps make sure that they notice them anyway.


:)

DWZ
17 Nov 2002, 10:56
hehe, cool idea :)

/me imagines AOL's "You've got mail" thing playing on new PM

corsacrazy
17 Nov 2002, 12:20
nice one maty :D has any one got any more sounds to have ? ? installed :D

EvilLS1
17 Nov 2002, 12:37
Thanks. :)

Here's a couple of sites with a lot of free sound files:

http://www.eventsounds.com/

http://www.top50wavsites.com/

EvilLS1
17 Nov 2002, 12:53
Originally posted by DWZ
hehe, cool idea :)

* DWZ imagines AOL's "You've got mail" thing playing on new PM

I can't take credit for the idea. Someone else has done the same thing for phpBB forums. :)

Chris M
17 Nov 2002, 15:38
But they havent for vB, so good going:)

Nice idea, but I dont like Wav's on websites;)

*installs on test board*

Satan

Obi-Wan
17 Nov 2002, 17:51
Seems like a kewl hack m8, Thx.

were's the screenshot...HAHAHA

350Chevy
17 Nov 2002, 20:36
Works like a charm! :)

I'll be playing around with figuring out how to get random PM's from a folder to play instead of just one. ;)

Link14716
17 Nov 2002, 21:33
A similar hack has been made from FireFly, only his makes the header of the PM table flash a different table.

Nice job on this hack, nevertheless :)

EvilLS1
17 Nov 2002, 22:54
Thanks. Glad a few others found it useful. 350Chevy is the friend I mentioned above (his idea to do this mod for vB). He's another phpBB traitor like me. :laugh:

I installed the flashing PM hack by Firefly too. Awesome! Yet another way to make new PMs more noticible. :)

ManagerJosh
18 Nov 2002, 04:29
Bleah..I hate using WAVs. They seem to use too much bandwith :(
But nevertheless, great hack :)

350Chevy
18 Nov 2002, 04:37
Originally posted by ManagerJosh
Bleah..I hate using WAVs. They seem to use too much bandwith :(
But nevertheless, great hack :)

Nah, the wav files I use are usually less than 10k... I bet your Banner takes up more Bandwidth than that! :)

Intex
24 Nov 2002, 08:42
Nice1. Will it work ok on 2.2.6?

EvilLS1
24 Nov 2002, 08:59
It should work fine with 2.2.6. :)

Chris M
24 Nov 2002, 10:25
It should work with any 2.2.x version of vB;)

Satan

Dean C
24 Nov 2002, 10:29
A midi would be a bit better :)

- miSt

EvilLS1
24 Nov 2002, 11:29
Originally posted by Mist
A midi would be a bit better :)

- miSt

It will play midis too. :)

Schorsch
22 Jan 2003, 18:07
very nice, thank you :banana:

amykhar
17 Mar 2003, 19:35
Removed to release independantly.

amykhar
17 Mar 2003, 19:48
Removed to improve and release independantly.

Jucin
17 Mar 2003, 22:58
Im not getting any sound???

is the code supposed to be put like this

if ($newpm['messages']==0) {
$lightbulb='off';
} else {
$lightbulb='on';
}//new PM sound hack
if ($unreadpm['messages']==0) {
$sound='';
} else {
$sound='<embed src="message.wav" autostart="true" hidden="true">';
}
//end new PM sound hack



or have no break in it like this?

if ($newpm['messages']==0) {
$lightbulb='off';
} else {
$lightbulb='on';
}
//new PM sound hack
if ($unreadpm['messages']==0) {
$sound='';
} else {
$sound='<embed src="message.wav" autostart="true" hidden="true">';
}//end new PM sound hack

Boofo
17 Mar 2003, 23:12
Today at 02:35 PM amykhar said this in Post #19 (http://www.vbulletin.org/forum/showthread.php?postid=368205#post368205)
That hack works quite well when you are on the main page. I have modified it a bit to work on any pages.


Add a new template called head_sound

This is the contents of the new template:


<embed src="message.wav" autostart="true" hidden="true">


In global.php Find:


eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");


Place above:

eval("\$headnewpm = \"".gettemplate('head_sound')."\";");


That should do it. I am going to put an addon that allows the member to select whether or not they want sounds to play.

Amy

Is this code supposed to be added to the main one in the first post or is this to replace it?

amykhar
17 Mar 2003, 23:57
Replace it. I am using his sound file or I would have just released it as a new hack :D

Amy

Boofo
18 Mar 2003, 00:05
Thank you very much. ;)

EvilLS1
18 Mar 2003, 00:21
Today at 12:57 AM amykhar said this in Post #23 (http://www.vbulletin.org/forum/showthread.php?postid=368349#post368349)
Replace it. I am using his sound file or I would have just released it as a new hack :D

Amy

Nice Amy. You should release your version as its completely different (and much better) than mine. :) You can still use the sound file. :p

Or if you don't want to release it seperately I can add your version (as a seperate hack) to the first post of this thread and put your name by it if you want.

amykhar
18 Mar 2003, 01:05
Thank you EvilS1 :)

I am going to delete it for now and tweak it a wee bit. I wasn't paying attention this morning and the version I have now only works if popups are turned on. I'll fix that and release it when it's done tonight or tomorrow.

Amy

EvilLS1
18 Mar 2003, 01:23
Jucin,
Add the code exactly as it is in the instructions.. It should look like this:

//new PM sound hack
if ($unreadpm['messages']==0) {
$sound='';
} else {
$sound='<embed src="message.wav" autostart="true" hidden="true">';
}
//end new PM sound hack


And make sure you added $sound to your forumhome_pmloggedin template.

If you've done that and uploaded message.wav to your forum directory then it should work.

-Sidekick-
04 Jun 2003, 21:26
I installed a hack like this once for vB and it ended up breaking the Popup on PM feature. Does this hack interrupt that feature at all?

Also, could someone show me what would have to be modified to have this feature picked as default when signing up instead of email on pm.

EvilLS1
04 Jun 2003, 22:24
Today at 10:26 PM -Sidekick- said this in Post #28 (http://www.vbulletin.org/forum/showthread.php?postid=404473#post404473)
I installed a hack like this once for vB and it ended up breaking the Popup on PM feature. Does this hack interrupt that feature at all?

Also, could someone show me what would have to be modified to have this feature picked as default when signing up instead of email on pm.

This will have no effect on the popup pm feature. And once you add the hack it will already be default for all users because its not selectable in the profile. If you would rather have it so that users can choose if they want a sound to play or not then take a look at amykhar's version of this hack.